Expand MediaWiki::main() $wgTrxProfilerLimits logging
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 16 Dec 2015 23:19:29 +0000 (15:19 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 16 Dec 2015 23:19:29 +0000 (15:19 -0800)
Remove the filter for basic GET actions.

Change-Id: Iba2b233474321f3d097bf9dfcf90b0feec0312b6

includes/DefaultSettings.php
includes/MediaWiki.php

index 39b133b..f55cb56 100644 (file)
@@ -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,
index bb0f1e4..fe1bb8e 100644 (file)
@@ -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