Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/202640
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
Change-Id: I0fe14bcdaebc3568b0cb7af8084b7bfefeb82826
---
M maintenance/Maintenance.php
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/40/202640/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/202640
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: master
Gerrit-Owner: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits