A variation of this question was already asked here on SO (node.js Event Loop Diagnostics), however that thread is over a year old and stale.
Specifically, I want to be able to peek at the node.js Event Loop at runtime, from within the node.js process, to determine the number of events pending execution.
edit: The results of the previous question pointed to external diagnostic tools and/or internal facilities that gave insight into the length of time it took the event queue to tick.
Currently, I'm checking through the node.js doc's and libuv docs but nothing seems to be popping up. Was hoping there was an undocumented facility I could leverage..
There are a couple of undocumented functions that return a list of open requests and open handles:
process._getActiveRequests()
process._getActiveHandles()
There is also an experimental AsyncListener API in node v0.11.12+ that allows you to add hooks for asynchronous events.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With