Skip to main content

Thread-aware profiler

Project description

A multi-thread aware profiler package, with an API similar to that of the standard cProfile module. Profiling data generated by mtprof is in the same format as that generated by cProfile and can therefore be analyzed using the same tools (such as pstats, snakeviz, etc.).

Compatibility

Python 3 is required, and only POSIX systems (Linux, etc.) are currently supported.

Install

This is a pure Python package, so pip install mtprof should generally work everywhere.

Command-line interface

python -m mtprof provides an interface similar to python -m cProfile and allows you to profile scripts, modules or entire applications.

Python API

The mtprof.Profile class has an API similar to cProfile.Profile.

Limitations

Due to the way Python profiling works, mtprof is only able to exploit profiling stats from threads whose lifetime is a subset of the profiler’s lifetime. A thread started before profiling was started, or ended after profiling was stopped, cannot have its statistics collected.

Due to this limitation, it is probably easier to use the command-line interface, which is similar to that of cProfile: just run python -m mtprof --help to get a view of the available options.

Only threads created using the standard threading.Thread interface are recognized. For most use cases this should not be an issue.

Status

This package is experimental.

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

mtprof-0.0.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

mtprof-0.0.2-py2.py3-none-any.whl (8.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mtprof-0.0.2.tar.gz.

File metadata

  • Download URL: mtprof-0.0.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mtprof-0.0.2.tar.gz
Algorithm Hash digest
SHA256 56354ef66615657c3d40182dcb9bc1a2ccb2eedf31d2fe4d4232c8002302f4e0
MD5 5685b28bb2ff95775a1b4abdc85bffdd
BLAKE2b-256 9c55b8e4f60de52d8189029afbecbad3aed5a0c14b3b7af8377a114a6ad92192

See more details on using hashes here.

Provenance

File details

Details for the file mtprof-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mtprof-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2350e457e10c6f7ff3a80e5c6efa78db217264f5c7d932c77e847934d29aace2
MD5 ab84ccfae7412858127fb5161319c1d8
BLAKE2b-256 2ac56fadeb78a012b228637ecd07bb43d227f17e36d1c68265dcc6f5bb936e20

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page