Skip to content
Snippets Groups Projects
Commit e7a8ef80 authored by ale's avatar ale
Browse files

always run the latency profiler

parent 12c1b5a7
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ from djrandom.frontend.mailer import Mailer
from djrandom.frontend.search import Searcher
from djrandom.model.markov import MarkovModel
from djrandom.model.external import AlbumImageRetriever
from djrandom.frontend.latency import LatencyProfilerMiddleware
from werkzeug.contrib.cache import SimpleCache, MemcachedCache
from gevent.wsgi import WSGIServer
......@@ -37,15 +38,15 @@ def run_frontend(opts):
log.error('Could not read Markov data from %s: %s' % (
opts.markov_data, str(e)))
# Start the WSGI profiling middleware, if requested.
if opts.profile:
from djrandom.frontend.latency import LatencyProfilerMiddleware
app.wsgi_app = LatencyProfilerMiddleware(
app.wsgi_app,
['/json/album', '/json/song', '/album_image',
'/json/playlist/get', '/json/playlist/by_title',
'/json/playlist/list', '/user/activate', '/dl'])
# Install our own latency profiler middleware.
app.wsgi_app = LatencyProfilerMiddleware(
app.wsgi_app,
['/json/album', '/json/song', '/album_image',
'/json/playlist/get', '/json/playlist/by_title',
'/json/playlist/list', '/user/activate', '/dl'])
# Start the cProfile profiling middleware, if requested.
if opts.profile:
from repoze.profile.profiler import AccumulatingProfileMiddleware
app.wsgi_app = AccumulatingProfileMiddleware(
app.wsgi_app,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment