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

Method flushColdBuf

prometheus/summary.go:396–406  ·  view source on GitHub ↗

flushColdBuf needs mtx locked.

()

Source from the content-addressed store, hash-verified

394
395// flushColdBuf needs mtx locked.
396func (s *summary) flushColdBuf() {
397 for _, v := range s.coldBuf {
398 for _, stream := range s.streams {
399 stream.Insert(v)
400 }
401 s.cnt++
402 s.sum += v
403 }
404 s.coldBuf = s.coldBuf[0:0]
405 s.maybeRotateStreams()
406}
407
408// swapBufs needs mtx AND bufMtx locked, coldBuf must be empty.
409func (s *summary) swapBufs(now time.Time) {

Callers 2

WriteMethod · 0.95
asyncFlushMethod · 0.95

Calls 1

maybeRotateStreamsMethod · 0.95

Tested by

no test coverage detected