Removed CPU Load for Windows

This commit is contained in:
Roman Hergenreder 2020-06-24 16:13:54 +02:00
parent 9904be687f
commit 56133eaa57

@ -76,6 +76,11 @@ class Stats extends Request {
$pageCount = $this->getPageCount(); $pageCount = $this->getPageCount();
$visitorStatistics = $this->getVisitorStatistics(); $visitorStatistics = $this->getVisitorStatistics();
$loadAvg = "Unknown";
if (function_exists("sys_getloadavg")) {
$loadAvg = sys_getloadavg();
}
if ($this->success) { if ($this->success) {
$this->result["userCount"] = $userCount; $this->result["userCount"] = $userCount;
$this->result["pageCount"] = $pageCount; $this->result["pageCount"] = $pageCount;
@ -84,7 +89,7 @@ class Stats extends Request {
"version" => WEBBASE_VERSION, "version" => WEBBASE_VERSION,
"server" => $_SERVER["SERVER_SOFTWARE"] ?? "Unknown", "server" => $_SERVER["SERVER_SOFTWARE"] ?? "Unknown",
"memory_usage" => memory_get_usage(), "memory_usage" => memory_get_usage(),
"load_avg" => sys_getloadavg(), "load_avg" => $loadAvg,
"database" => $this->user->getSQL()->getStatus(), "database" => $this->user->getSQL()->getStatus(),
"mail" => $this->user->getConfiguration()->getMail() !== NULL "mail" => $this->user->getConfiguration()->getMail() !== NULL
); );