From: Aaron Schulz Date: Fri, 12 Jul 2019 18:24:51 +0000 (-0700) Subject: objectcache: add regen_walltime metric to WANObjectCache::getWithSetCallback() X-Git-Tag: 1.34.0-rc.0~1004^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=951b3392bf7d2545ad4f90fefc3e3e2f1d0715e0;p=lhc%2Fweb%2Fwiklou.git objectcache: add regen_walltime metric to WANObjectCache::getWithSetCallback() Change-Id: I7918a6ed7a5d3d845c640aeeb78c88f1345f5157 --- diff --git a/includes/libs/objectcache/README.md b/includes/libs/objectcache/README.md index 833c045ac5..42bf6360dd 100644 --- a/includes/libs/objectcache/README.md +++ b/includes/libs/objectcache/README.md @@ -35,6 +35,14 @@ in sending the value to the backend server. * Type: Measure (in milliseconds). * Variable `kClass`: The first part of your cache key. +#### `wanobjectcache.{kClass}.regen_walltime` + +Upon cache miss, this measures the time spent in `WANObjectCache::getWithSetCallback()` +from the start of the callback to right after the new value has been computed. + +* Type: Measure (in milliseconds). +* Variable `kClass`: The first part of your cache key. + #### `wanobjectcache.{kClass}.ck_touch.{result}` Call counter from `WANObjectCache::touchCheckKey()`. diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index 45caa783e1..07e4fadece 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -1423,6 +1423,7 @@ class WANObjectCache implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInt ) { // How long it took to generate the value $walltime = max( $postCallbackTime - $preCallbackTime, 0.0 ); + $this->stats->timing( "wanobjectcache.$kClass.regen_walltime", 1e3 * $walltime ); // If the key is write-holed then use the (volatile) interim key as an alternative if ( $isKeyTombstoned ) { $this->setInterimValue( $key, $value, $lockTSE, $version, $walltime );