X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/mediawiki.git/blobdiff_plain/8989532d3de45b196373107c7a812a68ac0ff2d9..d75ce11339b35963b5f8c3d53190819c1c025716:/maintenance/clear_stats.php diff --git a/maintenance/clear_stats.php b/maintenance/clear_stats.php index 4cacd74c..6a6a4981 100644 --- a/maintenance/clear_stats.php +++ b/maintenance/clear_stats.php @@ -1,38 +1,53 @@ mDescription = "Remove all statistics tracking from the cache"; + } -function noisyDelete( $key ) { - global $wgMemc; - /* - print "$key "; - if ( $wgMemc->delete($key) ) { - print "deleted\n"; - } else { - print "FAILED\n"; - }*/ - $wgMemc->delete($key); + public function execute() { + global $wgLocalDatabases, $wgMemc; + foreach ( $wgLocalDatabases as $db ) { + $wgMemc->delete("$db:stats:request_with_session"); + $wgMemc->delete("$db:stats:request_without_session"); + $wgMemc->delete("$db:stats:pcache_hit"); + $wgMemc->delete("$db:stats:pcache_miss_invalid"); + $wgMemc->delete("$db:stats:pcache_miss_expired"); + $wgMemc->delete("$db:stats:pcache_miss_absent"); + $wgMemc->delete("$db:stats:pcache_miss_stub"); + $wgMemc->delete("$db:stats:image_cache_hit"); + $wgMemc->delete("$db:stats:image_cache_miss"); + $wgMemc->delete("$db:stats:image_cache_update"); + $wgMemc->delete("$db:stats:diff_cache_hit"); + $wgMemc->delete("$db:stats:diff_cache_miss"); + $wgMemc->delete("$db:stats:diff_uncacheable"); + } + } } +$maintClass = "clear_stats"; +require_once( DO_MAINTENANCE );