Merge "Fix wrong @return type hints in Language::tsTo… methods"
[lhc/web/wiklou.git] / includes / api / ApiStashEdit.php
index 0d469a7..cc8e390 100644 (file)
@@ -50,7 +50,7 @@ class ApiStashEdit extends ApiBase {
                if ( !ContentHandler::getForModelID( $params['contentmodel'] )
                        ->isSupportedFormat( $params['contentformat'] )
                ) {
-                       $this->dieUsage( "Unsupported content model/format", 'badmodelformat' );
+                       $this->dieUsage( 'Unsupported content model/format', 'badmodelformat' );
                }
 
                // Trim and fix newlines so the key SHA1's match (see RequestContext::getText())
@@ -77,7 +77,7 @@ class ApiStashEdit extends ApiBase {
                                $baseRev->getId()
                        );
                        if ( !$editContent ) {
-                               $this->dieUsage( "Could not merge updated section.", 'replacefailed' );
+                               $this->dieUsage( 'Could not merge updated section.', 'replacefailed' );
                        }
                        if ( $currentRev->getId() == $baseRev->getId() ) {
                                // Base revision was still the latest; nothing to merge
@@ -272,18 +272,18 @@ class ApiStashEdit extends ApiBase {
                        }
 
                        $timeMs = 1000 * max( 0, microtime( true ) - $start );
-                       $stats->timing( 'editstash.lock-wait-time', $timeMs );
+                       $stats->timing( 'editstash.lock_wait_time', $timeMs );
                }
 
                if ( !is_object( $editInfo ) || !$editInfo->output ) {
-                       $stats->increment( 'editstash.cache-misses' );
+                       $stats->increment( 'editstash.cache_misses.no_stash' );
                        $logger->debug( "No cache value for key '$key'." );
                        return false;
                }
 
                $time = wfTimestamp( TS_UNIX, $editInfo->output->getTimestamp() );
                if ( ( time() - $time ) <= 3 ) {
-                       $stats->increment( 'editstash.cache-hits' );
+                       $stats->increment( 'editstash.cache_hits.presumed_fresh' );
                        $logger->debug( "Timestamp-based cache hit for key '$key'." );
                        return $editInfo; // assume nothing changed
                }
@@ -312,7 +312,7 @@ class ApiStashEdit extends ApiBase {
                        }
 
                        if ( $changed || $res->numRows() != $templateUses ) {
-                               $stats->increment( 'editstash.cache-misses' );
+                               $stats->increment( 'editstash.cache_misses.proven_stale' );
                                $logger->info( "Stale cache for key '$key'; template changed." );
                                return false;
                        }
@@ -336,13 +336,13 @@ class ApiStashEdit extends ApiBase {
                        }
 
                        if ( $changed || $res->numRows() != count( $files ) ) {
-                               $stats->increment( 'editstash.cache-misses' );
+                               $stats->increment( 'editstash.cache_misses.proven_stale' );
                                $logger->info( "Stale cache for key '$key'; file changed." );
                                return false;
                        }
                }
 
-               $stats->increment( 'editstash.cache-hits' );
+               $stats->increment( 'editstash.cache_hits.proven_fresh' );
                $logger->debug( "Cache hit for key '$key'." );
 
                return $editInfo;