You are here

public function XHProfController::symbolAction in XHProf 8

Parameters

\Drupal\xhprof\XHProfLib\Run $run:

$symbol:

Return value

array

1 string reference to 'XHProfController::symbolAction'
xhprof.routing.yml in ./xhprof.routing.yml
xhprof.routing.yml

File

src/Controller/XHProfController.php, line 185

Class

XHProfController
Displays profiling results.

Namespace

Drupal\xhprof\Controller

Code

public function symbolAction(Run $run, $symbol, Request $request) {
  $sort = $request->query
    ->get('sort', 'wt');
  $globalReport = $this->reportEngine
    ->getReport(NULL, NULL, $run, NULL, NULL, $sort, NULL, NULL);
  $report = $this->reportEngine
    ->getReport(NULL, NULL, $run, NULL, [
    $symbol,
  ], $sort, NULL, NULL);
  $build['#title'] = $this
    ->t('XHProf view report for %id', [
    '%id' => $run
      ->getId(),
  ]);
  $descriptions = ReportConstants::getDescriptions();
  $build['title'] = [
    '#type' => 'inline_template',
    '#template' => '<strong>Parent/Child report for ' . $symbol . '</strong>',
  ];
  $build['table'] = [
    '#theme' => 'table',
    '#header' => $this
      ->getRunHeader($report, $descriptions, $run
      ->getId()),
    '#rows' => $this
      ->getRunRows($run, $report, -1, $globalReport, $symbol),
    '#attributes' => [
      'class' => [
        'responsive',
      ],
    ],
    '#attached' => [
      'library' => [
        'xhprof/xhprof',
      ],
    ],
  ];
  return $build;
}