MCPcopy
hub / github.com/prometheus/client_golang / maybeRotateStreams

Method maybeRotateStreams

prometheus/summary.go:383–393  ·  view source on GitHub ↗

rotateStreams needs mtx AND bufMtx locked.

()

Source from the content-addressed store, hash-verified

381
382// rotateStreams needs mtx AND bufMtx locked.
383func (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.
396func (s *summary) flushColdBuf() {

Callers 1

flushColdBufMethod · 0.95

Calls 2

AddMethod · 0.65
ResetMethod · 0.45

Tested by

no test coverage detected