Commit c6f27742 by Chris Dodge

add a few debug messages to get localhost debug information. Also partition out…

add a few debug messages to get localhost debug information. Also partition out the MongoDjangoToolbar configuration into a separate env config. This is because doing imports on large courses grinds localdev to a halt due to all the stack trace generation.
parent b1b8f19c
...@@ -315,6 +315,8 @@ def import_course(request, org, course, name): ...@@ -315,6 +315,8 @@ def import_course(request, org, course, name):
create_all_course_groups(request.user, course_items[0].location) create_all_course_groups(request.user, course_items[0].location)
logging.debug('created all course groups at {0}'.format(course_items[0].location))
return HttpResponse(json.dumps({'Status': 'OK'})) return HttpResponse(json.dumps({'Status': 'OK'}))
else: else:
course_module = modulestore().get_item(location) course_module = modulestore().get_item(location)
......
...@@ -150,14 +150,13 @@ DEBUG_TOOLBAR_PANELS = ( ...@@ -150,14 +150,13 @@ DEBUG_TOOLBAR_PANELS = (
'debug_toolbar.panels.sql.SQLDebugPanel', 'debug_toolbar.panels.sql.SQLDebugPanel',
'debug_toolbar.panels.signals.SignalDebugPanel', 'debug_toolbar.panels.signals.SignalDebugPanel',
'debug_toolbar.panels.logger.LoggingPanel', 'debug_toolbar.panels.logger.LoggingPanel',
'debug_toolbar_mongo.panel.MongoDebugPanel',
# Enabling the profiler has a weird bug as of django-debug-toolbar==0.9.4 and # Enabling the profiler has a weird bug as of django-debug-toolbar==0.9.4 and
# Django=1.3.1/1.4 where requests to views get duplicated (your method gets # Django=1.3.1/1.4 where requests to views get duplicated (your method gets
# hit twice). So you can uncomment when you need to diagnose performance # hit twice). So you can uncomment when you need to diagnose performance
# problems, but you shouldn't leave it on. # problems, but you shouldn't leave it on.
# 'debug_toolbar.panels.profiling.ProfilingDebugPanel', # 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
) )
DEBUG_TOOLBAR_CONFIG = { DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False 'INTERCEPT_REDIRECTS': False
...@@ -165,7 +164,7 @@ DEBUG_TOOLBAR_CONFIG = { ...@@ -165,7 +164,7 @@ DEBUG_TOOLBAR_CONFIG = {
# To see stacktraces for MongoDB queries, set this to True. # To see stacktraces for MongoDB queries, set this to True.
# Stacktraces slow down page loads drastically (for pages with lots of queries). # Stacktraces slow down page loads drastically (for pages with lots of queries).
DEBUG_TOOLBAR_MONGO_STACKTRACES = True DEBUG_TOOLBAR_MONGO_STACKTRACES = False
# disable NPS survey in dev mode # disable NPS survey in dev mode
MITX_FEATURES['STUDIO_NPS_SURVEY'] = False MITX_FEATURES['STUDIO_NPS_SURVEY'] = False
......
"""
This configuration is to turn on the Django Toolbar stats for DB access stats, for performance analysis
"""
from .dev import *
DEBUG_TOOLBAR_PANELS = (
'debug_toolbar.panels.version.VersionDebugPanel',
'debug_toolbar.panels.timer.TimerDebugPanel',
'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
'debug_toolbar.panels.headers.HeaderDebugPanel',
'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
'debug_toolbar.panels.sql.SQLDebugPanel',
'debug_toolbar.panels.signals.SignalDebugPanel',
'debug_toolbar.panels.logger.LoggingPanel',
'debug_toolbar_mongo.panel.MongoDebugPanel'
# Enabling the profiler has a weird bug as of django-debug-toolbar==0.9.4 and
# Django=1.3.1/1.4 where requests to views get duplicated (your method gets
# hit twice). So you can uncomment when you need to diagnose performance
# problems, but you shouldn't leave it on.
# 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
)
# To see stacktraces for MongoDB queries, set this to True.
# Stacktraces slow down page loads drastically (for pages with lots of queries).
DEBUG_TOOLBAR_MONGO_STACKTRACES = True
...@@ -143,7 +143,6 @@ def import_from_xml(store, data_dir, course_dirs=None, ...@@ -143,7 +143,6 @@ def import_from_xml(store, data_dir, course_dirs=None,
# finally loop through all the modules # finally loop through all the modules
for module in xml_module_store.modules[course_id].itervalues(): for module in xml_module_store.modules[course_id].itervalues():
if module.category == 'course': if module.category == 'course':
# we've already saved the course module up at the top of the loop # we've already saved the course module up at the top of the loop
# so just skip over it in the inner loop # so just skip over it in the inner loop
...@@ -177,6 +176,9 @@ def import_from_xml(store, data_dir, course_dirs=None, ...@@ -177,6 +176,9 @@ def import_from_xml(store, data_dir, course_dirs=None,
def import_module(module, store, course_data_path, static_content_store, def import_module(module, store, course_data_path, static_content_store,
source_course_location, dest_course_location, allow_not_found=False): source_course_location, dest_course_location, allow_not_found=False):
logging.debug('processing import of module {0}...'.format(module.location.url()))
content = {} content = {}
for field in module.fields: for field in module.fields:
if field.scope != Scope.content: if field.scope != Scope.content:
......
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