X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FshowCacheStats.php;h=3d16af141d366183532a58cdfd9e568d96c29db6;hb=6b82cb0ddf22395dd01a15df51b12bfe165dd76c;hp=9168d6fccce4a8fe00e1029e8f7182b68fc77762;hpb=c528d00cecf80a498bd751c6cb114475667b5206;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/showCacheStats.php b/maintenance/showCacheStats.php index 9168d6fccc..3d16af141d 100644 --- a/maintenance/showCacheStats.php +++ b/maintenance/showCacheStats.php @@ -46,16 +46,6 @@ class ShowCacheStats extends Maintenance { if ( get_class( $wgMemc ) == 'EmptyBagOStuff' ) { $this->error( "You are running EmptyBagOStuff, I can not provide any statistics.", true ); } - $session = intval( $wgMemc->get( wfMemcKey( 'stats', 'request_with_session' ) ) ); - $noSession = intval( $wgMemc->get( wfMemcKey( 'stats', 'request_without_session' ) ) ); - $total = $session + $noSession; - if ( $total == 0 ) { - $this->error( "You either have no stats or the cache isn't running. Aborting.", true ); - } - $this->output( "Requests\n" ); - $this->output( sprintf( "with session: %-10d %6.2f%%\n", $session, $session / $total * 100 ) ); - $this->output( sprintf( "without session: %-10d %6.2f%%\n", $noSession, $noSession / $total * 100 ) ); - $this->output( sprintf( "total: %-10d %6.2f%%\n", $total, 100 ) ); $this->output( "\nParser cache\n" ); $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_hit' ) ) ); @@ -65,8 +55,16 @@ class ShowCacheStats extends Maintenance { $total = $hits + $expired + $absent + $stub; if ( $total ) { $this->output( sprintf( "hits: %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) ); - $this->output( sprintf( "expired: %-10d %6.2f%%\n", $expired, $expired / $total * 100 ) ); - $this->output( sprintf( "absent: %-10d %6.2f%%\n", $absent, $absent / $total * 100 ) ); + $this->output( sprintf( + "expired: %-10d %6.2f%%\n", + $expired, + $expired / $total * 100 + ) ); + $this->output( sprintf( + "absent: %-10d %6.2f%%\n", + $absent, + $absent / $total * 100 + ) ); $this->output( sprintf( "stub threshold: %-10d %6.2f%%\n", $stub, $stub / $total * 100 ) ); $this->output( sprintf( "total: %-10d %6.2f%%\n", $total, 100 ) ); } else { @@ -80,7 +78,11 @@ class ShowCacheStats extends Maintenance { $total = $hits + $misses; if ( $total ) { $this->output( sprintf( "hits: %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) ); - $this->output( sprintf( "misses: %-10d %6.2f%%\n", $misses, $misses / $total * 100 ) ); + $this->output( sprintf( + "misses: %-10d %6.2f%%\n", + $misses, + $misses / $total * 100 + ) ); $this->output( sprintf( "updates: %-10d\n", $updates ) ); } else { $this->output( "no statistics available\n" ); @@ -93,8 +95,16 @@ class ShowCacheStats extends Maintenance { $total = $hits + $misses + $uncacheable; if ( $total ) { $this->output( sprintf( "hits: %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) ); - $this->output( sprintf( "misses: %-10d %6.2f%%\n", $misses, $misses / $total * 100 ) ); - $this->output( sprintf( "uncacheable: %-10d %6.2f%%\n", $uncacheable, $uncacheable / $total * 100 ) ); + $this->output( sprintf( + "misses: %-10d %6.2f%%\n", + $misses, + $misses / $total * 100 + ) ); + $this->output( sprintf( + "uncacheable: %-10d %6.2f%%\n", + $uncacheable, + $uncacheable / $total * 100 + ) ); } else { $this->output( "no statistics available\n" ); }