From 4f5acc3a04998523407f3ff7e9b396766afa794b Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Thu, 5 Jan 2023 01:51:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E4=B8=8D=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5=20=E5=86=85=E5=AD=98=20=E4=BD=BF=E7=94=A8=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Cluster/Work.php | 27 --------------------------- 1 file changed, 27 deletions(-) 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 = <<