koa2-monitor
v0.1.2
Published
Realtime monitoring for koa2-based Node applications
Downloads
8
Maintainers
Readme
koa2-monitor
Simple, self-hosted module based on Socket.io and Chart.js to report realtime server metrics for [email protected] node servers.
Installation & setup
- Run
npm install koa2-monitor --save
- Before any other middleware add following line:
const monitor = require('koa2-monitor')
// then after
app.use(monitor({path: '/status', port: 3003}))
- Run server and go to
/status
Options
Monitor can be configured by passing options(second argument) object into monitor
constructor.
Default config:
path: '/status',
port: 3003,
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
}]
For an example koa server, check out `sample/server.js'
License
MIT License © Daniel V.
Forked from koa-monitor