From 43ffa41ad6785063e3630a016dffbb0b3047c81f Mon Sep 17 00:00:00 2001 From: "Mr. E23" Date: Tue, 18 Nov 2003 23:49:11 +0000 Subject: [PATCH] Added feature for limiting profiling to every n requests --- includes/DefaultSettings.php | 2 +- includes/Setup.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 ) {} -- 2.20.1