MCPcopy Create free account
hub / github.com/prometheus/common / Decode

Method Decode

expfmt/decode.go:191–198  ·  view source on GitHub ↗

Decode calls the Decode method of the wrapped Decoder and then extracts the samples from the decoded MetricFamily into the provided model.Vector.

(s *model.Vector)

Source from the content-addressed store, hash-verified

189// Decode calls the Decode method of the wrapped Decoder and then extracts the
190// samples from the decoded MetricFamily into the provided model.Vector.
191func (sd *SampleDecoder) Decode(s *model.Vector) error {
192 err := sd.Dec.Decode(&sd.f)
193 if err != nil {
194 return err
195 }
196 *s, err = extractSamples(&sd.f, sd.Opts)
197 return err
198}
199
200// ExtractSamples builds a slice of samples from the provided metric
201// families. If an error occurs during sample extraction, it continues to

Callers 2

TestTextDecoderFunction · 0.95
TestProtoDecoderFunction · 0.95

Calls 2

extractSamplesFunction · 0.85
DecodeMethod · 0.65

Tested by 2

TestTextDecoderFunction · 0.76
TestProtoDecoderFunction · 0.76