Python

Embed
Preview of the card
<a href="https://forumulate.com/p/watchtower/docs/profilers-python"><img src="https://forumulate.com/api/public/orgs/watchtower/spaces/docs/pages/cdc42c3a-0ce9-4422-9ad0-72bfc1f437a7/social-card.svg?v=3e7ae33eec8b" alt="Python" width="600" height="315"></a>

External profiler: py-spy (MIT). Sample types: cpu (default). Span links: no. Needs no code change, but needs ptrace permission on the target process. Memory profiles are not supported.

py-spy record -f raw -d 60 -o cpu.raw --pid <pid>
wtctl profile upload cpu.raw --service checkout --version 1.4.2 --format folded

-f raw is the collapsed stack format. Fixture: fixtures/py-spy.raw.

Updated