From 8c4c706335a29d6169d21b83df505283d1043a68 Mon Sep 17 00:00:00 2001 From: Klaus Bayrhammer Date: Wed, 8 Jun 2016 11:03:26 +0200 Subject: [PATCH] Fixes #8 send histogram duration in seconds see http://docs.datadoghq.com/guides/metrics/#histograms --- lib/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index dd47dbf..3c4fbeb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -45,7 +45,8 @@ module.exports = function (options) { datadog.increment(stat + '.response_code.all' , 1, statTags); } - datadog.histogram(stat + '.response_time', (new Date() - req._startTime), 1, statTags); + var durationInSeconds = (new Date() - req._startTime) / 1000; + datadog.histogram(stat + '.response_time', durationInSeconds, 1, statTags); }; next();