Skip to content

Get stats on how many sockets are active, connected, ready, have received data, etc.

License

Notifications You must be signed in to change notification settings

anonimitoraf/nodejs-sockets-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nodejs-sockets-monitor

Install

# NOTE: Comes with typescript types
npm install nodejs-sockets-monitor
# or
yarn add nodejs-sockets-monitor

Allows subscription to socket stats. Example output and usage:

import { subscribeToSocketStats } from 'nodejs-sockets-monitor';

const interval = 1000; // Show updated stats every sec.
subscribeToSocketStats(stats => {
  console.clear();
  console.table(stats);
}, interval);
(index) active close connect data drain end error lookup ready timeout
localhost:5984 1 34 35 34 33 0 0 35 35 0

Credits

This codebase is essentially a refactoring of https://github.com/vigneshshanmugam/monitor-sockets

About

Get stats on how many sockets are active, connected, ready, have received data, etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published