From 6854a64b73e03634fde09c104fcc5f13d9782906 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 20 Nov 2018 17:20:49 +0000 Subject: [PATCH] fix this.key --- libraries/metrics/metrics.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/metrics/metrics.coffee b/libraries/metrics/metrics.coffee index 9cf1f49758..9c59c9f727 100644 --- a/libraries/metrics/metrics.coffee +++ b/libraries/metrics/metrics.coffee @@ -64,17 +64,18 @@ module.exports = Metrics = this.start = new Date() this.key = key this.sampleRate = sampleRate + done:-> timeSpan = new Date - this.start statsd.timing(buildKey(this.key), timeSpan, this.sampleRate) - if !summaries[key]? + if !summaries[this.key]? summary = new client.Summary({ - name: "#{name}_#{key}", - help: key, + name: "#{name}_#{this.key}", + help: this.key, maxAgeSeconds: 600, ageBuckets: 10 }) - summaries[key].observe(timeSpan) + summaries[this.key].observe(timeSpan) return timeSpan gauge : (key, value, sampleRate = 1)->