You are here

public function PerformanceTimingDataCollector::getPanelSummary in Devel 8.3

Same name and namespace in other branches
  1. 8 webprofiler/src/DataCollector/PerformanceTimingDataCollector.php \Drupal\webprofiler\DataCollector\PerformanceTimingDataCollector::getPanelSummary()
  2. 8.2 webprofiler/src/DataCollector/PerformanceTimingDataCollector.php \Drupal\webprofiler\DataCollector\PerformanceTimingDataCollector::getPanelSummary()
  3. 4.x webprofiler/src/DataCollector/PerformanceTimingDataCollector.php \Drupal\webprofiler\DataCollector\PerformanceTimingDataCollector::getPanelSummary()

Returns the string used in vertical tab summary.

Return value

string The panel summary.

Overrides DrupalDataCollectorInterface::getPanelSummary

File

webprofiler/src/DataCollector/PerformanceTimingDataCollector.php, line 50

Class

PerformanceTimingDataCollector
Collects data about frontend performance.

Namespace

Drupal\webprofiler\DataCollector

Code

public function getPanelSummary() {
  if (isset($this->data['performance'])) {
    $performanceData = new PerformanceTimingData($this->data['performance']);
    return $this
      ->t('TTFB: @ttfb', [
      '@ttfb' => sprintf('%.0f ms', $performanceData
        ->getTtfbTiming()),
    ]);
  }
  return NULL;
}