rotateStreams needs mtx AND bufMtx locked.
()
| 381 | |
| 382 | // rotateStreams needs mtx AND bufMtx locked. |
| 383 | func (s *summary) maybeRotateStreams() { |
| 384 | for !s.hotBufExpTime.Equal(s.headStreamExpTime) { |
| 385 | s.headStream.Reset() |
| 386 | s.headStreamIdx++ |
| 387 | if s.headStreamIdx >= len(s.streams) { |
| 388 | s.headStreamIdx = 0 |
| 389 | } |
| 390 | s.headStream = s.streams[s.headStreamIdx] |
| 391 | s.headStreamExpTime = s.headStreamExpTime.Add(s.streamDuration) |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | // flushColdBuf needs mtx locked. |
| 396 | func (s *summary) flushColdBuf() { |
no test coverage detected