getFunctionCount() public method

Get the total number of tracked function calls in this run.
public getFunctionCount ( ) : integer
return integer
Beispiel #1
0
 public function testGetFunctionCount()
 {
     $fixture = $this->_fixture[0];
     $profile = new Xhgui_Profile($fixture);
     $this->assertEquals(11, $profile->getFunctionCount());
 }
Beispiel #2
0
 /**
  * Compare this run to another run.
  *
  * @param Xhgui_Profile $head The other run to compare with
  * @return array An array of comparison data.
  */
 public function compare(Xhgui_Profile $head)
 {
     $this->calculateSelf();
     $head->calculateSelf();
     $keys = array_merge($this->_keys, $this->_exclusiveKeys);
     $emptyData = array_fill_keys($keys, 0);
     $diffPercent = array();
     $diff = array();
     foreach ($this->_collapsed as $key => $baseData) {
         $headData = $head->get($key);
         if (!$headData) {
             $diff[$key] = $this->_diffKeys($emptyData, $baseData);
             continue;
         }
         $diff[$key] = $this->_diffKeys($headData, $baseData);
         if ($key === 'main()') {
             $diffPercent[$key] = $this->_diffPercentKeys($headData, $baseData);
         }
     }
     $diff['functionCount'] = $head->getFunctionCount() - $this->getFunctionCount();
     $diffPercent['functionCount'] = $head->getFunctionCount() / $this->getFunctionCount();
     return array('base' => $this, 'head' => $head, 'diff' => $diff, 'diffPercent' => $diffPercent);
 }