in provider/lib/health.js [35:61]
this.health = function (req, res) {
var stats = {triggerCount: Object.keys(utils.triggers).length};
// get all system stats in parallel
Promise.all([
si.mem(),
si.currentLoad(),
si.fsSize(),
si.networkStats(),
si.inetLatency(utils.routerHost)
])
.then(results => {
stats.triggerMonitor = monitorStatus;
stats.memory = results[0];
stats.cpu = _.omit(results[1], 'cpus');
stats.disk = results[2];
stats.network = results[3];
stats.apiHostLatency = results[4];
stats.heapStatistics = v8.getHeapStatistics();
res.send(stats);
})
.catch(error => {
stats.error = error;
res.send(stats);
});
};