You are here

private function Report::getPercentValue in XHProf 8

Parameters

$value:

$metric:

$totals:

Return value

mixed|string

1 call to Report::getPercentValue()
Report::getSymbols in src/XHProfLib/Report/Report.php

File

src/XHProfLib/Report/Report.php, line 127

Class

Report
Class Report

Namespace

Drupal\xhprof\XHProfLib\Report

Code

private function getPercentValue($value, $metric, $totals) {
  if ($totals == 0) {
    $pct = "N/A%";
  }
  else {
    $format_cbk = ReportConstants::getFormatCbk();
    $pct = call_user_func($format_cbk[$metric . '_perc'], $value / abs($totals));
  }
  return $pct;
}