From f462446213094809f0418e84d0329e90892d0f4c Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 4 Feb 2015 10:01:46 +0000 Subject: [PATCH] Make Function duration status optional --- nodes/core/core/80-function.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodes/core/core/80-function.js b/nodes/core/core/80-function.js index df197450f..0aafba333 100644 --- a/nodes/core/core/80-function.js +++ b/nodes/core/core/80-function.js @@ -61,10 +61,10 @@ module.exports = function(RED) { } } this.send(results); - if (RED.settings.metricsOn && (RED.settings.metricsOn === true)) { - var duration = process.hrtime(start); - var converted = Math.floor((duration[0]* 1e9 + duration[1])/10000)/100; - this.metric("duration", results, converted); + var duration = process.hrtime(start); + var converted = Math.floor((duration[0]* 1e9 + duration[1])/10000)/100; + this.metric("duration", msg, converted); + if (process.env.NODE_RED_FUNCTION_TIME) { this.status({fill:"yellow",shape:"dot",text:""+converted}); } } catch(err) {