Commit c0725266 by Matt Drayer Committed by Jonathan Piacenti

mattdrayer/api-profiler-middleware: Hotshot/CProfile support

parent be8135a5
......@@ -79,6 +79,17 @@ def should_show_debug_toolbar(_):
INSTALLED_APPS += (
# Mongo perf stats
'debug_toolbar_mongo',
)
############# 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',
)
......@@ -86,6 +97,42 @@ DEBUG_TOOLBAR_PANELS += (
'debug_toolbar_mongo.panel.MongoDebugPanel',
)
################################ 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.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.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 += (
# Mongo perf stats
'debug_toolbar_mongo',
)
########################### PIPELINE #################################
PIPELINE_SASS_ARGUMENTS = '--debug-info --require {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT)
......
......@@ -508,3 +508,21 @@ FEATURES['ENABLE_MAX_FAILED_LOGIN_ATTEMPTS'] = False
FEATURES['SQUELCH_PII_IN_LOGS'] = False
FEATURES['PREVENT_CONCURRENT_LOGINS'] = False
FEATURES['ADVANCED_SECURITY'] = False
<<<<<<< HEAD
=======
PASSWORD_MIN_LENGTH = None
PASSWORD_COMPLEXITY = {}
############# 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',
)
>>>>>>> a00f851... mattdrayer/api-profiler-middleware: Hotshot/CProfile support
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