code: func (ss *Rate) Init(size uint32, halfLife time.Duration) *Rate {
  	*ss = Rate{
  		keytobucketno: make(map[string]uint32, size),
  		buckets:       make([]bucket, size),
  		weightHelper:  -math.Ln2 / float64(halfLife.Nanoseconds()),
  		halfLife:      halfLife,
  	}
  	ss.sh.h = make([]uint32, size)
  	ss.sh.ss = ss
  	heap.Init(&ss.sh)
  	for i := uint32(0); i < uint32(size); i++ {
  		ss.sh.h[i] = i
  		ss.buckets[i].idx = i
  	}
  	return ss
  }
docs: // Initialize already allocated Rate structure.
  //
  // Size stands for number of items to track in the stream. HalfLife determines
  // the time required half-charge or half-discharge a rate counter.