Skip to content

Commit

Permalink
Scale summaries from milliseconds to seconds.
Browse files Browse the repository at this point in the history
Fixes #177

Updating exporter tests for new summary unit scaling behavior

Signed-off-by: Spencer Malone <malone.spencer@gmail.com>
  • Loading branch information
SpencerMalone committed Jan 9, 2019
1 parent 2d35b09 commit c73a7b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ func (b *Exporter) handleEvent(event Event) {
mapping,
)
if err == nil {
summary.Observe(event.Value())
summary.Observe(event.Value() / 1000) // prometheus presumes seconds, statsd millisecond
b.saveLabelValues(metricName, prometheusLabels, mapping.Ttl)
eventStats.WithLabelValues("timer").Inc()
} else {
Expand Down
2 changes: 1 addition & 1 deletion exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ mappings:
// event with ttl = 2s from a mapping
&TimerEvent{
metricName: "bazqux.main",
value: 42,
value: 42000,
},
}

Expand Down

0 comments on commit c73a7b2

Please sign in to comment.