From: Aaron Schulz Date: Wed, 20 Jun 2018 11:43:10 +0000 (+0100) Subject: objectcache: change "miss" to "renew" in metric name for preemptive refreshes X-Git-Tag: 1.34.0-rc.0~5010^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=626c5f69723c328db92817775e2eae94e56c7b5c;p=lhc%2Fweb%2Fwiklou.git objectcache: change "miss" to "renew" in metric name for preemptive refreshes This will usually let one distinguish asynchronous preemptive cache refreshes from synchronous value recomputations due to actual cache misses. Change-Id: I3424a89cc96a12fe283460eeaf722ee0cf299534 --- diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index 927a1e30b1..0913322bfd 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -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; }