mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
redirect() - log performance profiling info
Many heavy pages end in a redirect. Log their profiling data! Thanks to Matt Clarkson for spotting the problem.
This commit is contained in:
parent
6b6eea5575
commit
3446daa3da
1 changed files with 8 additions and 0 deletions
|
@ -5467,6 +5467,14 @@ function redirect($url, $message='', $delay=-1) {
|
|||
$message = "<strong>Error output, so disabling automatic redirect.</strong></p><p>" . $message;
|
||||
}
|
||||
|
||||
$performanceinfo = '';
|
||||
if (defined('MDL_PERF') || (!empty($CFG->perfdebug) and $CFG->perfdebug > 7)) {
|
||||
if (defined('MDL_PERFTOLOG')) {
|
||||
$perf = get_performance_info();
|
||||
error_log("PERF: " . $perf['txt']);
|
||||
}
|
||||
}
|
||||
|
||||
/// when no message and header printed yet, try to redirect
|
||||
if (empty($message) and !defined('HEADER_PRINTED')) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue