Exposes stats about the libuv default loop
npm install --save event-loop-stats
var eventLoopStats = require('event-loop-stats');
console.log('Stats', eventLoopStats.sense());
This will print the following information:
Stats {
max: 5,
min: 0,
sum: 10,
num: 5
}
max
: Maximum number of milliseconds spent in a single loop since lastsense call
.min
: Minimum number of milliseconds spent in a single loop since lastsense call
.sum
: Total number of milliseconds spent in the loop since lastsense call
.num
: Total number of loops since lastsense call
.
event-loop-stats
depends on C++ extensions which are compiled when the event-loop-stats
module is installed. Compatibility information can be inspected via the Travis-CI build jobs.