From 875342fd7ae2ad8c994a84d883f19f9627f31de8 Mon Sep 17 00:00:00 2001 From: addshore Date: Thu, 14 Jul 2016 16:23:14 +0100 Subject: [PATCH] Count edit conflicts for each namespace separately Bug: T140368 Change-Id: I5591f53063db32b2c74a2f74751d4af0ef5424d7 --- includes/EditPage.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 362f905fd4..fa5c53def1 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3536,13 +3536,12 @@ HTML if ( Hooks::run( 'EditPageBeforeConflictDiff', [ &$this, &$wgOut ] ) ) { $stats = $wgOut->getContext()->getStats(); $stats->increment( 'edit.failures.conflict' ); - if ( $this->mTitle->isTalkPage() ) { - $stats->increment( 'edit.failures.conflict.byType.talk' ); - } else { - $stats->increment( 'edit.failures.conflict.byType.subject' ); - } - if ( $this->mTitle->getNamespace() === NS_PROJECT ) { - $stats->increment( 'edit.failures.conflict.byNamespace.project' ); + // Only include 'standard' namespaces to avoid creating unknown numbers of statsd metrics + if ( + $this->mTitle->getNamespace() >= NS_MAIN && + $this->mTitle->getNamespace() <= NS_CATEGORY_TALK + ) { + $stats->increment( 'edit.failures.conflict.byNamespaceId.' . $this->mTitle->getNamespace() ); } $wgOut->wrapWikiMsg( '

$1

', "yourdiff" ); -- 2.20.1