Count the number of EditPage edit conflicts
authoraddshore <addshorewiki@gmail.com>
Wed, 27 Jan 2016 16:11:52 +0000 (17:11 +0100)
committerTim Starling <tstarling@wikimedia.org>
Thu, 28 Jan 2016 00:38:12 +0000 (00:38 +0000)
edit.failures.* is already used for:
 - session_loss
 - bad_token
 - incomplete_form
hence the choice of metric name.

Bug: T120462
Change-Id: I7636cedaf3d589faec3153882f7d1e8ac7054a89

includes/EditPage.php

index 47912cb..277a6cc 100644 (file)
@@ -3457,6 +3457,9 @@ HTML
                global $wgOut;
 
                if ( Hooks::run( 'EditPageBeforeConflictDiff', array( &$this, &$wgOut ) ) ) {
+                       $stats = $wgOut->getContext()->getStats();
+                       $stats->increment( 'edit.failures.conflict' );
+
                        $wgOut->wrapWikiMsg( '<h2>$1</h2>', "yourdiff" );
 
                        $content1 = $this->toEditContent( $this->textbox1 );