metrics for python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
tests cleanup, metric indexes and metric unregister Dec 29, 2012
.gitignore histogram, better test/example, percentile, median, mean and std dev … Nov 24, 2012 cleanup, metric indexes and metric unregister Dec 29, 2012 unit tests Nov 24, 2012


Redis backed metrics library - implements the most of the famous Metrics library.


RetricsGauge(BaseMetrics) - Single value gauge
RetricsCounter(BaseMetrics) - Simple counter with incr and decr methods
RetricsMeter(BaseMetrics) - Time series data, with 1, 5 and 15 minutes avg
RetricsHistogram(BaseMetrics) - Histogram with percentile, mean, median and std deviation methods 
RetricsTimer(BaseMetrics) - Timer (wallclock)

The main class to loof after is RetricsFactory - Metrics factory 


Basically we register an application and its metrics instances in the following order:
    Application -> Metrics -> Instances of metrics

The important thing to monitor is that each metric will have an internal name based on the application + metric name + pid.
By looking at the way the name is composed it's easy to interchange data between processes.


from pymetrics import RetricsFactory

rf = RetricsFactory('application_name')                                                       
c = rf.new_counter('requests')                                              

To list all instances for a given metric:



Unregister metrics instances is not mandatory as each new metric will not use the same internal name.

For more examples, check the tests/ directory    
Use python -m unittest discover tests/unit to run all tests


Should use riemann optionally
Should integrate with dashify 
Should be ported to ruby