Almost completed the new profiling tool. Just a bit more tweaking :-)

This commit is contained in:
nicolasconnault 2007-03-20 02:59:34 +00:00
parent c0aa9f0956
commit 6fc4ad7243
3 changed files with 355 additions and 18 deletions

View file

@ -15,7 +15,7 @@
*/
function init_performance_info() {
global $PERF;
global $PERF, $CFG, $USER;
$PERF = new Object;
$PERF->dbqueries = 0;
@ -31,8 +31,12 @@ function init_performance_info() {
}
if (function_exists('apd_set_pprof_trace')) {
// APD profiling
apd_set_pprof_trace();
$PERF->process = 44444;
if ($USER->id > 0 && $CFG->perfdebug >= 15) {
$tempdir = $CFG->dataroot . '/temp/profile/' . $USER->id;
mkdir($tempdir);
apd_set_pprof_trace($tempdir);
$PERF->profiling = true;
}
}
}