Prose\UsingSavageD::watchServerLoadavg PHP Method

watchServerLoadavg() public method

public watchServerLoadavg ( )
    public function watchServerLoadavg()
    {
        // what are we doing?
        $log = usingLog()->startAction("watch the server's load average on host '{$this->args[0]}'");
        // where are we doing this?
        $safeTestName = urlencode($this->args[0] . '.host');
        $url = $this->getSavagedUrl() . "/server/{$safeTestName}/loadavg";
        // 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();
    }