monitor-sockets

0.0.1 • Public • Published

monitor-sockets

Monitor socket connections in Node.js

Installation

yarn add monitor-sockets

Use

// In your application index.js file before starting the server
const monitor = require("monitor-sockets");

monitor.start({ interval: 2000 });

// Renders the table on the terminal
┌────────────────┬─────────┬────────┬──────────┬─────────┬───────────┬───────┐
 Socket Name     Created  In Use  Requests  Timeout  Destroyed  Error 
├────────────────┼─────────┼────────┼──────────┼─────────┼───────────┼───────┤localhost:8082  20       0       0         0        0          20    
├────────────────┼─────────┼────────┼──────────┼─────────┼───────────┼───────┤localhost:8085  20       0       0         0        0          20    
├────────────────┼─────────┼────────┼──────────┼─────────┼───────────┼───────┤localhost:8086  20       0       0         0        0          20    
└────────────────┴─────────┴────────┴──────────┴─────────┴───────────┴───────┘

API

start(options)

Starts monitoring the socket connections for both HTTP and HTTPS.

  • options {Object}

    • interval - Refresh interval to update the data on the Terminal

LICENSE

MIT

Package Sidebar

Install

npm i monitor-sockets

Weekly Downloads

15

Version

0.0.1

License

MIT

Unpacked Size

6.89 kB

Total Files

6

Last publish

Collaborators

  • vignesh.shanmugam