Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/284121
Change subject: Segment stash edit cache stats by basis for hit/miss ...................................................................... Segment stash edit cache stats by basis for hit/miss Instead of just counting cache hits and misses, segment the counts by reason, so we can differentiate (for example) timestamp-based cache hits from staleness-check-survivor cache hits. I want this data so I can determine whether increasing the cutoff for timestamp-based hits from 3 to 5 seconds has a substantial enough impact to warrant the slightly weaker consistency. Also changed 'cache-hit' to 'cache_hit'. MediaWiki normalizes the dash to an underscore anyway, but the normalization is there for dynamically-constructed key names (or name segments). In the case of hard-coded values, it is desirable for the code to be as close as possible to the final form of the metric name, to simplify metric lookup. Change-Id: I0cd61da9746e3ca3695e23200f698b8b1371798c (cherry picked from commit 0f1ffa4da707217ab2dc1efae68c8ced24500548) --- M includes/api/ApiStashEdit.php 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/21/284121/1 diff --git a/includes/api/ApiStashEdit.php b/includes/api/ApiStashEdit.php index 3c02c9c..cc8e390 100644 --- a/includes/api/ApiStashEdit.php +++ b/includes/api/ApiStashEdit.php @@ -272,18 +272,18 @@ } $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 @@ } 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 @@ } 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; -- To view, visit https://gerrit.wikimedia.org/r/284121 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0cd61da9746e3ca3695e23200f698b8b1371798c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.27.0-wmf.21 Gerrit-Owner: Ori.livneh <o...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits