1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added CPU to server graph.

This commit is contained in:
Ylian Saint-Hilaire 2021-06-22 09:55:31 -07:00
parent f48536c40d
commit 83117f3409
2 changed files with 31 additions and 5 deletions

View file

@ -1716,7 +1716,6 @@ function CreateMeshCentralServer(config, args) {
time: new Date(),
expire: expire,
mem: process.memoryUsage(),
//cpu: process.cpuUsage(),
conn: {
ca: Object.keys(obj.webserver.wsagents).length,
cu: Object.keys(obj.webserver.wssessions).length,
@ -1725,6 +1724,7 @@ function CreateMeshCentralServer(config, args) {
},
traffic: trafficStats.delta
};
try { data.cpu = require('os').loadavg(); } catch (ex) { }
if (obj.mpsserver != null) {
data.conn.am = 0;
for (var i in obj.mpsserver.ciraConnections) { data.conn.am += obj.mpsserver.ciraConnections[i].length; }