Skip to content

Commit

Permalink
Merge pull request #65 from prometheus/beorn7/histogram
Browse files Browse the repository at this point in the history
Properly set the sum in a histogram
  • Loading branch information
beorn7 authored Jul 23, 2019
2 parents 9ab3b30 + 36c1adb commit b7b4ff1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion prom2json.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func NewFamily(dtoMF *dto.MetricFamily) *Family {
TimestampMs: makeTimestamp(m),
Buckets: makeBuckets(m),
Count: fmt.Sprint(m.GetHistogram().GetSampleCount()),
Sum: fmt.Sprint(m.GetSummary().GetSampleSum()),
Sum: fmt.Sprint(m.GetHistogram().GetSampleSum()),
}
} else {
mf.Metrics[i] = Metric{
Expand Down
2 changes: 1 addition & 1 deletion prom2json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ var tcs = []testCase{
"1e+06": "5",
},
Count: "1",
Sum: "0",
Sum: "2",
},
},
},
Expand Down

0 comments on commit b7b4ff1

Please sign in to comment.