Commit 2076007d by Chris Dodge Committed by Xavier Antoviaque

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 21292198
...@@ -594,7 +594,7 @@ class CoursesDetail(SecureAPIView): ...@@ -594,7 +594,7 @@ class CoursesDetail(SecureAPIView):
depth_int = int(depth) depth_int = int(depth)
# get_course_by_id raises an Http404 if the requested course is invalid # get_course_by_id raises an Http404 if the requested course is invalid
# Rather than catching it, we just let it bubble up # 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: if not course_descriptor:
return Response({}, status=status.HTTP_404_NOT_FOUND) return Response({}, status=status.HTTP_404_NOT_FOUND)
if depth_int > 0: if depth_int > 0:
......
...@@ -60,6 +60,16 @@ DEBUG_TOOLBAR_CONFIG = { ...@@ -60,6 +60,16 @@ DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': lambda _: True, 'SHOW_TOOLBAR_CALLBACK': lambda _: True,
} }
INSTALLED_APPS += (
# Mongo perf stats
'debug_toolbar_mongo',
)
DEBUG_TOOLBAR_PANELS += (
'debug_toolbar_mongo.panel.MongoDebugPanel',
)
########################### PIPELINE ################################# ########################### PIPELINE #################################
PIPELINE_SASS_ARGUMENTS = '--debug-info --require {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT) PIPELINE_SASS_ARGUMENTS = '--debug-info --require {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT)
......
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