mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Almost completed the new profiling tool. Just a bit more tweaking :-)
This commit is contained in:
parent
c0aa9f0956
commit
6fc4ad7243
3 changed files with 355 additions and 18 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue