mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Use httpRequestTimingLog for enable detailed timing log
This commit is contained in:
parent
401466d6c0
commit
490547cd3d
@ -99,6 +99,11 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
||||
noprox = proxyConfig.noproxy;
|
||||
}
|
||||
|
||||
let timingLog = false;
|
||||
if (RED.settings.hasOwnProperty("httpRequestTimingLog")) {
|
||||
timingLog = RED.settings.httpRequestTimingLog;
|
||||
}
|
||||
|
||||
this.on("input",function(msg,nodeSend,nodeDone) {
|
||||
checkNodeAgentPatch();
|
||||
//reset redirectList on each request
|
||||
@ -514,8 +519,10 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
||||
if (res.client && res.client.bytesRead) {
|
||||
node.metric("size.bytes", msg, res.client.bytesRead);
|
||||
}
|
||||
if (timingLog) {
|
||||
emitTimingMetricLog(res.timings, msg);
|
||||
}
|
||||
}
|
||||
|
||||
// Convert the payload to the required return type
|
||||
if (node.ret !== "bin") {
|
||||
@ -539,7 +546,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
||||
}
|
||||
msg.payload = err.toString() + " : " + url;
|
||||
msg.statusCode = err.code || (err.response?err.response.statusCode:undefined);
|
||||
if (node.metric()) {
|
||||
if (node.metric() && timingLog) {
|
||||
emitTimingMetricLog(err.timings, msg);
|
||||
}
|
||||
nodeSend(msg);
|
||||
|
Loading…
Reference in New Issue
Block a user