Rename some cache keys with odd virtual hierarchies
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 25 Oct 2017 01:42:31 +0000 (18:42 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 25 Oct 2017 01:42:43 +0000 (18:42 -0700)
This makes automatic statsd metrics more useful.

Change-Id: I07d87dcb8ce9b42cc2f1c84ac4c06d177d463b1d

includes/Block.php
includes/page/WikiPage.php
maintenance/populateContentModel.php

index 5a4c43e..8d69d9a 100644 (file)
@@ -709,7 +709,7 @@ class Block {
                // than getting the msg raw and explode()'ing it.
                $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
                $lines = $cache->getWithSetCallback(
-                       $cache->makeKey( 'ipb', 'autoblock', 'whitelist' ),
+                       $cache->makeKey( 'ip-autoblock', 'whitelist' ),
                        $cache::TTL_DAY,
                        function ( $curValue, &$ttl, array &$setOpts ) {
                                $setOpts += Database::getCacheSetOptions( wfGetDB( DB_REPLICA ) );
index e875df5..aa26105 100644 (file)
@@ -512,7 +512,7 @@ class WikiPage implements Page, IDBAccessObject {
                        $cache = ObjectCache::getMainWANInstance();
 
                        return $cache->getWithSetCallback(
-                               $cache->makeKey( 'page', 'content-model', $this->getLatest() ),
+                               $cache->makeKey( 'page-content-model', $this->getLatest() ),
                                $cache::TTL_MONTH,
                                function () {
                                        $rev = $this->getRevision();
index 74a918a..d99f70a 100644 (file)
@@ -69,7 +69,7 @@ class PopulateContentModel extends Maintenance {
        }
 
        protected function clearCache( $page_id, $rev_id ) {
-               $contentModelKey = $this->wanCache->makeKey( 'page', 'content-model', $rev_id );
+               $contentModelKey = $this->wanCache->makeKey( 'page-content-model', $rev_id );
                $revisionKey =
                        $this->wanCache->makeGlobalKey( 'revision', $this->wikiId, $page_id, $rev_id );