Track request method in dbperformance.log
authorGilles Dubuc <gdubuc@wikimedia.org>
Mon, 6 Apr 2015 08:40:15 +0000 (10:40 +0200)
committerBryanDavis <bdavis@wikimedia.org>
Mon, 6 Apr 2015 15:13:03 +0000 (15:13 +0000)
This will allow us to avoid needlessly investigating master requests that
only happen on POST (which is already what we want for multi-DC).

Bug: T92357
Change-Id: Ia7437d00f5b89a8e318d85659d60e2f9f9f26149

includes/profiler/TransactionProfiler.php

index baec181..f02d66f 100644 (file)
@@ -263,10 +263,12 @@ class TransactionProfiler implements LoggerAwareInterface {
         * @param string $query
         */
        protected function reportExpectationViolated( $expect, $query ) {
+               global $wgRequest;
+
                $n = $this->expect[$expect];
                $by = $this->expectBy[$expect];
                $this->logger->info(
-                       "Expectation ($expect <= $n) by $by not met:\n$query\n" . wfBacktrace( true )
+                       "[{$wgRequest->getMethod()}] Expectation ($expect <= $n) by $by not met:\n$query\n" . wfBacktrace( true )
                );
        }
 }