class PerformanceTimingData
Class PerformanceTimingData
Hierarchy
- class \Drupal\webprofiler\Frontend\PerformanceTimingData
Expanded class hierarchy of PerformanceTimingData
1 file declares its use of PerformanceTimingData
- PerformanceTimingDataCollector.php in webprofiler/
src/ DataCollector/ PerformanceTimingDataCollector.php
File
-
webprofiler/
src/ Frontend/ PerformanceTimingData.php, line 8
Namespace
Drupal\webprofiler\FrontendView source
class PerformanceTimingData {
/**
* @var array
*/
private $data;
/**
* @param array $data
*/
public function __construct($data) {
$this->data = $data;
}
/**
* @return int
*/
public function getDNSTiming() {
if (isset($this->data['domainLookupEnd']) && isset($this->data['domainLookupStart'])) {
return $this->data['domainLookupEnd'] - $this->data['domainLookupStart'];
}
else {
return 0;
}
}
/**
* @return int
*/
public function getTCPTiming() {
if (isset($this->data['connectEnd']) && isset($this->data['connectStart'])) {
return $this->data['connectEnd'] - $this->data['connectStart'];
}
else {
return 0;
}
}
/**
* @return int
*/
public function getTtfbTiming() {
if (isset($this->data['responseStart']) && isset($this->data['connectEnd'])) {
return $this->data['responseStart'] - $this->data['connectEnd'];
}
else {
return 0;
}
}
/**
* @return int
*/
public function getDataTiming() {
if (isset($this->data['responseEnd']) && isset($this->data['responseStart'])) {
return $this->data['responseEnd'] - $this->data['responseStart'];
}
else {
return 0;
}
}
/**
* @return int
*/
public function getDomTiming() {
if (isset($this->data['loadEventStart']) && isset($this->data['responseEnd'])) {
return $this->data['loadEventStart'] - $this->data['responseEnd'];
}
else {
return 0;
}
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
PerformanceTimingData::$data | private | property | |
PerformanceTimingData::getDataTiming | public | function | |
PerformanceTimingData::getDNSTiming | public | function | |
PerformanceTimingData::getDomTiming | public | function | |
PerformanceTimingData::getTCPTiming | public | function | |
PerformanceTimingData::getTtfbTiming | public | function | |
PerformanceTimingData::__construct | public | function |