コード例 #1
0
 public function endSuite(SuiteDocument $suiteDocument)
 {
     if ($suiteDocument->hasErrors()) {
         $errorStacks = $suiteDocument->getErrorStacks();
         $this->output->write(PHP_EOL);
         $this->output->writeln(sprintf('%d subjects encountered errors:', count($errorStacks)));
         $this->output->write(PHP_EOL);
         foreach ($errorStacks as $errorStack) {
             $this->output->writeln(sprintf('<error>%s</error>', $errorStack['subject']));
             $this->output->write(PHP_EOL);
             foreach ($errorStack['exceptions'] as $exception) {
                 $this->output->writeln(sprintf('    %s %s', $exception['exception_class'], str_replace("\n", "\n    ", $exception['message'])));
             }
         }
     }
     $this->output->writeln(sprintf('%s subjects, %s iterations, %s revs, %s rejects', $suiteDocument->getNbSubjects(), $suiteDocument->getNbIterations(), $suiteDocument->getNbRevolutions(), $suiteDocument->getNbRejects()));
     $this->output->writeln(sprintf('(best [mean mode] worst) = %s [%s %s] %s (%s)', number_format($this->timeUnit->toDestUnit($suiteDocument->getMinTime()), 3), number_format($this->timeUnit->toDestUnit($suiteDocument->getMeanTime()), 3), number_format($this->timeUnit->toDestUnit($suiteDocument->getModeTime()), 3), number_format($this->timeUnit->toDestUnit($suiteDocument->getMaxTime()), 3), $this->timeUnit->getDestSuffix()));
     $this->output->writeln(sprintf('⅀T: %s μSD/r %s μRSD/r: %s%%', $this->timeUnit->format($suiteDocument->getTotalTime(), null, TimeUnit::MODE_TIME), $this->timeUnit->format($suiteDocument->getMeanStDev(), null, TimeUnit::MODE_TIME), number_format($suiteDocument->getMeanRelStDev(), 3)));
 }
コード例 #2
0
ファイル: PhpBenchLogger.php プロジェクト: stof/phpbench
 public function endSuite(SuiteDocument $suiteDocument)
 {
     $this->output->writeln(sprintf('%s subjects, %s iterations, %s revs, %s rejects', $suiteDocument->getNbSubjects(), $suiteDocument->getNbIterations(), $suiteDocument->getNbRevolutions(), $suiteDocument->getNbRejects()));
     $this->output->writeln(sprintf('min mean max: %s %s %s (%s/r)', number_format($this->timeUnit->value($suiteDocument->getMin()), 3), number_format($this->timeUnit->value($suiteDocument->getMeanTime()), 3), number_format($this->timeUnit->value($suiteDocument->getMax()), 3), $this->timeUnit->getDestSuffix()));
     $this->output->writeln(sprintf('⅀T: %s%s μSD/r %s%s μRSD/r: %s%%', number_format($this->timeUnit->value($suiteDocument->getTotalTime()), 3), $this->timeUnit->getDestSuffix(), number_format($this->timeUnit->value($suiteDocument->getMeanStDev()), 3), $this->timeUnit->getDestSuffix(), number_format($suiteDocument->getMeanRelStDev(), 3)));
 }