public function getMemFree(CpuMemDto $cpuMemDto) { $commandsDto = new CommandsExecutionDto(); $commandsDto->setCommandName(CommandsConstants::GET_MEM_FREE); /** * @var CpuMemDto $memoryInfo */ $memoryInfo = $this->getCommandExecutionResult($commandsDto); $cpuMemDto->setMemFree($memoryInfo->getMemFree()); return $cpuMemDto; }
protected static function getMemFree() { $cpuMemDto = new CpuMemDto(); $cpuMemDto->setMemFree((int) `grep 'MemFree' /proc/meminfo | awk '{printf("%-8s",\$2)}'`); return $cpuMemDto; }