Skip to main content

Statistical CPU and wall-clock profilers for Python

Project description

zprofile

Statistical (sampling) CPU and wall-clock profilers for Python, derived from google-cloud-profiler.

Google Cloud Python profiling agent

Python profiling agent for Google Cloud Profiler.

See Google Cloud Profiler profiling Python code for detailed documentation.

Supported OS

Linux. Profiling Python applications is supported for Linux kernels whose standard C library is implemented with glibc or with musl. For configuration information specific to Linux Alpine kernels, see Running on Linux Alpine.

Supported Python Versions

Python >= 3.6

Installation & usage

  1. Install the profiler package using PyPI:

    pip3 install zprofile
    
  2. Enable the profiler in your application:

    from zprofile.cpu_profiler import CPUProfiler
    
    p = CPUProfiler()
    pprof = p.profile(30)  # seconds
    
    with open("profile.pprof", "wb") as f:
      f.write(pprof)
    
  3. View the profile with the pprof tool:

    $ go tool pprof -http localhost:8080 profile.pprof
    

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

zprofile-1.0.12.tar.gz (27.5 kB view hashes)

Uploaded Source

Built Distributions

zprofile-1.0.12-cp39-cp39-manylinux2010_x86_64.whl (481.2 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

zprofile-1.0.12-cp38-cp38-manylinux2010_x86_64.whl (481.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

zprofile-1.0.12-cp37-cp37m-manylinux2010_x86_64.whl (482.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

zprofile-1.0.12-cp36-cp36m-manylinux2010_x86_64.whl (481.1 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

zprofile-1.0.12-cp35-cp35m-manylinux2010_x86_64.whl (480.7 kB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

zprofile-1.0.12-cp34-cp34m-manylinux2010_x86_64.whl (480.2 kB view hashes)

Uploaded CPython 3.4m manylinux: glibc 2.12+ x86-64

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