Skip to main content

Easy and simple profiller for Python

Project description

Peasy Profiller

This is a simple and easy-to-use profiller for Python applications that will generate CSV files that indicate the amount of time your application spent in different contexts

Quickstart

To install, run

pip install --upgrade pip
pip install peasyprofiller

To use it in a program, import it, call the start function at the start of the section you want to profile and stop at the end of that section. Time of sections with the same context will be added.

To save the data collected, call the save_csv function with the desired save path. You can also call the plot function to create a graph of the relative time spent in each section (this assumes that all tracked sections are disjointed in time)

from peasyprofiller.profiller import profiller as pprof

pprof.start("Name of my activity")

# Some processing happens here

pprof.stop("Name of my activity")
pprof.save_csv("path/to/save")
pprof.plot("path/to/save")

Example

You can run the example at peasyprofiller/tests/fibonacci.py with the following command:

python -m peasyprofiller.tests.fibonacci <N> <SAVE_PATH>

The generated CSV should look like this:

Profiller,Fibonacci
6.87e-05,6.7745289

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

peasyprofiller-0.5.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

peasyprofiller-0.5.0-py2.py3-none-any.whl (18.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file peasyprofiller-0.5.0.tar.gz.

File metadata

  • Download URL: peasyprofiller-0.5.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for peasyprofiller-0.5.0.tar.gz
Algorithm Hash digest
SHA256 f9490665e29fb861af08c2f632a0acb3d5e76fc7023668de1150712c5f6f3a52
MD5 d9e7887ea0ce71458fb78fb08fcd2758
BLAKE2b-256 43abf086eff20384b9a0071be0abeb52475cd4612fdb9348234bb575cab446d8

See more details on using hashes here.

Provenance

File details

Details for the file peasyprofiller-0.5.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for peasyprofiller-0.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0d2e8c68f41940cb0d30461b9fa7cd42891812c8bff9bdaa31304c442dbee839
MD5 69c69531e841be5f45c0fcd47e873441
BLAKE2b-256 a7c057b15e1a9481a00c010cda6e22bd49b007a78269dd696f971c6c19f79fc3

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