You are here

public function XHProfDiffParser::getDiffTotals in XHProf 7

Same name and namespace in other branches
  1. 6 XHProfLib/XHProfDiffParser.php \XHProfDiffParser::getDiffTotals()

File

XHProfLib/XHProfDiffParser.php, line 17

Class

XHProfDiffParser

Code

public function getDiffTotals() {
  $diff_totals[0] = $this->parser1
    ->getTotals();
  $diff_totals[1] = $this->parser2
    ->getTotals();
  $diff_totals['diff'] = array();
  $diff_totals['diff%'] = array();
  foreach ($diff_totals[0] as $metric => $value) {
    $diff_totals['diff'][$metric] = $diff_totals[1][$metric] - $value;
    $diff_totals['diff%'][$metric] = ($diff_totals[1][$metric] / $value - 1) * 100;
  }
  return $diff_totals;
}