summaryrefslogtreecommitdiff
path: root/maintenance/stats.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-02-22 13:37:51 +0100
committerPierre Schmitz <pierre@archlinux.de>2009-02-22 13:37:51 +0100
commitb9b85843572bf283f48285001e276ba7e61b63f6 (patch)
tree4c6f4571552ada9ccfb4030481dcf77308f8b254 /maintenance/stats.php
parentd9a20acc4e789cca747ad360d87ee3f3e7aa58c1 (diff)
updated to MediaWiki 1.14.0
Diffstat (limited to 'maintenance/stats.php')
-rw-r--r--maintenance/stats.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/maintenance/stats.php b/maintenance/stats.php
index 9c16e12d..00f79ded 100644
--- a/maintenance/stats.php
+++ b/maintenance/stats.php
@@ -11,11 +11,13 @@ require_once('commandLine.inc');
if( get_class( $wgMemc ) == 'FakeMemCachedClient' ) {
die("You are running FakeMemCachedClient, I can not provide any statistics.\n");
}
-
-print "Requests\n";
$session = intval($wgMemc->get(wfMemcKey('stats','request_with_session')));
$noSession = intval($wgMemc->get(wfMemcKey('stats','request_without_session')));
$total = $session + $noSession;
+if ( $total == 0 ) {
+ die("You either have no stats or memcached isn't running. Aborting.\n");
+}
+print "Requests\n";
printf( "with session: %-10d %6.2f%%\n", $session, $session/$total*100 );
printf( "without session: %-10d %6.2f%%\n", $noSession, $noSession/$total*100 );
printf( "total: %-10d %6.2f%%\n", $total, 100 );