Pypprof Flask wrapper
Project description
flask-pypprof
Blueprint for pprof profiling endpoints a la GO that can be added to python Flask applications. flask-pypprof is a wrapper of pypprof and based on django-pypprof ideas.
Installation
pip install flask-pypprof --extra-index-url https://<>/
Usage
To add the pprof endpoints to your application, simply register the blueprint:
from flask_pypprof import get_pprof_blueprint
app.register_blueprint(get_pprof_blueprint())
Once registered, you will be able to access the following endpoints:
/debug/pprof/profile
: will return a CPU profile/debug/pprof/heap
: will return a heap profile/debug/pprof/thread
: will return a thread profile/debug/pprof/wall
: will return a wall time profile(work in progress)
Configuration
You can configure the memory sample rate by setting the following environment variable:
MEMORY_SAMPLE_RATE
: sets the memory profiling sample rate (default: 128 * 1024)
export MEMORY_SAMPLE_RATE = 128 * 1024
Known issues
zprofile issue with python 3.11
: https://github.com/timpalpant/zprofile/pull/2
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flask_pypprof-0.1.12.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for flask_pypprof-0.1.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e04cd9e008eb606fce8911062a1eed150bec61e0b3b5af41a45dcb93c3604c75 |
|
MD5 | b6c27f31d71c5312114bd55c5fb764fb |
|
BLAKE2b-256 | 1929615b0c32649951740f246c3dc38c1025544e7707b63a4869671cf1095ef7 |