This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A simple statistical profiler which outputs in format suitable for FlameGraph.

INSTALL:

Simply run:

pip install git+https://github.com/evanhempel/python-flamegraph.git

USAGE:

Run your script under the profiler:

python -m flamegraph -o perf.log myscript.py --your-script args here

Run Brendan Gregg’s FlameGraph tool against the output:

flamegraph.pl --title "MyScript CPU" perf.log > perf.svg

Enjoy the output:

Filtering

Sometimes you may want to exclude a method (for example in a server the method that waits for a new request) or you may want to profile only a subset of your code (a particular method and its children which are performance critical).

Filtering can be done by passing a python regular expression to the -f or --filter command line option which will restrict output to only those lines which match. Filtering is done against the entire line so you can filter by function name, thread name, both, or even by more complex filters such as function ABC calls DEF (ABC.*DEF).

Alternatively since the output is stackframes each on a line by itself, this can simply be done with a simple grep filter.:

Exclude:

  grep -v waiting_method perf.log > removed_waiting.log

Include:

  grep function_name perf.log > filtered.log

Then run the flamegraph.pl script against the filtered file.

Full profile output of yCanta webapp PDF export. Most time is spent in wait state and graph is not very helpful.

Filtered profile output of yCanta webapp PDF export. Filtering was on the pdf format function so time spent in wait state has been excluded and the graph is now helpful.

Release History

Release History

0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
flamegraph-0.1.tar.gz (4.0 kB) Copy SHA256 Checksum SHA256 Source Apr 21, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting