Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a python version for the JVM based metrics library

I'm looking for a performance metrics library in python.

I'm familiar with metrics by Coda Hale, which is written for the JVM and so I wonder if there's a python equivalent for that (and which does not utilize the JVM).

In short, the list of requirements from the tool would be:

  • Count different kind of metrics at execution time. Counters, Gauges, Meters, Timers, Histograms etc. There's a nice list here
  • Allow easy access to the runtime data through HTTP API. (I can wrap the HTTP layer myself, but if it's already baked in it's a plus)
  • Plugins for graphite in particular, or others. CopperEgg would be nice. Or NewRelic.
  • Baked in instrumentation support for common libs, such as memcached.

So far I'd found PyCounters which does some of the job, but not all of it. It sort of satisfies my first bullet (but it doesn't have all the metric types, just three) and that's all.

Is there a better alternative to PyCounters?

Thanks

like image 382
Ran Avatar asked Dec 31 '12 14:12

Ran


2 Answers

I came across this library, which is a port of CodaHale metrics for python.

There is some stuff missing i.e. reporters but it does most other things.

https://github.com/omergertel/pyformance/

Shameless plug, here is my fork which adds a hosted graphite reporter. It should be trivial to add reporters to other systems.

https://github.com/usmanismail/pyformance

like image 55
Usman Ismail Avatar answered Nov 11 '22 01:11

Usman Ismail


Haven't had the chance to try it out, but I came across this one a few days ago: https://github.com/Cue/scales

scales - Metrics for Python Tracks server state and statistics, allowing you to see what your server is doing. It can also send metrics to Graphite for graphing or to a file for crash forensics.

scales is inspired by the fantastic metrics library, though it is by no means a port.

like image 3
Eran Harel Avatar answered Nov 11 '22 02:11

Eran Harel