summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjokkedk <joakim@jokke.dk>2008-03-31 15:05:12 +0000
committerjokkedk <joakim@jokke.dk>2008-03-31 15:05:12 +0000
commitca7a70e0037a5968110fc50fbd5a3d98cf706808 (patch)
tree9b1ad4bc545ffecec02c7a93e8928d67cb6576ba
parent7db79f7b5c4f0e1764aa47262fbf9eaf27540434 (diff)
downloadwebgrind-ca7a70e0037a5968110fc50fbd5a3d98cf706808.zip
webgrind-ca7a70e0037a5968110fc50fbd5a3d98cf706808.tar.gz
webgrind-ca7a70e0037a5968110fc50fbd5a3d98cf706808.tar.bz2
- Total run times re-added0.4
- Fixed percentage inclusive cost: {main} should be 100% - Dateformat is configurable
-rw-r--r--index.php10
-rw-r--r--templates/index.phtml4
2 files changed, 10 insertions, 4 deletions
diff --git a/index.php b/index.php
index 0b85248..c08ed05 100644
--- a/index.php
+++ b/index.php
@@ -33,6 +33,11 @@ switch(get('op')){
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'];
@@ -49,7 +54,7 @@ switch(get('op')){
$remainingCost -= $function['totalSelfCost'];
if(get('costFormat')=='percentual'){
$function['totalSelfCost'] = percentCost($function['totalSelfCost'], $totalCost['self']);
- $function['totalInclusiveSelfCost'] = percentCost($function['totalInclusiveSelfCost'], $totalCost['inclusive']);
+ $function['totalInclusiveSelfCost'] = percentCost($function['totalInclusiveSelfCost'], $result['totalInclusiveTime']);
}
$result['functions'][] = $function;
if($remainingCost<0)
@@ -57,7 +62,8 @@ switch(get('op')){
}
$result['dataFile'] = $dataFile;
$result['invokeUrl'] = FileHandler::getInstance()->getInvokeUrl(Config::$xdebugOutputDir.$dataFile);
- $result['mtime'] = date('c',filemtime(Config::$xdebugOutputDir.$dataFile));
+ $result['mtime'] = date(Config::$dateFormat,filemtime(Config::$xdebugOutputDir.$dataFile));
+ $result['totalSelftime'] = $totalCost['self'];
echo json_encode($result);
break;
case 'invocation_list':
diff --git a/templates/index.phtml b/templates/index.phtml
index 6387d78..a5df048 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.totalRuntime);
+ $("#selfcost_sum").html(data.totalSelftime+"/"+data.totalInclusiveTime);
$("#hello_message").hide();
$("#trace_view").show();
@@ -166,7 +166,7 @@
</head>
<body>
<div id="head">
- <h1>webgrind<sup style="font-size:10px">v0.3</sup></h1>
+ <h1>webgrind<sup style="font-size:10px">v0.4</sup></h1>
<p>profiling in the browser</p>
</div>
<div id="options">