Prose\UsingSavageD::watchProcessCpu PHP Метод

watchProcessCpu() публичный Метод

public watchProcessCpu ( $processName )
    public function watchProcessCpu($processName)
    {
        // what are we doing?
        $log = usingLog()->startAction("watch the CPU used by the '{$processName}' process on host '{$this->args[0]}'");
        // build the URL
        // where are we doing this?
        $safeProcessName = urlencode($this->args[0] . '.processes.' . $processName);
        $url = $this->getSavagedUrl() . "/process/{$safeProcessName}/cpu";
        // make the request
        usingHttp()->post($url);
        // did it work?
        $response = fromHttp()->get($url);
        expectsHttpResponse($response)->hasStatusCode(200);
        expectsHttpResponse($response)->hasBody('{"monitoring":true}');
        // all done
        $log->endAction();
    }