fix application profiling
This commit is contained in:
parent
0a247a7927
commit
6374d8a9e1
@ -169,13 +169,16 @@ def make_app(conf=None):
|
|||||||
logger.warn("unable to connect to HTTP server")
|
logger.warn("unable to connect to HTTP server")
|
||||||
|
|
||||||
if isso.conf.getboolean("server", "profile"):
|
if isso.conf.getboolean("server", "profile"):
|
||||||
from werkzeug.contrib.profiler import ProfilerMiddleware
|
from werkzeug.contrib.profiler import ProfilerMiddleware as Profiler
|
||||||
isso = ProfilerMiddleware(isso, sort_by=("cumtime", ), restrictions=("isso/(?!lib)", ))
|
ProfilerMiddleware = lambda app: Profiler(app, sort_by=("cumtime", ), restrictions=("isso/(?!lib)", 10))
|
||||||
|
else:
|
||||||
|
ProfilerMiddleware = lambda app: app
|
||||||
|
|
||||||
app = ProxyFix(
|
app = ProxyFix(
|
||||||
wsgi.SubURI(
|
wsgi.SubURI(
|
||||||
wsgi.CORSMiddleware(
|
wsgi.CORSMiddleware(
|
||||||
SharedDataMiddleware(isso, {
|
SharedDataMiddleware(
|
||||||
|
ProfilerMiddleware(isso), {
|
||||||
'/js': join(dirname(__file__), 'js/'),
|
'/js': join(dirname(__file__), 'js/'),
|
||||||
'/css': join(dirname(__file__), 'css/')}),
|
'/css': join(dirname(__file__), 'css/')}),
|
||||||
list(isso.conf.getiter("general", "host")))))
|
list(isso.conf.getiter("general", "host")))))
|
||||||
|
Loading…
Reference in New Issue
Block a user