Commit e093fc25 by Chris Dodge Committed by Jonathan Piacenti

cdodge/pass-depth-on-course-fecth: pass along the depth parameter to minimize…

cdodge/pass-depth-on-course-fecth: pass along the depth parameter to minimize round trips to the mongodb. Also turn on MongoDB panel on devstack.py to help with instrumentation
parent 7e439402
......@@ -594,7 +594,7 @@ class CoursesDetail(SecureAPIView):
depth_int = int(depth)
# get_course_by_id raises an Http404 if the requested course is invalid
# Rather than catching it, we just let it bubble up
course_descriptor, course_key, course_content = get_course(request, request.user, course_id) # pylint: disable=W0612
course_descriptor, course_key, course_content = get_course(request, request.user, course_id, depth=depth_int) # pylint: disable=W0612
if not course_descriptor:
return Response({}, status=status.HTTP_404_NOT_FOUND)
if depth_int > 0:
......
......@@ -76,6 +76,15 @@ DEBUG_TOOLBAR_CONFIG = {
def should_show_debug_toolbar(_):
return True # We always want the toolbar on devstack regardless of IP, auth, etc.
INSTALLED_APPS += (
# Mongo perf stats
'debug_toolbar_mongo',
)
DEBUG_TOOLBAR_PANELS += (
'debug_toolbar_mongo.panel.MongoDebugPanel',
)
########################### PIPELINE #################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment