veyron/lib/stats/counter: Add rate counter.

This counter keeps track of its recent values to calculate deltas and
rates.

Example:
  // func New(period, resolution time.Duration) *Counter
  c := counter.New(1*time.Hour, 1*time.Second)
  c.Incr(n)
  ...
  delta1h := c.Delta1h()
  delta10m := c.Delta10m()
  delta1m := c.Delta1m()
and:
  rate1h := c.Rate1h()
  rate10m := c.Rate10m()
  rate1m := c.Rate1m()

Change-Id: I075659e2dc5e7d1b5a1837653896b6be4977f905
4 files changed
tree: d20e3f5817ab4daaaa12eafc12457a416e85dae3
  1. examples/
  2. lib/
  3. products/
  4. runtimes/
  5. security/
  6. services/
  7. tools/