A simple profiler for flask applications.
Project description
Flask-Perf
A simple Flask extension for profiling your application code and database queries.
Installation
$ pip install flask_perf
Example
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)
@app.route("/")
def index():
return jsonfiy({
"message": "Hello World!"
})
Configuration
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" |
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Flask-Perf-0.1.6.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for Flask_Perf-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce1315c92eb44eb4dff05d3a47bcaca2912588062c1068f44d746fc412896aa2 |
|
MD5 | 80c8aee11efabcfd930bbfa9b321ea34 |
|
BLAKE2b-256 | d68f141cad090264bff340069d3e367f7c16318e334aa411a0d9a294a329021f |