Skip to main content

Python Performance Profiling for Production

Project description

Mocha logo: Mocha is the Python Performance Profiler for Production

Python Performance Profiling for Production
~ It's About Time ~

Mocha is a performance profiler that can monitor the performance of your production Python, and makes results easy to aggregate and search through.

Mocha is designed for Purposeful Profiling. This means that you only use Mocha around code of interest, instead of dumping all code performance logs and mining it later.

Useful for Profiling:

  • 🌎 API performance
  • 🚀 CI/CD stage / granular performance
  • 💡 ML training & inference jobs
  • 📀 Database queries
  • 📊 Data pipelines / compute jobs

What gets measured gets managed!

Mocha logo: Mocha is the Python Performance Profiler for Production


Bad performance has real world consequences, and is often a result of lack of visibility, even if you are logging it, if it's not be easy to get to, it will be ignored.


pip install mocha-time
docker run -p 9000:9000 mochadev/mocha


import mocha




# 1. Start / Stop
p = mocha.start("Foobar")

# 2. Profiler
with mocha.Profiler("Foobar"):

# 3. Function Decorator
def ml_training():

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

mocha-time-0.0.10.tar.gz (1.7 MB view hashes)

Uploaded Source

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