MCPcopy
hub / github.com/prometheus/prometheus / addH

Method addH

storage/buffer.go:546–560  ·  view source on GitHub ↗

addH is a version of the add method specialized for hSample.

(s hSample)

Source from the content-addressed store, hash-verified

544
545// addH is a version of the add method specialized for hSample.
546func (r *sampleRing) addH(s hSample) {
547 switch r.bufInUse {
548 case hBuf: // Add to existing hSamples.
549 r.hBuf = addH(s, r.hBuf, r)
550 case noBuf: // Add first sample.
551 r.hBuf = addH(s, r.hBuf, r)
552 r.bufInUse = hBuf
553 case iBuf: // Already have interface samples. Add to the interface buf.
554 r.iBuf = addSample(s, r.iBuf, r)
555 default:
556 // Already have specialized samples that are not hSamples.
557 // Need to call the checked add method for conversion.
558 r.add(s)
559 }
560}
561
562// addFH is a version of the add method specialized for fhSample.
563func (r *sampleRing) addFH(s fhSample) {

Callers 3

TestSampleRingMixedFunction · 0.80
NextMethod · 0.80

Calls 3

addMethod · 0.95
addHFunction · 0.85
addSampleFunction · 0.85

Tested by 2

TestSampleRingMixedFunction · 0.64