func (c *RateBucketCounter) Total() (int64, error) {
	total := int64(0)

	c.lock.RLock()
	defer c.lock.RUnlock()

	curTimeShard := c.timer.UnixNano() / c.resolution
	for _, b := range c.buckets {
		if curTimeShard-b.timeShard > c.period/c.resolution {
			continue
		}
		total += b.value
	}
	return total, nil
}
// Total returns the total value of this counter
Total returns the total value of this counter
// Total returns the total value of this counter
func (c *RateBucketCounter) Total() (int64, error) {
	total := int64(0)
	c.lock.RLock()
	defer c.lock.RUnlock()
	curTimeShard := c.timer.UnixNano() / c.resolution
	for _, b := range c.buckets {
		if curTimeShard-b.timeShard > c.period/c.resolution {
			continue
		}
		total += b.value
	}
	return total, nil
}
func ( c * RateBucketCounter ) Total ( ) ( int64 , error ) { total := int64 ( 0 ) c . lock . RLock ( ) defer c . lock . RUnlock ( ) curTimeShard := c . timer . UnixNano ( ) / c . resolution for _ , b := range c . buckets { if curTimeShard - b . timeShard > c . period / c . resolution { continue } total += b . value } return total , nil }
Total returns the total value of this counter
Total returns the total value of this counter