sivy/py-statsd — pull request #71 by rjbs (2013-06-22 01:26:56+00:00)
Title: fully clear gauges and counters after sending

Without this commit, counters and gauges that have been seen before
will be sent over and over, each differently.

Counters will be reset to 0 after their sending, and will send that
zero over and over. Gauges will not reset at all, and will send
their new value repeatedly.

To confirm that this is currently the case, I changed the debug
output to include the timestamp:

print "Sending %s => count=%s @ %s" % (k, v, ts)

After sending a counter and gauge only once each:

Sending foo-counter => count=0.1 @ 1371864200
Sending foo-gauge => count=123.0 @ 1371864200

[ …10s go by… ]

Sending foo-counter => count=0.0 @ 1371864210
Sending foo-gauge => count=123.0 @ 1371864210