File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 3030 ZeroSample = Sample {Timestamp : Earliest }
3131)
3232
33- // Sample is a sample pair associated with a metric.
33+ // Sample is a sample pair associated with a metric. A single sample must either
34+ // define Value or Histogram but not both. Histogram == nil implies the Value
35+ // field is used, otherwise it should be ignored.
3436type Sample struct {
3537 Metric Metric `json:"metric"`
3638 Value SampleValue `json:"value"`
@@ -116,6 +118,7 @@ func (s *sampleHistogramPairPtr) UnmarshalJSON(buf []byte) error {
116118}
117119
118120// UnmarshalJSON implements json.Unmarshaler.
121+ // TODO: simplify and remove the need for both sampleHistogramPairPtr and SampleHistogramPair
119122func (s * Sample ) UnmarshalJSON (b []byte ) error {
120123 v := struct {
121124 Metric Metric `json:"metric"`
You can’t perform that action at this time.
0 commit comments