flameprof


Nameflameprof JSON
Version 0.4 PyPI version JSON
download
home_pagehttps://github.com/baverman/flameprof/
SummarycProfile flamegraph generator
upload_time2018-12-25 09:28:48
maintainer
docs_urlNone
authorAnton Bobrov
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Flamegraph generator for python's `cProfile <https://docs.python.org/3/library/profile.html>`_ stats.

`Flamegraphs <http://www.brendangregg.com/flamegraphs.html>`_ 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 <https://github.com/jrfonseca/gprof2dot>`_ because later outputs
very huge graphs with a lot of noise.

``Flameprof`` works with profile stat files obtained by
`Profile.dump_stats() <https://docs.python.org/3/library/profile.html#profile.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 calls

Graph 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: center

Inverted 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)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/baverman/flameprof/",
    "name": "flameprof",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Anton Bobrov",
    "author_email": "baverman@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c0/e7/114f6710d31854b694598f577f9eac49d7f38b7fb8a55e86e2d3f848fd1c/flameprof-0.4.tar.gz",
    "platform": "any",
    "description": "Flamegraph generator for python's `cProfile <https://docs.python.org/3/library/profile.html>`_ stats.\n\n`Flamegraphs <http://www.brendangregg.com/flamegraphs.html>`_ allow to\nvisualize relations between functions in a very compact and understandable\nmanner.\n\n``Flameprof`` solves main problems of built-in cProfile reporting and can replace\n`gprof2dot <https://github.com/jrfonseca/gprof2dot>`_ because later outputs\nvery huge graphs with a lot of noise.\n\n``Flameprof`` works with profile stat files obtained by\n`Profile.dump_stats() <https://docs.python.org/3/library/profile.html#profile.Profile.dump_stats>`_\ncall or via direct script profiling::\n\n    python -m cProfile -o myscript.prof myscript.py\n\n\nInstall\n=======\n\nVia pip::\n\n    pip install flameprof\n\nOr you can invoke ``flameprof.py`` directly::\n\n    python flameprof.py input.prof > output.svg\n\n\nNative svg (--format=svg)\n=========================\n\nNative svg features:\n\n* compact function names with full names in a tooltip\n* precise timings (cumulative and total)\n* call counts (in a tooltip on hover)\n* green bars show stack frames where flameprof starts to guess timing ratios\n* inverted flamegraph to show total time of all calls\n\nGraph width, row height, font size and threshold can be set via appropriate cli\noptions.\n\n::\n\n    flameprof requests.prof > requests.svg\n\n.. image:: https://cdn.rawgit.com/baverman/flameprof/master/img/requests.svg\n    :alt: Requests profile\n    :width: 100%\n    :align: center\n\nInverted flamegraph:\n\n.. image:: https://cdn.rawgit.com/baverman/flameprof/master/img/httplib.svg\n    :alt: Requests profile\n    :width: 100%\n    :align: center\n\n(Images are clickable)\n\n\nSvg generated with flamegraph.pl (--format=log)\n===============================================\n\nAlso ``flameprof`` can output trace log suitable as input for flamegraph.pl.\n\nYou can treat \"samples\" as microseconds by default (see ``--log-mult`` option).\n\n::\n\n    flameprof --format=log requests.prof | flamegraph > requests-flamegraph.svg\n\n.. image:: https://cdn.rawgit.com/baverman/flameprof/master/img/requests-flamegraph.svg\n    :alt: Requests profile with flamegraph.pl\n    :width: 100%\n    :align: center\n\n(Image is clickable)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "cProfile flamegraph generator",
    "version": "0.4",
    "project_urls": {
        "Homepage": "https://github.com/baverman/flameprof/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c0e7114f6710d31854b694598f577f9eac49d7f38b7fb8a55e86e2d3f848fd1c",
                "md5": "1e2fb6290cf768e14781d0bb33917c88",
                "sha256": "dbc86d4190cbbba624f1e0a40f44d9db96138e27534d83c8ef42d420857875a3"
            },
            "downloads": -1,
            "filename": "flameprof-0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "1e2fb6290cf768e14781d0bb33917c88",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7865,
            "upload_time": "2018-12-25T09:28:48",
            "upload_time_iso_8601": "2018-12-25T09:28:48.554579Z",
            "url": "https://files.pythonhosted.org/packages/c0/e7/114f6710d31854b694598f577f9eac49d7f38b7fb8a55e86e2d3f848fd1c/flameprof-0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2018-12-25 09:28:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "baverman",
    "github_project": "flameprof",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flameprof"
}
        
Elapsed time: 0.17235s