Track which namespaces edit conflicts are resolved in
authoraddshore <addshorewiki@gmail.com>
Thu, 7 Dec 2017 15:39:18 +0000 (16:39 +0100)
committeraddshore <addshorewiki@gmail.com>
Thu, 7 Dec 2017 15:39:18 +0000 (16:39 +0100)
This is similar to the tracking of the occourance of
edit conflicts but tracks the resolution of the conflicts.

Bug: T182011
Change-Id: I9a0c05dc921946fb6e0580b56b663783ca0b1b6e

includes/editpage/TextConflictHelper.php

index b1eaa4b..6e7e7ee 100644 (file)
@@ -140,6 +140,15 @@ class TextConflictHelper {
         */
        public function incrementResolvedStats() {
                $this->stats->increment( 'edit.failures.conflict.resolved' );
+               // Only include 'standard' namespaces to avoid creating unknown numbers of statsd metrics
+               if (
+                       $this->title->getNamespace() >= NS_MAIN &&
+                       $this->title->getNamespace() <= NS_CATEGORY_TALK
+               ) {
+                       $this->stats->increment(
+                               'edit.failures.conflict.resolved.byNamespaceId.' . $this->title->getNamespace()
+                       );
+               }
        }
 
        /**