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

Method Decode

expfmt/decode.go:184–191  ·  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

182// Decode calls the Decode method of the wrapped Decoder and then extracts the
183// samples from the decoded MetricFamily into the provided model.Vector.
184func (sd *SampleDecoder) Decode(s *model.Vector) error {
185 err := sd.Dec.Decode(&sd.f)
186 if err != nil {
187 return err
188 }
189 *s, err = extractSamples(&sd.f, sd.Opts)
190 return err
191}
192
193// ExtractSamples builds a slice of samples from the provided metric
194// 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