Flame graph web application for Austin
Project description
A Modern Web Interface for Austin
Synopsis • Installation • Usage • Compatibility • Contribute
Synopsis
Austin Web is a modern web interface for Austin, the frame stack sampler for CPython, based on D3.js and tailwindcss. It is yet another example of how to use Austin to make a visual profiling tool for Python. The flame graph is generated using d3-flame-graph.
Austin Web offers two main functionalities. The default one is to serve a web page that allows you to have a live view of the metrics collected by Austin. The visualisation is a live flame graph in your browser that refreshes every 3 seconds with newly collected data. Hence, Austin Web can also be used for remote profiling.
You can also run Austin Web in compile mode to generate a static flame graph HTML page, much like flamegraph.pl, but with the full Austin Web UI around it.
Installation
Austin Web can be installed from PyPI simply with
pipx install austin-web
NOTE Austin Web relies on the Austin binary being available from the
PATH
environment variable. So make sure that Austin is properly installed on your system. See Austin installation instruction for more details on how to get Austin installed on your platform.
Usage
You can run Austin Web simply with
austin-web python myscript.py
to start serving on localhost over an ephemeral port. If myscript.py
is an
executable script, you can simply do
austin-web myscript.py
If you want to specify the host and the port, you can pass the --host
and
--port
options to the command line. For example, to serve for the World on
port 5050, use
austin-web --host 0.0.0.0 --port 5050 python myscript.py
If you want to compile the collected metrics into a static HTML page, you can
run Austin Web in compile mode by passing the --compile
option, followed by
the destination file name, e.g.
austin-web --compile output.html python myscript.py
Like Austin, you can use Austin Web to profile any running Python application. For example, to profile a WSGI server and all its child processes, get hold of its PID and do
sudo austin-web -Cp <pid>
Compatibility
Austin Web has been tested with Python 3.9-3.12 and is known to work on Linux, MacOS and Windows.
Austin Web is known to have some minor issues on Windows. When started in serve
mode, pressing Ctrl+C
might not actually stop Austin Web.
Since Austin Web uses Austin to collect samples, the same note applies here:
Attaching to a running process in Python requires the
cap_systrace
capability. To avoid running Austin Web withsudo
, consider setting it to the Austin binary with, e.g.sudo setcap cap_sys_ptrace+ep `which austin`
Due to the System Integrity Protection introduced in MacOS with El Capitan, Austin cannot profile Python processes that use an executable located in the
/bin
folder, even withsudo
. Hence, either run the interpreter from a virtual environment or use a Python interpreter that is installed in, e.g.,/Applications
or viabrew
with the default prefix (/usr/local
). Even in these cases, though, the use ofsudo
is required.
Contribute
If you want to help with the development, then have a look at the open issues and have a look at the contributing guidelines before you open a pull request.
You can also contribute to the development of the Austin Web by becoming a sponsor and/or by buying me a coffee on BMC or by chipping in a few pennies on PayPal.Me.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file austin_web-0.3.0.tar.gz
.
File metadata
- Download URL: austin_web-0.3.0.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 091f06e468052351c61b0fffdc5c12b6894a95d579049c740aff2c53fc3817d8 |
|
MD5 | 27a41a289dd42b10b03c6838f509588f |
|
BLAKE2b-256 | b6db6d25fa8436f5b677e14ba84ef955567f93f496c9dc72fc5cb6e568ee915c |
File details
Details for the file austin_web-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: austin_web-0.3.0-py3-none-any.whl
- Upload date:
- Size: 33.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b766fd0df65760814c500f2942a764dd4f1c8478d221fc33fc631b9b7aff0f96 |
|
MD5 | 4e45c5d57d5a680157954f4a1534c54a |
|
BLAKE2b-256 | 00574ef0f35abc94322a504aee8f027f8c7526f75833b6ae5fcaf7a8e0569732 |