scoutapp/scout-client — pull request #13 by reversefold (2013-04-28 07:36:57+00:00)
Title: Issue #12 Add support for non-reported counters, non-timed counters, and ratios

In altering the mongodb scout plugin I've run into a need to use counter() but have the values not reported and not based on time. I also needed generic support for passing 2 values in and having a ratio (%) reported. This patch does the following:
* Return the delta computed by counter()
* Adds support for a :report option to counter(), which can be set to false to turn off reporting (for internal counters, as in counter_ratio())
* Adds ratio(), which computes and reports a ratio of 2 values
* Adds counter_ratio(), which can be passed two values, treat them both as a counter(), and then use ratio() to report the ratio.

I plan to submit my altered mongoDB plugin which uses this functionality once this makes it in.