Skip to main content

cProfile flamegraph generator

Project description

Flamegraph generator for python’s cProfile stats.

Flamegraphs allow to visualize relations between functions in a very compact and understandable manner and solve main problems of built-in cProfile reporting and can replace gprof2dot because later outputs very huge graphs with a lot of noise.

Flameprof works with profile stat files which can be obtained via Profile.dump_stats() call or via direct script profiling:

python -m cProfile -o myscript.prof myscript.py

Install

Via pip:

pip install flameprof

Or you can invoke flameprof.py directly:

python flameprof.py input.prof > output.svg

Native svg (–format=svg)

Native svg features:

  • compact function names with full names in a tooltip

  • precise timings (cumulative and total)

  • call counts (in a tooltip on hover)

  • green bars show stack frames where flameprof starts to guess timing ratios.

Graph width, row height, font size and threshold can be set via appropriate cli options.

flameprof requests.prof > requests.svg
Requests profile

Svg generated with flamegraph.pl (–format=log)

Also Flameprof can output trace log suitable as input for flamegraph.pl.

You can treat “samples” as microseconds by default (see –log-mult option).

flameprof --format=log requests.prof | flamegraph > requests-flamegraph.svg
Requests profile with flamegraph.pl

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

flameprof-0.2.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file flameprof-0.2.tar.gz.

File metadata

  • Download URL: flameprof-0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for flameprof-0.2.tar.gz
Algorithm Hash digest
SHA256 b0461c5a3d8cf67ee0bcb0084c7d9fac28ae82d840dc2f610b809745c1f05d4f
MD5 aaab838e271603ce5d14232c182d0a04
BLAKE2b-256 95542d5af696fbe2b42a374861ebfd0883962a666d1f02f6e7dd98b85bef7e6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page