mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
changing function node metrics to new infrastructure
This commit is contained in:
parent
0aaea1ec40
commit
6b96c1876a
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2013 IBM Corp.
|
* Copyright 2013,2015 IBM Corp.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -61,9 +61,11 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.send(results);
|
this.send(results);
|
||||||
|
if (RED.settings.metricsOn && (RED.settings.metricsOn === true)) {
|
||||||
var duration = process.hrtime(start);
|
var duration = process.hrtime(start);
|
||||||
if (process.env.NODE_RED_FUNCTION_TIME) {
|
var converted = Math.floor((duration[0]* 1e9 + duration[1])/10000)/100;
|
||||||
this.status({fill:"yellow",shape:"dot",text:""+Math.floor((duration[0]* 1e9 + duration[1])/10000)/100});
|
this.metric("duration", results, converted);
|
||||||
|
this.status({fill:"yellow",shape:"dot",text:""+converted});
|
||||||
}
|
}
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
this.error(err.toString());
|
this.error(err.toString());
|
||||||
|
Loading…
Reference in New Issue
Block a user