Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baverman/flameprof
Flamegraph generator for cProfile stats
https://github.com/baverman/flameprof
Last synced: about 1 month ago
JSON representation
Flamegraph generator for cProfile stats
- Host: GitHub
- URL: https://github.com/baverman/flameprof
- Owner: baverman
- License: mit
- Created: 2017-09-16T15:24:19.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-23T20:46:10.000Z (over 1 year ago)
- Last Synced: 2024-07-19T06:41:47.547Z (2 months ago)
- Language: Python
- Homepage:
- Size: 299 KB
- Stars: 227
- Watchers: 4
- Forks: 15
- Open Issues: 12
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
Flamegraph generator for python's `cProfile `_ stats.
`Flamegraphs `_ allow to
visualize relations between functions in a very compact and understandable
manner.``Flameprof`` solves 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 obtained by
`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
* inverted flamegraph to show total time of all callsGraph width, row height, font size and threshold can be set via appropriate cli
options.::
flameprof requests.prof > requests.svg
.. image:: https://cdn.rawgit.com/baverman/flameprof/master/img/requests.svg
:alt: Requests profile
:width: 100%
:align: centerInverted flamegraph:
.. image:: https://cdn.rawgit.com/baverman/flameprof/master/img/httplib.svg
:alt: Requests profile
:width: 100%
:align: center(Images are clickable)
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
.. image:: https://cdn.rawgit.com/baverman/flameprof/master/img/requests-flamegraph.svg
:alt: Requests profile with flamegraph.pl
:width: 100%
:align: center(Image is clickable)