From b31e567b78fdf506b049a40f3e7e825f2c453737 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Wed, 3 Jun 2015 15:38:02 -0700 Subject: [PATCH] hierarchicalize(!) stat names Graphite expects name components to be dot-separated, so our habit of using dashes doesn't really make sense. Change metric names to be more compatible with Graphite, except the job queue's, since that will require a gdash dashboard definition migration. Change-Id: I77d0ff7606a8fc88434e4352d23415a9a8f4725a --- includes/db/LoadMonitor.php | 4 ++-- includes/diff/DifferenceEngine.php | 8 ++++---- includes/filerepo/file/LocalFile.php | 4 ++-- includes/page/WikiPage.php | 2 +- includes/parser/ParserCache.php | 14 +++++++------- includes/resourceloader/ResourceLoader.php | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/includes/db/LoadMonitor.php b/includes/db/LoadMonitor.php index 3d853cbd85..8c4d0ed2b7 100644 --- a/includes/db/LoadMonitor.php +++ b/includes/db/LoadMonitor.php @@ -109,9 +109,9 @@ class LoadMonitorMySQL implements LoadMonitor { return $times; } - wfIncrStats( 'lag_cache_miss_expired' ); + wfIncrStats( 'lag_cache.miss.expired' ); } else { - wfIncrStats( 'lag_cache_miss_absent' ); + wfIncrStats( 'lag_cache.miss.absent' ); } # Cache key missing or expired diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 2c63dfb525..07a0522135 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -714,7 +714,7 @@ class DifferenceEngine extends ContextSource { if ( !$this->mRefreshCache ) { $difftext = $wgMemc->get( $key ); if ( $difftext ) { - wfIncrStats( 'diff_cache_hit' ); + wfIncrStats( 'diff_cache.hit' ); $difftext = $this->localiseLineNumbers( $difftext ); $difftext .= "\n\n"; @@ -734,12 +734,12 @@ class DifferenceEngine extends ContextSource { // Save to cache for 7 days if ( !Hooks::run( 'AbortDiffCache', array( &$this ) ) ) { - wfIncrStats( 'diff_uncacheable' ); + wfIncrStats( 'diff_cache.uncacheable' ); } elseif ( $key !== false && $difftext !== false ) { - wfIncrStats( 'diff_cache_miss' ); + wfIncrStats( 'diff_cache.miss' ); $wgMemc->set( $key, $difftext, 7 * 86400 ); } else { - wfIncrStats( 'diff_uncacheable' ); + wfIncrStats( 'diff_cache.uncacheable' ); } // Replace line numbers with the text in the user's language if ( $difftext !== false ) { diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index b763c8d899..6abe00cb7f 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -269,9 +269,9 @@ class LocalFile extends File { } if ( $this->dataLoaded ) { - wfIncrStats( 'image_cache_hit' ); + wfIncrStats( 'image_cache.hit' ); } else { - wfIncrStats( 'image_cache_miss' ); + wfIncrStats( 'image_cache.miss' ); } return $this->dataLoaded; diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 1fd22cf8e7..59e8731072 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1111,7 +1111,7 @@ class WikiPage implements Page, IDBAccessObject { $useParserCache = $this->isParserCacheUsed( $parserOptions, $oldid ); wfDebug( __METHOD__ . ': using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" ); if ( $parserOptions->getStubThreshold() ) { - wfIncrStats( 'pcache_miss_stub' ); + wfIncrStats( 'pcache.miss.stub' ); } if ( $useParserCache ) { diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index 131b7b5328..98d3f7f03e 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -143,13 +143,13 @@ class ParserCache { $optionsKey = $this->mMemc->get( $this->getOptionsKey( $article ) ); if ( $optionsKey != false ) { if ( !$useOutdated && $optionsKey->expired( $article->getTouched() ) ) { - wfIncrStats( "pcache_miss_expired" ); + wfIncrStats( "pcache.miss.expired" ); $cacheTime = $optionsKey->getCacheTime(); wfDebug( "Parser options key expired, touched " . $article->getTouched() . ", epoch $wgCacheEpoch, cached $cacheTime\n" ); return false; } elseif ( $optionsKey->isDifferentRevision( $article->getLatest() ) ) { - wfIncrStats( "pcache_miss_revid" ); + wfIncrStats( "pcache.miss.revid" ); $revId = $article->getLatest(); $cachedRevId = $optionsKey->getCacheRevisionId(); wfDebug( "ParserOutput key is for an old revision, latest $revId, cached $cachedRevId\n" ); @@ -195,14 +195,14 @@ class ParserCache { $parserOutputKey = $this->getKey( $article, $popts, $useOutdated ); if ( $parserOutputKey === false ) { - wfIncrStats( 'pcache_miss_absent' ); + wfIncrStats( 'pcache.miss.absent' ); return false; } $value = $this->mMemc->get( $parserOutputKey ); if ( !$value ) { wfDebug( "ParserOutput cache miss.\n" ); - wfIncrStats( "pcache_miss_absent" ); + wfIncrStats( "pcache.miss.absent" ); return false; } @@ -214,19 +214,19 @@ class ParserCache { $value->setEditSectionTokens( $popts->getEditSection() ); if ( !$useOutdated && $value->expired( $touched ) ) { - wfIncrStats( "pcache_miss_expired" ); + wfIncrStats( "pcache.miss.expired" ); $cacheTime = $value->getCacheTime(); wfDebug( "ParserOutput key expired, touched $touched, " . "epoch $wgCacheEpoch, cached $cacheTime\n" ); $value = false; } elseif ( $value->isDifferentRevision( $article->getLatest() ) ) { - wfIncrStats( "pcache_miss_revid" ); + wfIncrStats( "pcache.miss.revid" ); $revId = $article->getLatest(); $cachedRevId = $value->getCacheRevisionId(); wfDebug( "ParserOutput key is for an old revision, latest $revId, cached $cachedRevId\n" ); $value = false; } else { - wfIncrStats( "pcache_hit" ); + wfIncrStats( "pcache.hit" ); } return $value; diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index b4b5a2e2c2..9970a89ac5 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -200,12 +200,12 @@ class ResourceLoader { $cache = wfGetCache( CACHE_ANYTHING ); $cacheEntry = $cache->get( $key ); if ( is_string( $cacheEntry ) ) { - wfIncrStats( "rl-$filter-cache-hits" ); + wfIncrStats( "resourceloader_cache.$filter.hit" ); return $cacheEntry; } $result = ''; try { - wfIncrStats( "rl-$filter-cache-misses" ); + wfIncrStats( "resourceloader_cache.$filter.miss" ); $result = $this->applyFilter( $filter, $data ); if ( $options['cacheReport'] ) { $result .= "\n/* cache key: $key */"; -- 2.20.1