MCPcopy
hub / github.com/prometheus/prometheus / addFH

Method addFH

storage/buffer.go:563–577  ·  view source on GitHub ↗

addFH is a version of the add method specialized for fhSample.

(s fhSample)

Source from the content-addressed store, hash-verified

561
562// addFH is a version of the add method specialized for fhSample.
563func (r *sampleRing) addFH(s fhSample) {
564 switch r.bufInUse {
565 case fhBuf: // Add to existing fhSamples.
566 r.fhBuf = addFH(s, r.fhBuf, r)
567 case noBuf: // Add first sample.
568 r.fhBuf = addFH(s, r.fhBuf, r)
569 r.bufInUse = fhBuf
570 case iBuf: // Already have interface samples. Add to the interface buf.
571 r.iBuf = addSample(s, r.iBuf, r)
572 default:
573 // Already have specialized samples that are not fhSamples.
574 // Need to call the checked add method for conversion.
575 r.add(s)
576 }
577}
578
579// addSample adds a sample to a buffer of chunks.Sample, i.e. the general case
580// using an interface as the type.

Callers 2

NextMethod · 0.80

Calls 3

addMethod · 0.95
addFHFunction · 0.85
addSampleFunction · 0.85

Tested by 1