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