Add adds size to s and returns approximate values for the current count and total bytes.
(size int64)
| 14 | // Add adds size to s and returns approximate values for the current count |
| 15 | // and total bytes. |
| 16 | func (s *CountSum) Add(size int64) (count uint32, sum int64) { |
| 17 | return s.count.Add(1), s.sum.Add(size) |
| 18 | } |
| 19 | |
| 20 | // Approximate returns an approximation of the current count and sum values. |
| 21 | // It is approximate because retrieving both values is not an atomic operation. |
no outgoing calls