etsy/statsd — pull request #167 by draco2003 (2012-10-13 04:55:34+00:00)
Title: Move counter and timer calculations out of graphite backend and into separate module

An initial attempt at solving Issue #103

This replicates the graphite timer and counter calculations, but separates them out into a module.

It adds the counter_rates and timer_data to the metrics_hash prior to it being passed to the backends.

By merging it into the metrics_hash it keeps the function signature and events the same, though by putting them into their own data sets it keeps backwards compatibility with an easy migration path.

The backends are still required to iterate over the different types of metrics in order to format them as needed per backend, but they no longer need to do any heavy lifting as far as calculations go (unless they want to).

Also added an initial set of tests to run against the processedmetrics module to help get better test coverage for the calculations.