diff --git a/app/Console/Commands/Cluster/Work.php b/app/Console/Commands/Cluster/Work.php index 744e1be..ff327a9 100644 --- a/app/Console/Commands/Cluster/Work.php +++ b/app/Console/Commands/Cluster/Work.php @@ -90,12 +90,10 @@ private function report(): void $this->info('正在报告此系统,请保持此命令一直运行。'); $cpu = $this->getCpuUsage(); - $memory = $this->getMemoryUsage(); while (1) { Cluster::publish('system_usage', [ 'cpu' => $cpu, - 'memory' => $memory, ]); sleep(1); @@ -108,29 +106,4 @@ private function getCpuUsage(): float $cpu = sys_getloadavg(); return $cpu[0]; } - - private function getMemoryUsage(): float - { - // 检查 free 命令是否存在 - if (exec('which free')) { - $free = exec('free'); - } else { - - // fake free - $free = <<