Jarves\Controller\Admin\DashboardWidgets::getCpuUsage PHP Method

getCpuUsage() public method

public getCpuUsage ( )
    public function getCpuUsage()
    {
        $cpuUsage = str_replace(' ', '', `ps -A -o %cpu`);
        $processes = explode("\n", $cpuUsage);
        $cpuUsage = array_sum($processes);
        if (self::getCpuCoreCount()) {
            return $cpuUsage / self::getCpuCoreCount();
        } else {
            return 0;
        }
    }