Skip to main content




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

Dashboard

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.


Installation

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

Demo

import mocha

mocha.init(url="http://localhost:9000")

mocha.demo()

Usage

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

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

# 3. Function Decorator
@mocha.profiler("Foobar")
def ml_training():
    pass

Release files for mocha-time 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mocha-time 0.0.10
File Size Uploaded
mocha-time-0.0.10.tar.gz 1.7 MB Details

Release files / mocha-time-0.0.10.tar.gz

Download URL mocha-time-0.0.10.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
b6bf4469a37971ae841d6324ed1cca8d96f1d5ea1cbcef31368349f9e73df3c0
BLAKE2b-256 checksum
How to use checksums
aa0bef6c53dd6130b735158ece668e33a46c02df3fd00c6dca7d966d0b68ef52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.0.10 This release

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page