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