From: Aaron Schulz Date: Fri, 8 May 2015 19:08:15 +0000 (-0700) Subject: Include transaction details log entry for trx write time violations X-Git-Tag: 1.31.0-rc.0~11448^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=aed94cf1113e8a4190222775c4b1ccd5f14fdf41;p=lhc%2Fweb%2Fwiklou.git Include transaction details log entry for trx write time violations * This makes it possible to see what is being done by matching the trx IDs of the (normally) adjacent log entries Change-Id: I515de99acfe159856930d8e259c00eb744f43213 --- diff --git a/includes/profiler/TransactionProfiler.php b/includes/profiler/TransactionProfiler.php index 3f4d58b5d1..46d6119ba9 100644 --- a/includes/profiler/TransactionProfiler.php +++ b/includes/profiler/TransactionProfiler.php @@ -254,10 +254,14 @@ class TransactionProfiler implements LoggerAwareInterface { $this->logger->info( "Detected no transaction for '$name' - out of sync." ); return; } + + $slow = false; + // Warn if too much time was spend writing... if ( $writeTime > $this->expect['writeQueryTime'] ) { $this->reportExpectationViolated( 'writeQueryTime', "[transaction $id writes to {$server} ({$db})]" ); + $slow = true; } // Fill in the last non-query period... $lastQuery = end( $this->dbTrxMethodTimes[$name] ); @@ -269,7 +273,6 @@ class TransactionProfiler implements LoggerAwareInterface { } } // Check for any slow queries or non-query periods... - $slow = false; foreach ( $this->dbTrxMethodTimes[$name] as $info ) { $elapsed = ( $info[2] - $info[1] ); if ( $elapsed >= $this->dbLockThreshold ) {