From 281f754ff98b0b362903778d5e606952a2f7ca3f Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 16 2014 07:49:59 +0000 Subject: Add the option to get profiling information via runserver --- diff --git a/runserver.py b/runserver.py index ca41080..99cfd1d 100755 --- a/runserver.py +++ b/runserver.py @@ -4,6 +4,14 @@ __requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4'] import pkg_resources +import sys +from werkzeug.contrib.profiler import ProfilerMiddleware + from progit import APP APP.debug = True + +if '--profile' in sys.argv: + APP.config['PROFILE'] = True + APP.wsgi_app = ProfilerMiddleware(APP.wsgi_app, restrictions=[30]) + APP.run()