code: func (s *ExpDecaySample) update(t time.Time, v int64) {
  	s.mutex.Lock()
  	defer s.mutex.Unlock()
  	s.count++
  	if s.values.Size() == s.reservoirSize {
  		s.values.Pop()
  	}
  	s.values.Push(expDecaySample{
  		k: math.Exp(t.Sub(s.t0).Seconds()*s.alpha) / rand.Float64(),
  		v: v,
  	})
  	if t.After(s.t1) {
  		values := s.values.Values()
  		t0 := s.t0
  		s.values.Clear()
  		s.t0 = t
  		s.t1 = s.t0.Add(rescaleThreshold)
  		for _, v := range values {
  			v.k = v.k * math.Exp(-s.alpha*s.t0.Sub(t0).Seconds())
  			s.values.Push(v)
  		}
  	}
  }
docs: // update samples a new value at a particular timestamp.  This is a method all
  // its own to facilitate testing.