Skip to content
/ monitr Public
forked from yahoo/monitr

Nodejs process monitoring tool. This module currently works only on LINUX. This module spawns a thread and begins monitoring the process.

License

Notifications You must be signed in to change notification settings

luk-/monitr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

monitr

Nodejs process monitoring tool. This module currently works only on LINUX. This module spawns a thread and begins monitoring the process.

It looks up /proc/* files on the system to report CPU Usage. It looks up /proc/pid/* files on the system to report its own stats. It calls the process.monitor.* methods to report total requests, open connections and total data transferred.

process.monitor.* methods are set by lib/monitor.js.

Here is the list of data the module reports periodically:

 { status: 
     { pid: <pid of the node process>,
       ts: <current time stamp>,
       cluster: <process group id>,
       reqstotal: <total requests processed by this node process server>,
       utcstart: <when the process was started>,
       events: <number of new reports being processed since last stats reporting>,,
       cpu: <cpu usage>,
       mem: <memory usage>,
       cpuperreq: <cpu usage per request>,
       oreqs: <current open requests count>,
       sys_cpu: <system cpu load>,
       oconns: <current open connections count>,
       user_cpu: <user cpu load>,
       rps: <requests per second>,
       kbs_out: <kbs of data transferred since last stats reporting>,
       elapsed: <time elapsed since last event>,
       kb_trans: <total kbs of data transferred>,
       jiffyperreq: <cpu usage in terms of ticks per request> 
    }
 }

This package is tested only with Node versions 8 and 10.

install

With npm do:

npm install monitr

methods

var monitor = require('monitr');

start()

monitor.start();

Spawns a thread and monitors the process. Writes process stats every second to the socket path.

stop()

monitor.stop();

Terminates the thread and closes the socket.

setIpcMonitorPath(socketPath)

monitor.setIpcMonitorPath('/tmp/my-process-stats.mon');

Sets the handle to write the stats to. If not specified, defaults to /tmp/nodejs.mon

example

Please refer to the examples/README.md for details

Build Status

Build Status

Node Badge

NPM

About

Nodejs process monitoring tool. This module currently works only on LINUX. This module spawns a thread and begins monitoring the process.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 57.2%
  • JavaScript 41.9%
  • Python 0.9%