MediaWiki  REL1_22
clearCacheStats.php
Go to the documentation of this file.
00001 <?php
00024 require_once __DIR__ . '/Maintenance.php';
00025 
00031 class ClearCacheStats extends Maintenance {
00032 
00033     public function __construct() {
00034         parent::__construct();
00035         $this->mDescription = "Remove all statistics tracking from the cache";
00036     }
00037 
00038     public function execute() {
00039         global $wgLocalDatabases, $wgMemc;
00040         foreach ( $wgLocalDatabases as $db ) {
00041             $wgMemc->delete( "$db:stats:request_with_session" );
00042             $wgMemc->delete( "$db:stats:request_without_session" );
00043             $wgMemc->delete( "$db:stats:pcache_hit" );
00044             $wgMemc->delete( "$db:stats:pcache_miss_expired" );
00045             $wgMemc->delete( "$db:stats:pcache_miss_absent" );
00046             $wgMemc->delete( "$db:stats:pcache_miss_stub" );
00047             $wgMemc->delete( "$db:stats:image_cache_hit" );
00048             $wgMemc->delete( "$db:stats:image_cache_miss" );
00049             $wgMemc->delete( "$db:stats:image_cache_update" );
00050             $wgMemc->delete( "$db:stats:diff_cache_hit" );
00051             $wgMemc->delete( "$db:stats:diff_cache_miss" );
00052             $wgMemc->delete( "$db:stats:diff_uncacheable" );
00053             $wgMemc->delete( "$db:stats:job-insert" );
00054             $wgMemc->delete( "$db:stats:job-pop" );
00055         }
00056     }
00057 }
00058 
00059 $maintClass = "ClearCacheStats";
00060 require_once RUN_MAINTENANCE_IF_MAIN;