mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
29 lines
380 B
JavaScript
29 lines
380 B
JavaScript
var pmx = require('pmx');
|
|
|
|
var Probe = pmx.probe();
|
|
|
|
var i = 0;
|
|
|
|
var val = Probe.metric({
|
|
name : 'test',
|
|
value : function() {
|
|
return i;
|
|
},
|
|
alert : {
|
|
mode : 'threshold',
|
|
value : 20,
|
|
msg : 'more than 20',
|
|
func : function() {
|
|
console.log('exiting');
|
|
process.exit(1);
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
|
|
setInterval(function() {
|
|
console.log(i);
|
|
i++;
|
|
}, 200);
|