Purpose
Node agent for Node health project.
Compatibility
/!\ This module use async/await syntax and the inspector module, this is why you must have node 8.0+.
Supported and tested : >= 8.0
Version | Supported | Tested |
---|
12.x | yes | yes |
10.x | yes | yes |
9.x | yes | yes |
8.x | yes | yes |
In order to have all features we recommend to use at least Node.js version 10 or higher.
Installation
$ npm install node-health-agent --save
Usage
Basic
const agent = require('node-health-agent')({
appName: 'testAPI',
serverUrl: 'ws://localhost:3001',
inspector: {
storage: {
type: "s3",
bucket: process.env.CONFIG_S3_BUCKET,
dir: 'inspector'
}
}
})
Add a custom event
agent.addEvent('myEvent', (event) => {
console.log(event)
})
List of built-in events
Event | description |
---|
cpu_profiling_start | Start a CPU profiling |
cpu_profiling_stop | Stop a CPU profiling |
Test
$ npm test
Coverage report can be found in coverage/.