Aaron Schulz has uploaded a new change for review.

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

Change subject: Log huge write queries in CLI scripts
......................................................................

Log huge write queries in CLI scripts

* This is already done for web scripts, but with lower limits

Bug: T95382
Change-Id: I0fe14bcdaebc3568b0cb7af8084b7bfefeb82826
(cherry picked from commit ea5f44587a4d554154783f92cde82b7ac919130f)
---
M maintenance/Maintenance.php
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/15/203615/1

diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php
index a0ffcb2..a8dbd5f 100644
--- a/maintenance/Maintenance.php
+++ b/maintenance/Maintenance.php
@@ -38,6 +38,8 @@
 
 $maintClass = false;
 
+use MediaWiki\Logger\LoggerFactory;
+
 /**
  * Abstract maintenance class for quickly writing and churning out
  * maintenance scripts with minimal effort. All that _must_ be defined
@@ -612,6 +614,11 @@
                        $profiler->setTemplated( true );
                        Profiler::replaceStubInstance( $profiler );
                }
+
+               $trxProfiler = Profiler::instance()->getTransactionProfiler();
+               $trxProfiler->setLogger( LoggerFactory::getInstance( 
'DBPerformance' ) );
+               # Catch huge single updates that lead to slave lag
+               $trxProfiler->setExpectation( 'maxAffected', 1000, __METHOD__ );
        }
 
        /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0fe14bcdaebc3568b0cb7af8084b7bfefeb82826
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf1
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