From: Mr. E23 Date: Tue, 18 Nov 2003 23:49:11 +0000 (+0000) Subject: Added feature for limiting profiling to every n requests X-Git-Tag: 1.1.0~141 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/%7B%7B%20url_for%28%27user_settings%27%2C%20userid=session.user.id%29%20%7D%7D?a=commitdiff_plain;h=43ffa41ad6785063e3630a016dffbb0b3047c81f;p=lhc%2Fweb%2Fwiklou.git Added feature for limiting profiling to every n requests --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index f662db5757..99a60f9467 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -130,10 +130,10 @@ $wgUseTeX = false; $wgProfiling = false; # Enable for more detailed by-function times in debug log $wgProfileLimit = 0.0; # Only record profiling info for pages that took longer than this $wgProfileOnly = false; # Don't put non-profiling info into log file +$wgProfileSampleRate = 1; # Only profile every n requests when profiling is turned on $wgDebugProfiling = false; # Detects non-matching wfProfileIn/wfProfileOut calls $wgDebugFunctionEntry = 0; # Output debug message on every wfProfileIn/wfProfileOut - $wgDisableCounters = false; $wgDisableTextSearch = false; $wgDisableSearchUpdate = false; # If you've disabled search semi-permanently, this also disables updates to the table. If you ever re-enable, be sure to rebuild the search table. diff --git a/includes/Setup.php b/includes/Setup.php index c4c1de079c..944c758b33 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -8,7 +8,7 @@ if( !isset( $wgProfiling ) ) $wgProfiling = false; -if ( $wgProfiling ) { +if ( $wgProfiling and (0 == rand() % $wgProfileSampleRate ) ) { include_once( "Profiling.php" ); } else { function wfProfileIn( $fn ) {}