You are here

public function PerformanceTimingDataCollector::getData in Devel 8.2

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

Return value

mixed

Overrides DrupalDataCollectorInterface::getData

File

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

Class

PerformanceTimingDataCollector
Collects data about frontend performance.

Namespace

Drupal\webprofiler\DataCollector

Code

public function getData() {
  $data = $this->data;
  if (isset($this->data['performance'])) {
    $performanceData = new PerformanceTimingData($this->data['performance']);
    $data['performance']['computed']['DNS lookup time'] = $performanceData
      ->getDNSTiming();
    $data['performance']['computed']['TCP handshake time'] = $performanceData
      ->getTCPTiming();
    $data['performance']['computed']['Time to first byte'] = $performanceData
      ->getTtfbTiming();
    $data['performance']['computed']['Data download time'] = $performanceData
      ->getDataTiming();
    $data['performance']['computed']['DOM building time'] = $performanceData
      ->getDomTiming();
  }
  return $data;
}