Index: trunk/phase3/maintenance/stats.php |
— | — | @@ -26,12 +26,13 @@ |
27 | 27 | |
28 | 28 | public function __construct() { |
29 | 29 | $this->mDescription = "Show statistics from the cache"; |
| 30 | + parent::__construct(); |
30 | 31 | } |
31 | 32 | |
32 | 33 | public function execute() { |
33 | 34 | global $wgMemc; |
34 | | - |
35 | | - // Can't do stats if |
| 35 | + |
| 36 | + // Can't do stats if |
36 | 37 | if ( get_class( $wgMemc ) == 'FakeMemCachedClient' ) { |
37 | 38 | $this->error( "You are running FakeMemCachedClient, I can not provide any statistics.", true ); |
38 | 39 | } |
— | — | @@ -45,8 +46,8 @@ |
46 | 47 | $this->output( sprintf( "with session: %-10d %6.2f%%\n", $session, $session / $total * 100 ) ); |
47 | 48 | $this->output( sprintf( "without session: %-10d %6.2f%%\n", $noSession, $noSession / $total * 100 ) ); |
48 | 49 | $this->output( sprintf( "total: %-10d %6.2f%%\n", $total, 100 ) ); |
49 | | - |
50 | | - |
| 50 | + |
| 51 | + |
51 | 52 | $this->output( "\nParser cache\n" ); |
52 | 53 | $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_hit' ) ) ); |
53 | 54 | $invalid = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_invalid' ) ) ); |
— | — | @@ -60,7 +61,7 @@ |
61 | 62 | $this->output( sprintf( "absent: %-10d %6.2f%%\n", $absent, $absent / $total * 100 ) ); |
62 | 63 | $this->output( sprintf( "stub threshold: %-10d %6.2f%%\n", $stub, $stub / $total * 100 ) ); |
63 | 64 | $this->output( sprintf( "total: %-10d %6.2f%%\n", $total, 100 ) ); |
64 | | - |
| 65 | + |
65 | 66 | $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_hit' ) ) ); |
66 | 67 | $misses = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_miss' ) ) ); |
67 | 68 | $updates = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_update' ) ) ); |
— | — | @@ -69,7 +70,7 @@ |
70 | 71 | $this->output( sprintf( "hits: %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) ); |
71 | 72 | $this->output( sprintf( "misses: %-10d %6.2f%%\n", $misses, $misses / $total * 100 ) ); |
72 | 73 | $this->output( sprintf( "updates: %-10d\n", $updates ) ); |
73 | | - |
| 74 | + |
74 | 75 | $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_cache_hit' ) ) ); |
75 | 76 | $misses = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_cache_miss' ) ) ); |
76 | 77 | $uncacheable = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_uncacheable' ) ) ); |
— | — | @@ -83,7 +84,3 @@ |
84 | 85 | |
85 | 86 | $maintClass = "CacheStats"; |
86 | 87 | require_once( DO_MAINTENANCE ); |
87 | | - |
88 | | - |
89 | | - |
90 | | - |