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:
parent
6ddf4bd151
commit
cecab41cff
2 changed files with 2 additions and 2 deletions
|
@ -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) { }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue