Rectangle 27 0

node.js Event Loop Diagnostics?


var ts=Date.now();
setImmediate(function()
{
  var delay=Date.now()-ts;
});

The measurement itself will affect the event queue as well but this should have a much lower overhead than a full profiler.

This also takes cpu intensive events into account (which would not be possible by just looking at the # of events).

While I wasn't able to find the number of waiting events in the queue I found another health metric that might be useful:

delay will contain the milliseconds it took from queuing the event to executing it.

would be great if we could actually 'see' the event que... I suppose you never found a way to do this?

Note
Rectangle 27 0

node.js Event Loop Diagnostics?


var ts=Date.now();
setImmediate(function()
{
  var delay=Date.now()-ts;
});

The measurement itself will affect the event queue as well but this should have a much lower overhead than a full profiler.

This also takes cpu intensive events into account (which would not be possible by just looking at the # of events).

While I wasn't able to find the number of waiting events in the queue I found another health metric that might be useful:

delay will contain the milliseconds it took from queuing the event to executing it.

would be great if we could actually 'see' the event que... I suppose you never found a way to do this?

Note
Rectangle 27 0

node.js Event Loop Diagnostics?


It appears to do something similar to what I was describing previously: "The NodeFly agent patches the nextTick function to get timing data for the event loop."

NodeFly's agent monitors overall Node.js performance including the Event Loop. You can read a couple of blog entries taling about this functionality:

You can find and try out the agent here:

Note