Package: austin-web
A Modern Web Interface for AustinSynopsis•Installation•Usage•Compatibility•ContributeSynopsisAustin Web is a modern web interface forAustin, the frame stack sampler for
CPython, based onD3.jsandtailwindcss. It is yet another example of how to
use Austin to make a visual profiling tool for Python. The flame graph is
generated usingd3-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 aliveflame graph in your browser that refreshes every 3
seconds with newly collected data. Hence, Austin Web can also be used forremoteprofiling.You can also run Austin Web incompilemode to generate a static flame graph
HTML page, much likeflamegraph.pl, but with the full Austin Web UI around it.InstallationAustin Web can be installed from PyPI simply withpipxinstallaustin-webNOTEAustin Web relies on theAustinbinary being available from thePATHenvironment variable. So make
sure that Austin is properly installed on your system. SeeAustin
installationinstruction
for more details on how to get Austin installed on your platform.UsageYou can run Austin Web simply withaustin-webpythonmyscript.pyto start serving on localhost over an ephemeral port. Ifmyscript.pyis an
executable script, you can simply doaustin-webmyscript.pyIf you want to specify the host and the port, you can pass the--hostand--portoptions to the command line. For example, to serve for the World on
port 5050, useaustin-web--host0.0.0.0--port5050pythonmyscript.pyIf you want to compile the collected metrics into a static HTML page, you can
run Austin Web in compile mode by passing the--compileoption, followed by
the destination file name, e.g.austin-web--compileoutput.htmlpythonmyscript.pyLike 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 dosudoaustin-web-Cp<pid>CompatibilityAustin Web has been tested with Python 3.9-3.12 and is known to work onLinux,MacOSandWindows.Austin Web is known to have some minor issues on Windows. When started in serve
mode, pressingCtrl+Cmight 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 thecap_systracecapability. To avoid running Austin Web withsudo, consider setting it to
the Austin binary with, e.g.sudosetcapcap_sys_ptrace+ep`whichaustin`Due to theSystem Integrity Protectionintroduced inMacOSwith El
Capitan, Austin cannot profile Python processes that use an executable located
in the/binfolder, even withsudo. Hence, either run the interpreter from
a virtual environment or use a Python interpreter that is installed in, e.g.,/Applicationsor viabrewwith the default prefix (/usr/local). Even in
these cases, though, the use ofsudois required.ContributeIf you want to help with the development, then have a look at the open issues
and have a look at thecontributing guidelinesbefore you
open a pull request.You can also contribute to the development of the Austin Web by becoming a
sponsor and/or bybuying me a coffeeon BMC or by chipping in a few pennies onPayPal.Me.