spm-agent-nodejs
Version:
Node.js monitoring agent for SPM by Sematext
26 lines (23 loc) • 663 B
JavaScript
var spmAgent = require('../lib/index.js') // or 'spm-agent-nodejs'
spmAgent.on('stats', function (stats) {
// console.log(stats)
})
// spmAgent.on('metric', function (metric) {
// if (metric.name === 'http') {
// console.log(metric)
// }
// })
spmAgent.on('metric', function (metric) {
// if (
// metric.name === 'os'
// ) {
// console.log(metric)
// console.log('\n---------------------------------------------------\n')
// }
console.log(metric)
console.log('\n---------------------------------------------------\n')
})
var http = require('http')
http.createServer(function (req, res) {
res.end('Hello World')
}).listen(3000)