Skip to content

Commit

Permalink
docs: update documentation about new pm2 apm and metrics system
Browse files Browse the repository at this point in the history
  • Loading branch information
wallet77 committed Jul 3, 2018
1 parent 29cccd9 commit a082a5f
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,29 +172,30 @@ $ pm2 register

To get more insights on how your application behave, plug custom metrics inside your code and monitor them with the `pm2 monit` command:

In your project install [pmx](https://github.com/keymetrics/pmx):
In your project install [pm2-io-pm](https://github.com/keymetrics/pm2-io-apm):

```bash
$ npm install pmx --save
$ npm install @pm2/io --save
```

Then plug a custom metric:

```javascript
var Probe = require('pmx').probe();
const io = require('@pm2/io');

var counter = 1;
let counter = 1;

var metric = Probe.metric({
name : 'Counter',
value : function() {
return counter;
}
const latency = io.metric({
name : 'Counter',
value : function() {
return counter;
}
});

setInterval(function() {
setInterval(() => {
counter++;
}, 1000);

```

Then to see the metric type from in the terminal:
Expand Down

0 comments on commit a082a5f

Please sign in to comment.