class XHProfDiffParser in XHProf 7
Same name and namespace in other branches
- 6 XHProfLib/XHProfDiffParser.php \XHProfDiffParser
Hierarchy
- class \XHProfDiffParser
Expanded class hierarchy of XHProfDiffParser
File
- XHProfLib/XHProfDiffParser.php, line 3 
View source
class XHProfDiffParser {
  public $parser1;
  public $parser2;
  public $totals = array();
  public $symbol_totals = array();
  public function __construct($data1, $data2) {
    $this->data = $data;
    $this->parser1 = new XHProfParser($data1);
    $this->parser2 = new XHProfParser($data2);
    $this->parser1
      ->getTotals();
    $this->parser2
      ->getTotals();
  }
  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;
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| XHProfDiffParser:: | public | property | ||
| XHProfDiffParser:: | public | property | ||
| XHProfDiffParser:: | public | property | ||
| XHProfDiffParser:: | public | property | ||
| XHProfDiffParser:: | public | function | ||
| XHProfDiffParser:: | public | function | 
