pm2/examples/pmx/elements/histogram.js
2017-03-30 00:57:11 +02:00

16 lines
237 B
JavaScript

const pmx = require('pmx');
const Probe = pmx.probe();
var metric = Probe.histogram({
name : 'Histogram'
});
var latency;
setInterval(function() {
latency = Math.round(Math.random() * 100);
metric.update(latency);
}, 100);