Commit 2a9e527a by Matt Drayer

edX Solutions Team: Runtime Profiler contribution

parent 153843d7
......@@ -57,7 +57,48 @@ DJFS = {
'url_root': '/static/djpyfs',
}
############# Performance Profiler #################
# Note: The Django Debug Toolbar creates a lot of profiling noise, so
# when the profiler is enabled in Devstack we should also disable the toolbar
FEATURES['PROFILER'] = False
if FEATURES.get('PROFILER'):
INSTALLED_APPS += ('profiler',)
MIDDLEWARE_CLASSES += (
'profiler.middleware.HotshotProfilerMiddleware',
'profiler.middleware.CProfileProfilerMiddleware',
)
################################ DEBUG TOOLBAR ################################
FEATURES['DEBUG_TOOLBAR'] = True
if FEATURES.get('DEBUG_TOOLBAR'):
INSTALLED_APPS += ('debug_toolbar',)
MIDDLEWARE_CLASSES += ('django_comment_client.utils.QueryCountDebugMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
INTERNAL_IPS = ('127.0.0.1',)
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',
# 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.ProfilingPanel',
)
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
'SHOW_TOOLBAR_CALLBACK': lambda _: True,
}
INSTALLED_APPS += ('debug_toolbar', 'debug_toolbar_mongo')
MIDDLEWARE_CLASSES += (
......
......@@ -587,3 +587,15 @@ COURSE_CATALOG_API_URL = 'https://catalog.example.com/api/v1'
COMPREHENSIVE_THEME_DIRS = [REPO_ROOT / "themes", REPO_ROOT / "common/test"]
LMS_ROOT_URL = "http://localhost:8000"
############# Performance Profiler #################
# Note: We've added profiler support to this configuration in order
# to enable analysis when running unit tests. (outputs to console)
FEATURES['PROFILER'] = False
if FEATURES.get('PROFILER'):
INSTALLED_APPS += ('profiler',)
MIDDLEWARE_CLASSES += (
'profiler.middleware.HotshotProfilerMiddleware',
'profiler.middleware.CProfileProfilerMiddleware',
)
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