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

Method Decode

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

157// Decode calls the Decode method of the wrapped Decoder and then extracts the
158// samples from the decoded MetricFamily into the provided model.Vector.
159func (sd *SampleDecoder) Decode(s *model.Vector) error {
160 err := sd.Dec.Decode(&sd.f)
161 if err != nil {
162 return err
163 }
164 *s, err = extractSamples(&sd.f, sd.Opts)
165 return err
166}
167
168// ExtractSamples builds a slice of samples from the provided metric
169// 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