summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjokkedk <joakim@jokke.dk>2008-03-31 18:51:19 +0000
committerjokkedk <joakim@jokke.dk>2008-03-31 18:51:19 +0000
commitbe1b565624a19a40ebfdb9e89645a90f087e851e (patch)
tree2e1410fd4db066e163d07dd3de8348e43e9735a4
parentca7a70e0037a5968110fc50fbd5a3d98cf706808 (diff)
downloadwebgrind-be1b565624a19a40ebfdb9e89645a90f087e851e.zip
webgrind-be1b565624a19a40ebfdb9e89645a90f087e851e.tar.gz
webgrind-be1b565624a19a40ebfdb9e89645a90f087e851e.tar.bz2
- Fixed percentage to be based on summary header in Reader
-rw-r--r--index.php9
-rw-r--r--templates/index.phtml2
2 files changed, 4 insertions, 7 deletions
diff --git a/index.php b/index.php
index c08ed05..76980b3 100644
--- a/index.php
+++ b/index.php
@@ -30,14 +30,11 @@ switch(get('op')){
$count = $reader->getFunctionCount();
$functions = array();
$totalCost = array('self' => 0, 'inclusive' => 0);
+ $result['totalRunTime'] = $reader->getHeader('summary');
for($i=0;$i<$count;$i++) {
$functionInfo = $reader->getFunctionInfo($i);
- # Grab {main} inclusive cost as run time
- if (strpos($functionInfo['functionName'], '{main}') !== false)
- $result['totalInclusiveTime'] = $functionInfo['totalInclusiveSelfCost'];
-
if (!(int)get('hideInternals', 0) || strpos($functionInfo['functionName'], 'php::') === false) {
$totalCost['self'] += $functionInfo['totalSelfCost'];
$totalCost['inclusive'] += $functionInfo['totalInclusiveSelfCost'];
@@ -54,14 +51,14 @@ switch(get('op')){
$remainingCost -= $function['totalSelfCost'];
if(get('costFormat')=='percentual'){
$function['totalSelfCost'] = percentCost($function['totalSelfCost'], $totalCost['self']);
- $function['totalInclusiveSelfCost'] = percentCost($function['totalInclusiveSelfCost'], $result['totalInclusiveTime']);
+ $function['totalInclusiveSelfCost'] = percentCost($function['totalInclusiveSelfCost'], $result['totalRunTime']);
}
$result['functions'][] = $function;
if($remainingCost<0)
break;
}
$result['dataFile'] = $dataFile;
- $result['invokeUrl'] = FileHandler::getInstance()->getInvokeUrl(Config::$xdebugOutputDir.$dataFile);
+ $result['invokeUrl'] = $reader->getHeader('cmd');
$result['mtime'] = date(Config::$dateFormat,filemtime(Config::$xdebugOutputDir.$dataFile));
$result['totalSelftime'] = $totalCost['self'];
echo json_encode($result);
diff --git a/templates/index.phtml b/templates/index.phtml
index a5df048..23a1779 100644
--- a/templates/index.phtml
+++ b/templates/index.phtml
@@ -38,7 +38,7 @@
$("#data_file").html(data.dataFile);
$("#invoke_url").html(data.invokeUrl);
$("#mtime").html(data.mtime);
- $("#selfcost_sum").html(data.totalSelftime+"/"+data.totalInclusiveTime);
+ $("#selfcost_sum").html(data.totalSelftime+"/"+data.totalRunTime);
$("#hello_message").hide();
$("#trace_view").show();