Revert r52336 "Merge maintenance-work branch:"
[lhc/web/wiklou.git] / maintenance / clear_stats.php
1 <?php
2 /**
3 * This script remove all statistics tracking from memcached
4 *
5 * @file
6 * @ingroup Maintenance
7 */
8
9 require_once('commandLine.inc');
10
11 foreach ( $wgLocalDatabases as $db ) {
12 noisyDelete("$db:stats:request_with_session");
13 noisyDelete("$db:stats:request_without_session");
14 noisyDelete("$db:stats:pcache_hit");
15 noisyDelete("$db:stats:pcache_miss_invalid");
16 noisyDelete("$db:stats:pcache_miss_expired");
17 noisyDelete("$db:stats:pcache_miss_absent");
18 noisyDelete("$db:stats:pcache_miss_stub");
19 noisyDelete("$db:stats:image_cache_hit");
20 noisyDelete("$db:stats:image_cache_miss");
21 noisyDelete("$db:stats:image_cache_update");
22 noisyDelete("$db:stats:diff_cache_hit");
23 noisyDelete("$db:stats:diff_cache_miss");
24 noisyDelete("$db:stats:diff_uncacheable");
25 }
26
27 function noisyDelete( $key ) {
28 global $wgMemc;
29 /*
30 print "$key ";
31 if ( $wgMemc->delete($key) ) {
32 print "deleted\n";
33 } else {
34 print "FAILED\n";
35 }*/
36 $wgMemc->delete($key);
37 }
38