Skip to content
Browse files

redirect() - log performance profiling info

Many heavy pages end in a redirect. Log their profiling data!

Thanks to Matt Clarkson for spotting the problem.
  • Loading branch information...
1 parent cfca081 commit 1ba840fdbba2cb70298bc47a6db33adb7fa21cd2 martinlanghoff committed Sep 12, 2007
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/weblib.php
View
8 lib/weblib.php
@@ -5151,6 +5151,14 @@ function redirect($url, $message='', $delay=-1, $adminroot = '') {
$url = html_entity_decode($encodedurl);
$surl = addslashes($url);
+ $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')) {

0 comments on commit 1ba840f

Please sign in to comment.
Something went wrong with that request. Please try again.