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,
)
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 {

View file

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