Vitals
Vitals is a module that will collect health statistics for process ids past to it, currently collections cpu time, memory usage and uptime.
Installation
$ npm install vitals
Features
- Windows & Unix support
- Meta data support
- Data sampling
Options
interval
the interval in which to poll the processes (Default 3000ms)maxSamples
the maximum number of samples to retainsampleRate
the rate at which to sample data between 0 (disabled) and 1 for 100%, ie: 0.15 for 15% of the time
Events
started
when the monitor is activatedstopped
when the monitor has stopped monitoring the processesadded
when a process has been added to the monitorremoved
when a process has been removed from the monitor, died will be in the meta data if removed due to process stoppingdata
the processes health data
Usage
Initiate vitals and add processes
var vitals = ;
Adding processes to vitals
vitals; vitals
Getting monitored processes
var proc = vitals;var procs = vitals;var procs = vitals;
Removing processes to vitals
vitals; vitals; vitals vitals; //removes all
Starting / Stopping
vitalsstart; vitals;
Count number of processes being monitored
vitalslength
Sampling Data
vitals; var proc = vitals; procmeta_samples
Events
vitals; vitals; vitals vitals; vitals;
Running tests
$ npm install
$ npm test
License
(The MIT License)