{ "info": { "author": "Evan Hempel", "author_email": "evanhempel@evanhempel.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: Public Domain", "Programming Language :: Python", "Topic :: Software Development :: Debuggers" ], "description": "A simple statistical profiler which outputs in format suitable for FlameGraph_.\n\nINSTALL:\n--------\n\nSimply run::\n\n pip install git+https://github.com/evanhempel/python-flamegraph.git\n\nUSAGE:\n------\n\nRun your script under the profiler::\n\n python -m flamegraph -o perf.log myscript.py --your-script args here\n\nRun Brendan Gregg's FlameGraph_ tool against the output::\n\n flamegraph.pl --title \"MyScript CPU\" perf.log > perf.svg\n\nEnjoy the output:\n\n.. image:: docs/attic-create.png\n :alt: Attic create flame graph\n :width: 679\n :height: 781\n :align: center\n\n**Filtering**\n\nSometimes you may want to exclude a method\n(for example in a server the method that waits for a new request)\nor you may want to profile only a subset of your code\n(a particular method and its children which are performance critical).\n\nFiltering can be done by passing a python regular expression to the\n``-f`` or ``--filter`` command line option\nwhich will restrict output to only those lines which match.\nFiltering is done against the entire line so you can filter by\nfunction name, thread name, both, or even by\nmore complex filters such as function ABC calls DEF (``ABC.*DEF``).\n\nAlternatively since the output is stackframes each on a line by itself,\nthis can simply be done with a simple grep filter.::\n\n Exclude:\n\n grep -v waiting_method perf.log > removed_waiting.log\n\n Include:\n\n grep function_name perf.log > filtered.log\n\nThen run the flamegraph.pl script against the filtered file.\n\n.. figure:: docs/ycanta-full.png\n :alt: yCanta webapp full profile of PDF export\n :align: center\n\n Full profile output of yCanta_ webapp PDF export. Most time is\n spent in wait state and graph is not very helpful.\n\n.. figure:: docs/ycanta-pdf.png\n :alt: yCanta webapp filtered for PDF export format function.\n :align: center\n\n Filtered profile output of yCanta_ webapp PDF export. Filtering was on the\n pdf format function so time spent in wait state has been excluded and the\n graph is now helpful.\n\n.. _FlameGraph: http://www.brendangregg.com/flamegraphs.html\n\n.. _yCanta: https://github.com/yCanta/yCanta", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/evanhempel/python-flamegraph", "keywords": "profiler flamegraph", "license": "UNLICENSE", "maintainer": null, "maintainer_email": null, "name": "flamegraph", "package_url": "https://pypi.org/project/flamegraph/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/flamegraph/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/evanhempel/python-flamegraph" }, "release_url": "https://pypi.org/project/flamegraph/0.1/", "requires_dist": null, "requires_python": null, "summary": "Statistical profiler which outputs in format suitable for FlameGraph", "version": "0.1" }, "last_serial": 2075219, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "561a009d2435611215b497efbf84c596", "sha256": "2c45efc8eef0de0e2d088a82c033f6a6aa79d8f9a551de83e555be2a9dbb2452" }, "downloads": -1, "filename": "flamegraph-0.1.tar.gz", "has_sig": false, "md5_digest": "561a009d2435611215b497efbf84c596", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3958, "upload_time": "2016-04-21T00:42:51", "url": "https://files.pythonhosted.org/packages/4a/c0/349ab6f90f2f9b325da25b33e7a7a050fa8c65eb4f7554190bd4d830efa3/flamegraph-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "561a009d2435611215b497efbf84c596", "sha256": "2c45efc8eef0de0e2d088a82c033f6a6aa79d8f9a551de83e555be2a9dbb2452" }, "downloads": -1, "filename": "flamegraph-0.1.tar.gz", "has_sig": false, "md5_digest": "561a009d2435611215b497efbf84c596", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3958, "upload_time": "2016-04-21T00:42:51", "url": "https://files.pythonhosted.org/packages/4a/c0/349ab6f90f2f9b325da25b33e7a7a050fa8c65eb4f7554190bd4d830efa3/flamegraph-0.1.tar.gz" } ] }