mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Add logging function for queue size
This commit is contained in:
		| @@ -92,6 +92,7 @@ module.exports = function(RED) { | ||||
|         this.randomID = -1; | ||||
|         this.lastSent = null; | ||||
|         this.drop = n.drop; | ||||
|         this.droppedMsgs = 0; | ||||
|         var node = this; | ||||
|  | ||||
|         function ourTimeout(handler, delay) { | ||||
| @@ -137,6 +138,19 @@ module.exports = function(RED) { | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         setInterval(function () { | ||||
|             if (node.buffer.length !== 0) { | ||||
|                 node.debug("node.buffer.length = " + node.buffer.length); | ||||
|             } | ||||
|         }, 15 * 1000); | ||||
|  | ||||
|         setInterval(function () { | ||||
|             if (node.droppedMsgs !== 0) { | ||||
|                 node.debug("node.droppedMsgs = " + node.droppedMsgs); | ||||
|                 node.droppedMsgs = 0; | ||||
|             } | ||||
|         }, 15 * 1000); | ||||
|  | ||||
|         if (node.pauseType === "delay") { | ||||
|             node.on("input", function(msg) { | ||||
|                 if (msg.hasOwnProperty("flush")) { flushDelayList(); } | ||||
| @@ -218,6 +232,9 @@ module.exports = function(RED) { | ||||
|                             } | ||||
|                             if (node.buffer.length < _maxKeptMsgsCount) { | ||||
|                                 node.buffer.push(msg); | ||||
|                             } else { | ||||
|                                 node.trace("dropped due to buffer overflow. msg._msgid = " + msg._msgid); | ||||
|                                 node.droppedMsgs++; | ||||
|                             } | ||||
|                         } | ||||
|                     } else { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user