From 626c5f69723c328db92817775e2eae94e56c7b5c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 20 Jun 2018 12:43:10 +0100 Subject: [PATCH] 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 --- includes/libs/objectcache/WANObjectCache.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } -- 2.20.1