public function Report::getSymbols in XHProf 8
Parameters
int $length:
Return value
mixed
Overrides ReportInterface::getSymbols
File
- src/
XHProfLib/ Report/ Report.php, line 33
Class
- Report
- Class Report
Namespace
Drupal\xhprof\XHProfLib\ReportCode
public function getSymbols($length = 100) {
if ($length != -1) {
$data = array_slice($this->data, 0, $length);
}
else {
$data = $this->data;
}
$totals = $this
->getTotals();
$symbols = [];
foreach ($data as $key => $value) {
$symbol = [];
$symbol[] = $key;
$symbol[] = $this
->getValue($value['ct'], 'ct');
$symbol[] = $this
->getPercentValue($value['ct'], 'ct', $totals['ct']);
foreach ($this
->getMetrics() as $metric) {
$symbol[] = $this
->getValue($value[$metric], $metric);
$symbol[] = $this
->getPercentValue($value[$metric], $metric, $totals[$metric]);
$symbol[] = $this
->getValue($value['excl_' . $metric], 'excl_' . $metric);
$symbol[] = $this
->getPercentValue($value['excl_' . $metric], 'excl_' . $metric, $totals[$metric]);
}
$symbols[$key] = $symbol;
}
return $symbols;
}