We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97446ad commit 19424c7Copy full SHA for 19424c7
flasky.py
@@ -49,3 +49,16 @@ def test(coverage, test_names):
49
COV.html_report(directory=covdir)
50
print('HTML version: file://%s/index.html' % covdir)
51
COV.erase()
52
+
53
54
+@app.cli.command()
55
+@click.option('--length', default=25,
56
+ help='Number of functions to include in the profiler report.')
57
+@click.option('--profile-dir', default=None,
58
+ help='Directory where profiler data files are saved.')
59
+def profile(length, profile_dir):
60
+ """Start the application under the code profiler."""
61
+ from werkzeug.contrib.profiler import ProfilerMiddleware
62
+ app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[length],
63
+ profile_dir=profile_dir)
64
+ app.run(debug=False)
0 commit comments