Henry Oswald 7 лет назад
Родитель
Сommit
93f4a7eeaf

+ 0 - 2
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:

+ 0 - 2
libraries/metrics/metrics.coffee

@@ -11,8 +11,6 @@ hostname = require('os').hostname()
 buildKey = (key)-> "#{name}.#{hostname}.#{key}"
 buildGlobalKey = (key)-> "#{name}.global.#{key}"
 
-
-
 promMetrics = {}
 
 destructors = []

+ 3 - 3
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