From aed94cf1113e8a4190222775c4b1ccd5f14fdf41 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 8 May 2015 12:08:15 -0700 Subject: [PATCH] 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 --- includes/profiler/TransactionProfiler.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ) { -- 2.20.1