_images/logo.png

Python wrapper for Austin, the frame stack sampler for CPython

GitHub Actions: Tests Travis CI Codecov Documentation
PyPI Downloads
LICENSE

This Python package is a wrapper around Austin, the CPython frame stack sampler. You can use the classes provided by this package to quickly integrate or extend Austin’s statistical profiling capabilities with Python to suit all your needs.

In most cases you should be able to use one of the wrapper classes that are provided with this package out of the box. All you have to do is focus on your business logic while the classes take care of the boilerplate code to start Austin in the background and collect samples from it. You can choose from either a thread-based or an asyncio-based interface, depending on your preference. The section on Wrapper Classes provides more details as well as some basic examples on how to use each of them.

To assist you with the development of command-line tools that leverage the profiling capabilities of Austin, the package also provides the austin.cli sub-module. There you can find the austin.cli.AustinArgumentParser`, which is a sub-class of argparse.ArgumentParser. If you want to customise it to meet your needs, simply sub-class it and tweak it as discused in Command Line Argument Parsing.

Finally, when you install this package, you also get the austin-compress, austin2speedscope and austin2pprof command line tools. The first allows you to compress the raw samples collected by Austin by performing aggregation of the metrics; the others allow you to convert Austin samples to the Speedscope and the Google pprof formats respectively. Note that Speedscope can also handle the output generated by Austin directly (see Importing from custom sources for details).

Indices and tables