Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
event-loop-inspector
Advanced tools
Dump event loop data. Useful to known which processes are running and potentially block your application. Can be used for real time monitoring also.
It basically call core NodeJs functions _getActiveHandles and _getActiveRequests to inspect event loop's state.
No dependency.
Supported and tested : >= 4.x Not supported but should work : 0.12.x
Version | Supported | Tested |
---|---|---|
9.x | yes | yes |
8.x | yes | yes |
7.x | yes | yes |
6.x | yes | yes |
4.x | yes | yes |
0.12.x | no | yes( manually) |
> 0.12.x | no | no |
$ npm install event-loop-inspector --save
const inspector = require('event-loop-inspector')();
const dump = inspector.dump();
console.log(dump);
{
handles:
{
setTimeout:
[{
type: 'setTimeout',
startAfter: 311,
name: 'anonymous',
msecs: 2000
}],
Server:
[{
type: 'Server',
address: '::',
port: 8000,
listeners: [{name: 'connectionListener'}]
}],
Socket:
[{
type: 'Socket',
localAddress: '127.0.0.1',
localPort: 45014,
remoteAddress: '127.0.0.1',
remotePort: 8000,
remoteFamily: 'IPv4',
method: 'GET',
path: '/toto',
headers: {host: '127.0.0.1:8000'},
listeners: []
}]
},
requests:
{
TCPConnectWrap:
[{
type: 'TCPConnectWrap',
address: 'xxx.xxx.xxx.xxx',
port: xxxx,
localAddress: 'xxx.xxx.xxx.xxx',
localPort: xxxx
}]
},
setImmediates:
[
{type: 'setImmediate', name: 'setImmediateTest2'},
{type: 'setImmediate', name: 'anonymous'}
],
nextTicks:
[
{type: 'nextTick', name: 'afterWrite'},
{type: 'nextTick', name: 'anonymous'}
]
}
By default setImmediates and process.nextTick can't be retrieved with functions _getActiveHandles/_getActiveRequests. If you want to allow event-loop-inspector to wrap some core functions, instantiate inspector with first argument set as true.
const inspector = require('event-loop-inspector')(true);
const dump = inspector.dump();
console.log(dump);
Functions that can be wrapped :
/!\ Enabling this option may lower performance of the functions involved.
$ npm test
To generate coverage :
$ npm run test-coverage
Coverage report can be found in coverage/.
FAQs
Dump event loop data.
The npm package event-loop-inspector receives a total of 7,169 weekly downloads. As such, event-loop-inspector popularity was classified as popular.
We found that event-loop-inspector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.