Scale summaries from milliseconds to seconds.

Fixes #177

Updating exporter tests for new summary unit scaling behavior

Signed-off-by: Spencer Malone <malone.spencer@gmail.com>
This commit is contained in:
SpencerMalone 2019-01-09 10:31:05 -05:00 committed by Spencer Malone
parent 2d35b097ae
commit c73a7b2c9a
2 changed files with 2 additions and 2 deletions

View file

@ -420,7 +420,7 @@ func (b *Exporter) handleEvent(event Event) {
mapping, mapping,
) )
if err == nil { if err == nil {
summary.Observe(event.Value()) summary.Observe(event.Value() / 1000) // prometheus presumes seconds, statsd millisecond
b.saveLabelValues(metricName, prometheusLabels, mapping.Ttl) b.saveLabelValues(metricName, prometheusLabels, mapping.Ttl)
eventStats.WithLabelValues("timer").Inc() eventStats.WithLabelValues("timer").Inc()
} else { } else {

View file

@ -216,7 +216,7 @@ mappings:
// event with ttl = 2s from a mapping // event with ttl = 2s from a mapping
&TimerEvent{ &TimerEvent{
metricName: "bazqux.main", metricName: "bazqux.main",
value: 42, value: 42000,
}, },
} }