From 67f74dcdb26dc0bf920b5c4f6c29622f92d1bbdf Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 18 Jun 2016 11:24:01 -0700 Subject: [PATCH] Add statsd logging of DeferredUpdates Bug: T137326 Change-Id: Icce439210c6412c1824d8d5c411880825bb05643 --- includes/deferred/DeferredUpdates.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index e3b75704aa..1552777a80 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -126,8 +126,10 @@ class DeferredUpdates { } public static function execute( array &$queue, $mode ) { - $updates = $queue; // snapshot of queue + $stats = \MediaWiki\MediaWikiServices::getInstance()->getStatsdDataFactory(); + $method = RequestContext::getMain()->getRequest()->getMethod(); + $updates = $queue; // snapshot of queue // Keep doing rounds of updates until none get enqueued while ( count( $updates ) ) { $queue = []; // clear the queue @@ -141,6 +143,7 @@ class DeferredUpdates { } else { $otherUpdates[] = $update; } + $stats->increment( 'deferred_updates.' . $method . '.' . get_class( $update ) ); } // Delegate DataUpdate execution to the DataUpdate class -- 2.20.1