GNU General Public License v3.0

项目介绍

P403n1x87/austin 是一个托管在 GitHub 上的开源项目,主要使用 C 编写,采用 GNU General Public License v3.0 许可证,目前获得 2.2k 个 Star、68 次 Fork。

仓库全名
P403n1x87/austin
开源许可证
GNU General Public License v3.0
Star 数
2.2k
Fork 数
68
未关闭 Issue
4

README 摘要

A Frame Stack Sampler for CPython height="24px" />           height="24px" /> alt="Debian package status" /> alt="Get it from the Snap Store" /> Documentation  • Synopsis  • Installation  • Usage  • Compatibility  • Contribute alt="Buy Me A Coffee" /> This is the nicest profiler I’ve found for Python. It’s cross-platform,…

完整内容见 GitHub 原始 README 或本页 。

常见问题

austin 用什么语言开发?

主要使用 C 编写,采用 GNU General Public License v3.0 许可证,目前有 2.2k 个 Star。

austin 可以免费商用吗?

仓库标注的许可证为 GNU General Public License v3.0,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 austin 的源码?

可以直接克隆仓库:git clone https://github.com/P403n1x87/austin.git,默认分支为 master;安装与运行步骤见仓库 README。

austin 最近还在维护吗?

仓库最近一次更新为 1 周前,当前有 4 个未关闭 Issue;Star 数为 2.2k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Python frame stack sampler for CPython

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
2367
价值分
1350
活跃状态
活跃

README

Austin

A Frame Stack Sampler for CPython

         

GitHub Action Status: Tests GitHub Action Status: Checks Code coverage latest release LICENSE
PyPI version Chocolatey Version Conda Version homebrew austin Snap Store Build Status

Get it from the Snap Store

Documentation • Synopsis • Installation • Usage • Compatibility • Contribute

Buy Me A Coffee


This is the nicest profiler I’ve found for Python. It’s cross-platform, doesn’t need me to change the code that’s being profiled, and its output can be piped directly into flamegraph.pl. I just used it to pinpoint a gross misuse of SQLAlchemy at work that’s run in some code at the end of each day, and now I can go home earlier.

-- gthm on lobste.rs

If people are looking for a profiler, Austin looks pretty cool. Check it out!

-- Michael Kennedy on Python Bytes 180

Follow on Twitter


Synopsis

Austin is a Python frame stack sampler for CPython written in pure C. Samples are collected by reading the CPython interpreter virtual memory space to retrieve information about the currently running threads along with the stack of the frames that are being executed. Hence, one can use Austin to easily make powerful statistical profilers that have minimal impact on the target application and that don’t require any instrumentation.

The key features of Austin are:

  • Zero instrumentation;
  • Minimal impact;
  • Fast and lightweight;
  • Time and memory profiling;
  • Built-in support for multi-process applications (e.g. mod_wsgi).
  • Support for agentic workflows, with an MCP server and a query API for coding agents.

The simplest way to turn Austin into a full-fledged profiler is to use together with the VS Code extension or combine it with FlameGraph or Speedscope. However, Austin’s binary output can be piped into any other external or custom tools for further processing. Look, for instance, at the following Python TUI

Check out A Survey of Open-Source Python Profilers by Peter Norton for a general overview of Austin.

Check out the documentation for more tool ideas and examples!


💜
Austin is a free and open-source project. A lot of effort goes into its development to ensure the best performance and that it stays up-to-date with the latest Python releases. If you find it useful, consider sponsoring this project.
🙏


Documentation

The full documentation, with one version for each Austin minor release, is available at https://p403n1x87.github.io/austin/. It covers

Installation

Austin is available from PyPI and from the major software repositories of the most popular platforms

Platform Command
Any (PyPI) pip install austin-dist
Linux (Snap) sudo snap install austin --classic
Debian/Ubuntu sudo apt install austin
macOS brew install austin
Windows choco install austin or scoop install austin
Linux/macOS (Conda) conda install -c conda-forge austin

Pre-compiled binaries and installers are available from the latest release page. See the installation page for how to build Austin from sources.

Usage

To profile a Python script, run

austin -o profile.mojo python myscript.py

To profile a running Python application, attach Austin to it with

austin -o profile.mojo -p <pid>

Austin writes its samples in the binary MOJO format. The recommended way to visualise them is with the Austin VS Code extension, which opens .mojo files directly. The austin-python package provides tools to convert them to other formats, like the collapsed stacks used by FlameGraph, or Speedscope.

Coding agents can analyse Austin profiles too, either through the MCP server that comes with the VS Code extension, or with the austin-query tool from the austin-python package. See agentic workflows for how to set them up.

The usage page describes all the command line options, and the features page covers each of them in detail.

Compatibility

Austin runs on Linux, macOS and Windows. The compatibility page lists the supported Python versions and architectures for each release, and the platform-specific details to be aware of.

Why Austin

Austin is written in pure C, has no dependencies beyond the standard C library, and is just a sampler, so it can sample at very high rates with minimal impact on the target application. Read more about why Austin in the documentation.

Examples

See the examples in the documentation, and the ecosystem page for the tools that build on Austin.

Contribute

If you like Austin and you find it useful, there are ways for you to 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 by becoming a sponsor and/or by buying me a coffee on BMC or by chipping in a few pennies on PayPal.Me.

Buy Me A Coffee


Follow on Twitter

评论

暂无评论