Created
October 31, 2016 11:26
-
-
Save hunt3ri/ff7812e14d183d62b2368d4dc7e4c6aa to your computer and use it in GitHub Desktop.
Add profiling to Python Flask app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@manager.command | |
def profile(length=500, profile_dir=None): | |
"""Start the application under the code profiler.""" | |
from werkzeug.contrib.profiler import ProfilerMiddleware | |
application.wsgi_app = ProfilerMiddleware(application.wsgi_app, restrictions=[length], profile_dir=profile_dir, | |
sort_by=('time', 'calls')) | |
application.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment