summaryrefslogtreecommitdiff
path: root/maintenance/showCacheStats.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-12-27 15:41:37 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-12-31 11:43:28 +0100
commitc1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch)
tree2b38796e738dd74cb42ecd9bfd151803108386bc /maintenance/showCacheStats.php
parentb88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff)
Update to MediaWiki 1.24.1
Diffstat (limited to 'maintenance/showCacheStats.php')
-rw-r--r--maintenance/showCacheStats.php41
1 files changed, 25 insertions, 16 deletions
diff --git a/maintenance/showCacheStats.php b/maintenance/showCacheStats.php
index cd9768d4..3d16af14 100644
--- a/maintenance/showCacheStats.php
+++ b/maintenance/showCacheStats.php
@@ -46,17 +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' ) ) );
@@ -66,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 {
@@ -81,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" );
@@ -94,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" );
}