Ejemplo n.º 1
0
 /**
  * @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;
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function getInfo()
 {
     return ['Filter' => get_class($this->filter)] + $this->benchmark->getInfo();
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function getInfo()
 {
     return ['Rounds' => $this->rounds] + $this->benchmark->getInfo();
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function getInfo()
 {
     return $this->benchmark->getInfo();
 }