diff options
author | jokkedk <joakim@jokke.dk> | 2008-03-31 15:05:12 +0000 |
---|---|---|
committer | jokkedk <joakim@jokke.dk> | 2008-03-31 15:05:12 +0000 |
commit | ca7a70e0037a5968110fc50fbd5a3d98cf706808 (patch) | |
tree | 9b1ad4bc545ffecec02c7a93e8928d67cb6576ba | |
parent | 7db79f7b5c4f0e1764aa47262fbf9eaf27540434 (diff) | |
download | webgrind-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.php | 10 | ||||
-rw-r--r-- | templates/index.phtml | 4 |
2 files changed, 10 insertions, 4 deletions
@@ -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"> |