mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-06 20:48:40 +00:00
fix cpu %
This commit is contained in:
parent
e0aa1406e2
commit
675c4bcd3c
|
|
@ -116,7 +116,7 @@ final class SystemUtils
|
||||||
\exec('wmic cpu get LoadPercentage', $cpuUsage);
|
\exec('wmic cpu get LoadPercentage', $cpuUsage);
|
||||||
$cpuUsage = $cpuUsage[1];
|
$cpuUsage = $cpuUsage[1];
|
||||||
} elseif (\stristr(\PHP_OS, 'LINUX') !== false) {
|
} elseif (\stristr(\PHP_OS, 'LINUX') !== false) {
|
||||||
$cpuUsage = \sys_getloadavg()[0] * 100;
|
$cpuUsage = \sys_getloadavg()[0] * 100 / \exec('nproc');
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int) $cpuUsage;
|
return (int) $cpuUsage;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user