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)
| 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. |
| 159 | func (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 |