diff --git a/libraries/metrics/http.coffee b/libraries/metrics/http.coffee index 45f72b7642..f5e3719d53 100644 --- a/libraries/metrics/http.coffee +++ b/libraries/metrics/http.coffee @@ -10,8 +10,6 @@ module.exports.monitor = (logger) -> responseTime = new Date() - startTime if req.route?.path? routePath = req.route.path.toString().replace(/\//g, '_').replace(/\:/g, '').slice(1) - key = "http-requests.#{routePath}.#{req.method}.#{res.statusCode}" - Metrics.timing("http_request", responseTime, null, {method:req.method, status_code: res.statusCode, path:routePath}) logger.log req: diff --git a/libraries/metrics/metrics.coffee b/libraries/metrics/metrics.coffee index 77953b275b..c96db21c67 100644 --- a/libraries/metrics/metrics.coffee +++ b/libraries/metrics/metrics.coffee @@ -11,8 +11,6 @@ hostname = require('os').hostname() buildKey = (key)-> "#{name}.#{hostname}.#{key}" buildGlobalKey = (key)-> "#{name}.global.#{key}" - - promMetrics = {} destructors = [] diff --git a/libraries/metrics/timeAsyncMethod.coffee b/libraries/metrics/timeAsyncMethod.coffee index 73f69cc334..8d6099d826 100644 --- a/libraries/metrics/timeAsyncMethod.coffee +++ b/libraries/metrics/timeAsyncMethod.coffee @@ -25,15 +25,15 @@ module.exports = (obj, methodName, prefix, logger) -> logger.log "[Metrics] expected wrapped method '#{methodName}' to be invoked with a callback" return realMethod.apply this, originalArgs - timer = new metrics.Timer(startPrefix, null, {method: modifedMethodName}) + timer = new metrics.Timer(startPrefix, 1, {method: modifedMethodName}) realMethod.call this, firstArgs..., (callbackArgs...) -> elapsedTime = timer.done() possibleError = callbackArgs[0] if possibleError? - metrics.inc "#{startPrefix}_result", null, {status:"failed", method: modifedMethodName} + metrics.inc "#{startPrefix}_result", 1, {status:"failed", method: modifedMethodName} else - metrics.inc "#{startPrefix}_result", null, {status:"success", method: modifedMethodName} + metrics.inc "#{startPrefix}_result", 1, {status:"success", method: modifedMethodName} if logger? loggableArgs = {} try