X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=maintenance%2Fclear_stats.php;h=4581d5327691d4a8c24ee0e455cc84058a1a678c;hb=f8c494893babe09a207a30a909d482dc610aae9b;hp=4cacd74c3d6e241835cb4e3d9059a343e82db215;hpb=35abc46185b6fcbbf767eafa373b98891476deb6;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/clear_stats.php b/maintenance/clear_stats.php index 4cacd74c3d..4581d53276 100644 --- a/maintenance/clear_stats.php +++ b/maintenance/clear_stats.php @@ -1,38 +1,60 @@ 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_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" ); + $wgMemc->delete( "$db:stats:job-insert" ); + $wgMemc->delete( "$db:stats:job-pop" ); + } + } } +$maintClass = "clear_stats"; +require_once( RUN_MAINTENANCE_IF_MAIN );