forked from tmaiaroto/li3_perf
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/tmaiaroto/li3_perf
- Loading branch information
Showing
20 changed files
with
1,318 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
/** | ||
* See Webgrind_Config::$_defaults in 'library/Config.php' | ||
* for complete list of options | ||
*/ | ||
|
||
return array( | ||
'checkVersion' => false, | ||
'defaultTimezone' => 'Europe/Kiev', | ||
'defaultCostformat' => 'usec', | ||
'defaultFunctionPercentage' => 100 | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
/** | ||
* @author Jacob Oettinger | ||
* @author Joakim Nygård | ||
*/ | ||
|
||
require './library/common.php'; | ||
|
||
|
||
switch(get('op')) { | ||
case 'fileviewer': | ||
$file = get('file'); | ||
$line = get('line'); | ||
|
||
if ($file && $file != '') { | ||
$message = ''; | ||
if (!file_exists($file)) { | ||
$message = $file.' does not exist.'; | ||
} elseif (!is_readable($file)) { | ||
$message = $file.' is not readable.'; | ||
} elseif (is_dir($file)) { | ||
$message = $file.' is a directory.'; | ||
} | ||
} else { | ||
$message = 'No file to view'; | ||
} | ||
require 'templates/fileviewer.phtml'; | ||
break; | ||
|
||
case 'function_graph': | ||
$dataFile = get('dataFile'); | ||
$showFraction = 100 - intval(get('showFraction') * 100); | ||
|
||
if ($dataFile == '0') { | ||
$files = Webgrind_FileHandler::getInstance()->getTraceList(1); | ||
$dataFile = $files[0]['filename']; | ||
} | ||
|
||
if (!is_executable(Webgrind::$config->pythonExecutable)) { | ||
die("can't find python interpreter"); | ||
} | ||
|
||
if (!is_executable(Webgrind::$config->dotExecutable)) { | ||
die("can't find drawing tool"); | ||
} | ||
|
||
$filename = Webgrind::$config->storageDir.'/'.$dataFile.'-'.$showFraction.Webgrind::$config->preprocessedSuffix.'.png'; | ||
if (!file_exists($filename)) { | ||
if (!createGraph( | ||
Webgrind::$config->xdebugOutputDir.'/'.$dataFile, | ||
$filename, | ||
$showFraction | ||
)) { | ||
die("can't generate graph"); | ||
} | ||
} | ||
|
||
header("Content-Type: image/png"); | ||
readfile($filename); | ||
break; | ||
|
||
default: | ||
$welcome = ''; | ||
$storageDir = Webgrind::$config->storageDir; | ||
$xdebugOutputDir = Webgrind::$config->xdebugOutputDir; | ||
|
||
if (!file_exists($storageDir) || !is_writable($storageDir)) { | ||
$welcome .= "Webgrind storageDir ${storageDir} does not exist or is not writeable.<br>"; | ||
} | ||
if (!file_exists($xdebugOutputDir) || !is_readable($xdebugOutputDir)) { | ||
$welcome .= "Webgrind profilerDir ${xdebugOutputDir} does not exist or is not readable.<br>"; | ||
} | ||
|
||
if ($welcome == '') { | ||
$welcome = "Select a cachegrind file above<br>(looking in <code>${xdebugOutputDir}</code> for files matching <code>". | ||
Webgrind::$config->xdebugOutputFormat.'</code>)'; | ||
} | ||
require 'templates/index.phtml'; | ||
} |
Oops, something went wrong.