From: addshore Date: Thu, 14 Jul 2016 15:23:14 +0000 (+0100) Subject: Count edit conflicts for each namespace separately X-Git-Tag: 1.31.0-rc.0~6272 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%2C%22id_auteur=%24connecte%22%29%20.%20%22?a=commitdiff_plain;h=875342fd7ae2ad8c994a84d883f19f9627f31de8;p=lhc%2Fweb%2Fwiklou.git Count edit conflicts for each namespace separately Bug: T140368 Change-Id: I5591f53063db32b2c74a2f74751d4af0ef5424d7 --- 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" );