Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}, function (err, conf) {
if (err) {
io.notifyError(err)
return process.exit(1)
}
const cpu = new CPUMetrics(io, conf) // eslint-disable-line
const network = new NetworkMetrics(io, conf) // eslint-disable-line
const disk = new DiskMetrics(io, conf) // eslint-disable-line
const memory = new MemoryMetrics(io, conf) // eslint-disable-line
const fd = new FSMetrics(io, conf) // eslint-disable-line
const tty = new TTYMetrics(io, conf) // eslint-disable-line
const processes = new ProcessesMetrics(io, conf) // eslint-disable-line
const actions = new MonitoringActions()
actions.expose(io)
})
], (err, data) => {
if (err) {
console.error(err)
return io.notifyError(err)
}
// lets update metrics
for (let i = 0, max = metrics.length; i < max; i++) {
var metric = metrics[i]
let stats = {}
// depending on the stats source
switch (metric.from) {
case 'cluster': {
stats = data[0][0]
break
}
case 'cluster_health': {
stats = data[2][0]
break
}