Skip to main content

pypprof

pypprof adds HTTP-based endpoints for collecting profiles from a running Python application a la Go's net/http/pprof.

Under the hood, it uses zprofile and mprofile to collect CPU and heap profiles with minimal overhead.

Usage

Add profiling endpoints to an application

Register the profiling endpoints in your application:

from pypprof.net_http import start_pprof_server

start_pprof_server(port=8081)

Fetch profiles from your running application

Fetch a 30s CPU profile, and view as a flamegraph:

$ go tool pprof -http=:8088 :8081/debug/pprof/profile

Fetch a heap profile:

$ go tool pprof :8081/debug/pprof/heap

Dump stacks from your application:

$ curl localhost:8081/debug/pprof/thread?debug=1

Compatibility

pypprof is compatible with Python >= 2.7. Memory profiling is only available by default in Python >= 3.4. To enable memory profiling in earlier Pythons, you must patch Python and manually install mprofile.

Contributing

Pull requests and issues are welcomed!

License

pypprof is released under the GNU Lesser General Public License, Version 3.0

Metadata

Release files for pypprof 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypprof 0.0.1
File Size Uploaded
pypprof-0.0.1.tar.gz 11.3 kB Details

Release files / pypprof-0.0.1.tar.gz

Download URL pypprof-0.0.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
08deae1734ba5cd11fc9def23b40d1fe28a758a214ff58794d7a2f96aa5bfa2c
BLAKE2b-256 checksum
How to use checksums
606a1486f0320376119e93c7ca4208f1105d592ee80e2a0fcddb282e9df762a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.15+

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page