Skip to main content
https://badge.fury.io/py/yunomi.png https://secure.travis-ci.org/dreid/yunomi.png?branch=master

As in:

It has performance implications, Y U NO MEASURE IT!?

Yunomi provides insights to the internal behavior of an application, providing useful statistics and metrics on selected portions of your code. It’s a Python port of the core portion of a Java Metrics library by Coda Hale.

Stop guessing, start measuring:

$ pip install yunomi

Core Features

Counter

Simple interface to increment and decrement a value. For example, this can be used to measure the total number of jobs sent to the queue, as well as the pending (not yet complete) number of jobs in the queue. Simply increment the counter when an operation starts and decrement it when it completes.

Meter

Measures the rate of events over time. Useful to track how often a certain portion of your application gets requests so you can set resources accordingly. Tracks the mean rate (the overall rate since the meter was reset) and the rate statistically significant regarding only events that have happened in the last 1, 5, and 15 minutes (Exponentially weighted moving average).

Histogram

Measures the statistical distribution of values in a data stream. Keeps track of minimum, maximum, mean, standard deviation, etc. It also measures median, 75th, 90th, 95th, 98th, 99th, and 99.9th percentiles. An example use case would be for looking at the number of daily logins for 99 percent of your days, ignoring outliers.

Timer

A useful combination of the Meter and the Histogram letting you measure the rate that a portion of code is called and a distribution of the duration of an operation. You can see, for example, how often your code hits the database and how long those operations tend to take.

Examples

Decorators

The simplest and easiest way to use the yunomi library.

Counter

You can use the count_calls decorator to count the number of times a function is called.

>>> from yunomi import counter, count_calls
>>> @count_calls
... def test():
...     pass
...
>>> for i in xrange(10):
...     test()
...
>>> print counter("test_calls").get_count()
10

Timer

You can use the time_calls decorator to time the execution of a function and get distributtion data from it.

>>> import time
>>> from yunomi import timer, time_calls
>>> @time_calls
... def test():
...     time.sleep(0.1)
...
>>> for i in xrange(10):
...     test()
...
>>> print timer("test_calls").get_mean()
0.100820207596

Requirements

Yunomi has no external dependencies and runs on PyPy and Python 2.6, 2.7, and 3.3.

History

0.3.0 (2013-07-27)

  • Python 3.3 is now supported additionally to 2.6 and 2.7.

  • Decorators don’t eat return values anymore.

  • Meters can be reset now.

Metadata

Release files for yunomi 0.3.0

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

Source distribution (sdist)

Source distribution for yunomi 0.3.0
File Size Uploaded Provenance
yunomi-0.3.0.tar.gz 14.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for yunomi 0.3.0
File Interpreter ABI Platform
yunomi-0.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 37.9 kB

Release files / yunomi-0.3.0.tar.gz

Download URL yunomi-0.3.0.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
91fceddbb4716cba81219a1f70dd3814e128a4352698520e1ed355ab9cb7db87
BLAKE2b-256 checksum
How to use checksums
6b589aacb24163fa5fcc380217fe4057ec17c624eee3f34a6618737225981e30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / yunomi-0.3.0-py2.py3-none-any.whl

Download URL yunomi-0.3.0-py2.py3-none-any.whl
Size 23.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0a57d8277109458d85371d41afdbf749edee824fffc559542e6680fa59ad6ca8
BLAKE2b-256 checksum
How to use checksums
b8f038c36e0a71f545334a8eb1d6016896be4a44c06dd98f1854db22545ce63c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for yunomi 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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