boundary/folsom — pull request #24 by russelldb (2012-05-30 09:44:38+00:00)
Title: Add 'duration' metric as an extension of histogram

The current folsom histogram metric can be used to store durations via folsom_metrics:histogram_timed_update(Name, Mod[, Fun, Args]).

In riak core we track a timed duration for ring rebalance and convergence. It is not convenient to wrap the code in a single fun so it can't be submitted to folsom's interface for measuring.

Also, the riak core stats for both rebalance and convergence contain both count' and 'last' fields, which are total of events and length of the last measured event.

This PR adds a new 'duration' metric type to folsom that tracks the length of time between a call to timer_start and timer_end. It uses the existing folsom histogram type to store readings, but adds and extra table for tracking count / start time/ last event duration.

----

Created a new PR from a new rebased branch. The last one's history was a mess, sorry.

(see https://github.com/basho/folsom/pull/4 for reference if needs be (will delete that branch when/if this is merged))