node-health
v1.0.2
Published
Node JS process health monitor
Downloads
11
Readme
NODE HEALTH
Node JS process health monitor
Usage
// master.js
'use strict';
import {fork} from 'child_process';
import {cpus} from 'os';
import monitor from 'node-health/monitor';
const processes = cpus().map(() => fork('./fork'));
monitor(processes);
// service.js
'use strict';
import 'node-health/child';
setInterval(function () {
let i = 100000;
while(i--);
}, 2000);
and open url http://localhost:5113/health
environment variables
- HEALTH_PORT - port for monitor
- HEALTH_HOST - host for monitor
- HEALTH_ENDPOINT - endpoint for monitor
- HEALTH_LOG - monitor log file
- HEALTH_TICK - monitor tick measurement
- HEALTH_SIZE - maximum display size of metrics
License
The MIT License Copyright (c) 2017-present Ivan Zakharchenko