Skip to main content

Python Decorator for Profiling Function or Method

Project description

pprofiler

Simple Python Decorator to Profiling Function or Method

Installation

Use the package manager pip to install pprof.

pip install pprof

Usage

# profiling.py

from pprofiler import pprof

@pprof()
def method_to_profile():
    # do some task
    print("value")

method_to_profile()

it will resulting cProfile output on console

$ python ./profiling.py
value
         3 function calls in 0.000 seconds

   Ordered by: call count

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.000    0.000 {built-in method builtins.print}
        1    0.000    0.000    0.000    0.000 <ipython-input-8-fb2a62e7b3fa>:1(test)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}

License

MIT

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

pprofiler-0.1.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

pprofiler-0.1.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file pprofiler-0.1.1.tar.gz.

File metadata

  • Download URL: pprofiler-0.1.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.10 Linux/5.11.0-44-generic

File hashes

Hashes for pprofiler-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3fbb331f9ffac1a0567c4fa9adfebb242b4c9990a415a429c3d12c7b22cdb7d5
MD5 564cdd1d9cdc6a1db2201a08269b3fa0
BLAKE2b-256 98993e8949816743f2296853afc7ccebaa80b2f8620848a4b81325365f0e32a5

See more details on using hashes here.

File details

Details for the file pprofiler-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pprofiler-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.10 Linux/5.11.0-44-generic

File hashes

Hashes for pprofiler-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 13c5603ff5299a22821a9247a83a479cc456654fc3a03c2bfc5c0647e1ca50d8
MD5 07d3c31bbc6cd6a03c94f63637c1899a
BLAKE2b-256 577637136f0358e9f216c68ded09d4b87ac625513f43e3ddd346b387fb065494

See more details on using hashes here.

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