/** * {@inheritdoc} */ public function benchmark(Target $target, Test $test) { if (!$this->filter->isAccepted($test)) { throw new TestSkippedException($test); } return $this->benchmark->benchmark($target, $test); }
/** * {@inheritdoc} */ public function benchmark(Target $target, Test $test) { $result = $this->benchmark->benchmark($target, $test); $trace = $this->trace; $trace($result, $test); return $result; }
/** * {@inheritdoc} */ public function benchmark(Target $target, Test $test) { $sum = 0; for ($i = $this->rounds; $i; $i--) { $sum += $this->benchmark->benchmark($target, $test); } return $sum / $this->rounds; }
/** * @param Benchmark $benchmark * @param Target[] $targets * * @return array */ public function run(Benchmark $benchmark, array $targets) { $this->writer->open($benchmark->getInfo(), $targets); $result = []; foreach ($this->testData as $row) { $test = new Test($row[0], $row[1], $row[2]); $stats = []; foreach ($targets as $target) { try { $stats[$target->getName()] = $benchmark->benchmark($target, $test); } catch (\Exception $e) { $stats[$target->getName()] = $e; } } $result[$test->getName()] = $stats; $this->writer->write($test, $stats); } $this->writer->close(); return $result; }