Пример #1
0
 public function benchmarkStart(Benchmark $benchmark)
 {
     static $first = true;
     if ($this->showBench) {
         // do not output a line break on the first run
         if (false === $first) {
             $this->output->writeln('');
         }
         $first = false;
         $this->output->writeln($benchmark->getClassFqn());
     }
 }
Пример #2
0
 private function run(Benchmark $benchmark, \DOMElement $benchmarkEl)
 {
     foreach ($benchmark->getSubjects() as $subject) {
         $subjectEl = $benchmarkEl->ownerDocument->createElement('subject');
         $subjectEl->setAttribute('name', $subject->getMethodName());
         foreach ($subject->getGroups() as $group) {
             $groupEl = $benchmarkEl->ownerDocument->createElement('group');
             $groupEl->setAttribute('name', $group);
             $subjectEl->appendChild($groupEl);
         }
         $this->logger->subjectStart($subject);
         $this->runSubject($subject, $subjectEl);
         $this->logger->subjectEnd($subject);
         $benchmarkEl->appendChild($subjectEl);
     }
 }