basho/folsom — pull request #4 by russelldb (2012-05-21 12:17:37+00:00)
Title: Add a duration metric to folsom

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.