swapBufs needs mtx AND bufMtx locked, coldBuf must be empty.
(now time.Time)
| 407 | |
| 408 | // swapBufs needs mtx AND bufMtx locked, coldBuf must be empty. |
| 409 | func (s *summary) swapBufs(now time.Time) { |
| 410 | if len(s.coldBuf) != 0 { |
| 411 | panic("coldBuf is not empty") |
| 412 | } |
| 413 | s.hotBuf, s.coldBuf = s.coldBuf, s.hotBuf |
| 414 | // hotBuf is now empty and gets new expiration set. |
| 415 | for now.After(s.hotBufExpTime) { |
| 416 | s.hotBufExpTime = s.hotBufExpTime.Add(s.streamDuration) |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | type summaryCounts struct { |
| 421 | // sumBits contains the bits of the float64 representing the sum of all |
no test coverage detected