Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/174483

Change subject: Avoid sending empty function names to TransactionProfiler
......................................................................

Avoid sending empty function names to TransactionProfiler

* This could happen if the Profiler was a stub

Change-Id: Id4f635f899ee3c0ca85acf1b1e4cde47dcbbdc75
---
M includes/db/Database.php
1 file changed, 8 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/83/174483/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index 2d14bcb..aa0e4de 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -1000,12 +1000,14 @@
                }
 
                # Log the query time and feed it into the DB trx profiler
-               $queryStartTime = microtime( true );
-               $queryProfile = new ScopedCallback( function() use ( 
$queryStartTime, $queryProf ) {
-                       $elapsed = microtime( true ) - $queryStartTime;
-                       $trxProfiler = 
Profiler::instance()->getTransactionProfiler();
-                       $trxProfiler->recordFunctionCompletion( $queryProf, 
$elapsed );
-               } );
+               if ( $queryProf != '' ) {
+                       $queryStartTime = microtime( true );
+                       $queryProfile = new ScopedCallback( function() use ( 
$queryStartTime, $queryProf ) {
+                               $elapsed = microtime( true ) - $queryStartTime;
+                               $trxProfiler = 
Profiler::instance()->getTransactionProfiler();
+                               $trxProfiler->recordFunctionCompletion( 
$queryProf, $elapsed );
+                       } );
+               }
 
                # Do the query and handle errors
                $ret = $this->doQuery( $commentedSql );

-- 
To view, visit https://gerrit.wikimedia.org/r/174483
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4f635f899ee3c0ca85acf1b1e4cde47dcbbdc75
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to