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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Flask-Perf-0.1.6.tar.gz.
File metadata
- Download URL: Flask-Perf-0.1.6.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9357986f9793f366d4d3cfbbd58a6f0b1013f02c705a1006b282a3addceb62a0
|
|
| MD5 |
aceed0de7e4ba3e02b8f48218eada2cc
|
|
| BLAKE2b-256 |
da35feeac52ce12586a6063f31097134856268159491971b1afb65643761c545
|
File details
Details for the file Flask_Perf-0.1.6-py3-none-any.whl.
File metadata
- Download URL: Flask_Perf-0.1.6-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce1315c92eb44eb4dff05d3a47bcaca2912588062c1068f44d746fc412896aa2
|
|
| MD5 |
80c8aee11efabcfd930bbfa9b321ea34
|
|
| BLAKE2b-256 |
d68f141cad090264bff340069d3e367f7c16318e334aa411a0d9a294a329021f
|