Addshore has uploaded a new change for review.

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

Change subject: Count edit conflicts for each namespace separately
......................................................................

Count edit conflicts for each namespace separately

Bug: T140368
Change-Id: I5591f53063db32b2c74a2f74751d4af0ef5424d7
(cherry picked from commit 875342fd7ae2ad8c994a84d883f19f9627f31de8)
---
M includes/EditPage.php
1 file changed, 6 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/301356/1

diff --git a/includes/EditPage.php b/includes/EditPage.php
index fa74103..557f298 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -3512,13 +3512,12 @@
                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( '<h2>$1</h2>', "yourdiff" );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5591f53063db32b2c74a2f74751d4af0ef5424d7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.11
Gerrit-Owner: Addshore <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to