From ec12adf649b522ea0bbf72833cd109f9c5377302 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 16 Dec 2015 15:19:29 -0800 Subject: [PATCH] Expand MediaWiki::main() $wgTrxProfilerLimits logging Remove the filter for basic GET actions. Change-Id: Iba2b233474321f3d097bf9dfcf90b0feec0312b6 --- includes/DefaultSettings.php | 5 ++++- includes/MediaWiki.php | 10 +++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 39b133b4c8..f55cb56732 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -5527,12 +5527,15 @@ $wgDebugDumpSql = false; * @since 1.26 */ $wgTrxProfilerLimits = array( - // Basic GET and POST requests + // HTTP GET/HEAD requests. + // Master queries should not happen on GET requests 'GET' => array( 'masterConns' => 0, 'writes' => 0, 'readQueryTime' => 5 ), + // HTTP POST requests. + // Master reads and writes will happen for a subset of these. 'POST' => array( 'readQueryTime' => 5, 'writeQueryTime' => 1, diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index bb0f1e4f41..fe1bb8ec4d 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -618,14 +618,10 @@ class MediaWiki { $trxProfiler = Profiler::instance()->getTransactionProfiler(); $trxProfiler->setLogger( LoggerFactory::getInstance( 'DBPerformance' ) ); - // Aside from rollback, master queries should not happen on GET requests. - // Periodic or "in passing" updates on GET should use the job queue. - if ( !$request->wasPosted() - && in_array( $action, array( 'view', 'edit', 'history' ) ) - ) { - $trxProfiler->setExpectations( $wgTrxProfilerLimits['GET'], __METHOD__ ); - } else { + if ( $request->wasPosted() ) { $trxProfiler->setExpectations( $wgTrxProfilerLimits['POST'], __METHOD__ ); + } else { + $trxProfiler->setExpectations( $wgTrxProfilerLimits['GET'], __METHOD__ ); } // If the user has forceHTTPS set to true, or if the user -- 2.20.1