Simple, self-hosted module based on Socket.io and Chart.js to report realtime server metrics for Hapi.js servers.
Inspired from express-status-monitor
-
Run
npm install hapijs-status-monitor --save
-
Register plugin
server.register({ register: require('hapijs-status-monitor')});
-
Run server and go to
/status
To send requests locally
while sleep 1; do curl http://localhost:8000/hello; done
Monitor can be configured by passing options object into server register method
server.register({ register: require('hapijs-status-monitor'), options:{}})
Default config:
path: '/status',
spans: [{
interval: 1, // Every second
retention: 60 // Keep 60 datapoints in memory
}, {
interval: 5, // Every 5 seconds
retention: 60
}, {
interval: 15, // Every 15 seconds
retention: 60
}]
MIT License © ziyasal