Skip to content

Commit 691e814

Browse files
committed
Update comments according to review
Signed-off-by: Jeanette Tan <[email protected]>
1 parent 0267435 commit 691e814

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

model/value.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ var (
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.
3436
type 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
119122
func (s *Sample) UnmarshalJSON(b []byte) error {
120123
v := struct {
121124
Metric Metric `json:"metric"`

0 commit comments

Comments
 (0)