Merge "objectcache: change "miss" to "renew" in metric name for preemptive refreshes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 20 Jun 2018 15:42:39 +0000 (15:42 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 20 Jun 2018 15:42:39 +0000 (15:42 +0000)
includes/libs/objectcache/WANObjectCache.php

index 927a1e3..0913322 100644 (file)
@@ -1223,7 +1223,8 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                                }
                                // Use the busy fallback value if nothing else
                                if ( $busyValue !== null ) {
-                                       $this->stats->increment( "wanobjectcache.$kClass.miss.busy" );
+                                       $miss = is_infinite( $minTime ) ? 'renew' : 'miss';
+                                       $this->stats->increment( "wanobjectcache.$kClass.$miss.busy" );
 
                                        return is_callable( $busyValue ) ? $busyValue() : $busyValue;
                                }
@@ -1268,7 +1269,8 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                        $this->cache->changeTTL( self::MUTEX_KEY_PREFIX . $key, (int)$preCallbackTime - 60 );
                }
 
-               $this->stats->increment( "wanobjectcache.$kClass.miss.compute" );
+               $miss = is_infinite( $minTime ) ? 'renew' : 'miss';
+               $this->stats->increment( "wanobjectcache.$kClass.$miss.compute" );
 
                return $value;
        }