stats

To use stats, create a stats handle:

from pylogd.stats import Logd
stats = Logd('127.0.0.1', 8126)

You can also supply an optional prefix which will be prepended to all of your
stats, so that multiple applications can use the same logd/graphite server
without having to repeate their per-app key for every stats call.

Once you have a Logd object, you can increment & decrment counters (with an
optional sample rate):

stats.increment('my.counter')
stats.change_by('my.counter', 10)
stats.decrement('my.counter', 0.05) # only update 5% of the time

You can also set the value of a meter:

stats.set('my.meter', 30)
stats.set('my.meter', 30, 0.25) # only set 25% of the time

There's a basic time interface as well as a convenient timer interface: