instruments.go
func (r *Rate) Snapshot() float64 {
	now := time.Now().UnixNano()
	dur := time.Duration(now - atomic.SwapInt64(&r.time, now))
	return r.count.Snapshot() / dur.Seconds() * r.unit
}
func (r *Rate) Snapshot() float64 {
	now := time.Now().UnixNano()
	dur := time.Duration(now - atomic.SwapInt64(&r.time, now))
	return r.count.Snapshot() / dur.Seconds() * r.unit
}
// Snapshot returns the number of values per second since the last snapshot,
// and reset the count to zero.