block-event
block-event is an event loop watcher for nodejs. It alerts you with a blocked event when the eventloop stopped more times then the given threshold.
Installation
$ npm install block-event
How to use
Set up watch
var threshold = 10; //msvar BlockEvent = ;var blockEvent = threshold; blockEventthreshold === 10; // true blockEvent;
To stop the watcher, use stop(). It emits a watchStopped event.
blockEvent;
To resume the watcher use resume(). It emits a watchStarted event.
blockEvent;
To get the average cicyle time use avg():
var avg = blockEvent;
To get the maximum cicyle time use max():
var max = blockEvent;
The default lag threshold is 10 ms.
Test
$ npm test