Skip to main content

A simple profiler for flask applications.

Project description


PyPI version Build Status Coverage Status

A simple Flask extension for profiling your application code and database queries.


$ pip install flask_perf


from flask import Flask, jsonify
from flask_perf import Profiler

app = Flask(__name__)
app.config["PROFILER_ENABLED"] = True
profiler = Profiler(app) # or profiler.init_app(app)

def index():
    return jsonfiy({
        "message": "Hello World!"


Config Name Description default
PROFILER_ENABLED Enable the profiler. False
PROFILER_RESTRICTIONS List of profiler restrictions, described in depth in the Official Python Docs []
PROFILER_SQLALCHEMY_ENABLED Enable SQLAlchemy query logging. Note: This option requires that the flask_sqlalchemy package is installed and the SQLALCHEMY_RECORD_QUERIES config option is set to True. False
PROFILER_SQLALCHEMY_THRESHOLD Minimum query duration in seconds to log. 0
PROFILER_SQLALCHEMY_FORMAT Logged SQLAlchemy query format. See the Flask-SQLAlchemy docs for a list of attributes you can use in this format string. "\n\n{duration:1.2e}s\n\n{statement}\n"


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Flask-Perf, version 0.1.6
Filename, size File type Python version Upload date Hashes
Filename, size Flask_Perf-0.1.6-py3-none-any.whl (3.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size Flask-Perf-0.1.6.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page