Cluster metrics
Install
npm install --save cluster-metrics
Use
In every process (master or worker) attach module
var metrics = require('cluster-metrics');
In master use collector
property to access collector instance
var collector = metrics.collector;
Listen to data
event on it and get collected stats there
collector.on('data', function(frame) {
});
Stat frame
TODO add frame sample
Custom metrics
TODO
Monitoring server
You can create a monitoring server using metrics.server()
. Net.Server
instance is returned.
var server = metrics.server();
server
.listen(8000)
.on('error', function(e) {
});
This is a raw socket server. Then connected, it began to dump screens of text until connection is closed:
# nc monitoring.host.tld 8000
TODO Add screen sample