Example #1
0
 private function renderEntries(\DOMNode $trace, $table, array $options, $padding = 0)
 {
     $totalTime = $trace->evaluate('number(/trace/entry[1]/@end-time) - number(/trace/entry[1]/@start-time)') * 1000000.0;
     foreach ($trace->query('./entry') as $entryEl) {
         if (null === $options['filter'] || preg_match('{' . $options['filter'] . '}', $entryEl->getAttribute('function'))) {
             $timeInc = ($entryEl->getAttribute('end-time') - $entryEl->getAttribute('start-time')) * 1000000.0;
             $table->addRow([$entryEl->getAttribute('func_nb'), $entryEl->getAttribute('level'), number_format($entryEl->getAttribute('start-memory')) . 'b', $entryEl->getAttribute('start-time') . 's', $this->timeUnit->format($timeInc, array_merge($this->timeUnit->getDefaultOptions(), ['precision' => 0])), number_format($timeInc / $totalTime * 100, 2), $this->renderFunction($entryEl, $padding, $options), sprintf('%s:%s', str_replace(getcwd(), '.', $entryEl->getAttribute('filename')), $entryEl->getAttribute('line'))]);
         }
         $this->renderEntries($entryEl, $table, $options, $padding + 1);
     }
 }