Skip to main content

A Profiling Library for Python

Project description

tinyprofiler

Tiny Profiler is a sub 200 line profiling utility that records telemetry from your app, provides metrics and a flame graph to help debug latency and throughput.

Installation

pip install tinyprofiler

Usage

from tinyprofiler import Observer

observer = Observer()

@observer.profile()
def your_function():
  # do something

img

API

Observer

Observer(num_samples: int = 10, enabled: bool = True)

  • num_samples (optional): The number of samples to collect. You can configure how many samples to collect during profiling. The default is 10.

  • enabled (optional): You can enable or disable profiling using this parameter. By default, profiling is enabled (True).

Observer.profile (decorator)

profile(self, trace: str = '__main__', parent: bool = False) -> None:

  • trace (optional) - the trace to group functions together

  • parent (optional): Set this to True if you want to treat the decorated function as a parent node in the flame graph hierarchy.

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

tinyprofiler-0.1.8.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tinyprofiler-0.1.8-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file tinyprofiler-0.1.8.tar.gz.

File metadata

  • Download URL: tinyprofiler-0.1.8.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for tinyprofiler-0.1.8.tar.gz
Algorithm Hash digest
SHA256 475f06d3ad87d5fa896f0d24eeba5b50403114ace47bda3591410ef80e39d09b
MD5 1d3fd1305b2d772b67739292e341f2c1
BLAKE2b-256 d356dc2e1f8c9c3e3b70309862c2c4f29448243bdd9a94e83cd0e630fd3e8f15

See more details on using hashes here.

File details

Details for the file tinyprofiler-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: tinyprofiler-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for tinyprofiler-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c00abb426bcc9eeb728e238bea86aaefedc575391297e7be39839343cabd3f61
MD5 2b2d5e185a995e80965b27be33aeae2b
BLAKE2b-256 a84bf8f09f3193c8feb110db05000c58ea3395d0087d9f8846ba460cb4d4774f

See more details on using hashes here.

Supported by

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