MCPcopy
hub / github.com/prometheus/prometheus / FloatHistogramSamples

Method FloatHistogramSamples

tsdb/record/record.go:704–714  ·  view source on GitHub ↗

FloatHistogramSamples appends float histogram samples in rec to the given slice.

(rec []byte, histograms []RefFloatHistogramSample)

Source from the content-addressed store, hash-verified

702// FloatHistogramSamples appends float histogram samples in rec to the given
703// slice.
704func (d *Decoder) FloatHistogramSamples(rec []byte, histograms []RefFloatHistogramSample) ([]RefFloatHistogramSample, error) {
705 dec := encoding.Decbuf{B: rec}
706 switch typ := Type(dec.Byte()); typ {
707 case FloatHistogramSamples, CustomBucketsFloatHistogramSamples:
708 return d.floatHistogramSamplesV1(&dec, histograms)
709 case FloatHistogramSamplesV2:
710 return d.floatHistogramSamplesV2(&dec, histograms)
711 default:
712 return nil, fmt.Errorf("invalid record type %v", typ)
713 }
714}
715
716// floatHistogramSamplesV1 decodes V1 float-histogram records (BE64 baseRef/baseTime, varint deltas).
717func (d *Decoder) floatHistogramSamplesV1(dec *encoding.Decbuf, histograms []RefFloatHistogramSample) ([]RefFloatHistogramSample, error) {

Calls 4

ByteMethod · 0.95
TypeTypeAlias · 0.70