/** * Starts profiling. * * @return \Jyxo\Rpc\Client */ protected function profileStart() { // Set start time if ($this->profiler) { $this->timer = \Jyxo\Timer::start(); } return $this; }
/** * Runs a single test. * * @param string $ident Test identifier * @return array * @throws \UnexpectedValueException If the test returned an unknown result value */ private function runTest(string $ident) : array { // Runs the test $timer = \Jyxo\Timer::start(); $result = $this->tests[$ident]->run(); if (!$result instanceof \Jyxo\Beholder\Result) { throw new \UnexpectedValueException(sprintf('Result %s of the test %s is not a %s instance.', $result, $ident, \Jyxo\Beholder\Result::class)); } // Returns result data return ['ident' => $ident, 'test' => $this->tests[$ident], 'result' => $result, 'duration' => \Jyxo\Timer::stop($timer)]; }