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

Added Windows CPU load indicator

This commit is contained in:
Ylian Saint-Hilaire 2021-04-02 22:41:51 -07:00
parent 6ddf4bd151
commit cecab41cff
2 changed files with 2 additions and 2 deletions

View file

@ -388,8 +388,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
// Take a look at server stats
var os = require('os');
var stats = { action: 'serverstats', totalmem: os.totalmem(), freemem: os.freemem() };
try { stats.cpuavg = os.loadavg(); } catch (ex) { }
if (parent.parent.platform != 'win32') {
stats.cpuavg = os.loadavg();
try { stats.availablemem = 1024 * Number(/MemAvailable:[ ]+(\d+)/.exec(fs.readFileSync('/proc/meminfo', 'utf8'))[1]); } catch (ex) { }
}