Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A profiler for Flask apps
This module provides a simple WSGI profiler middleware for finding
bottlenecks in web application. It uses the profile or cProfile
module to do the profiling and writes the stats to the stream provided
To use, run `` instead of ``
from werkzeug.contrib.profiler import ProfilerMiddleware
from app import app
app.config['PROFILE'] = True
app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions = [30]) = True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment