Index: trunk/phase3/maintenance/stats.php |
— | — | @@ -11,11 +11,13 @@ |
12 | 12 | if( get_class( $wgMemc ) == 'FakeMemCachedClient' ) { |
13 | 13 | die("You are running FakeMemCachedClient, I can not provide any statistics.\n"); |
14 | 14 | } |
15 | | - |
16 | | -print "Requests\n"; |
17 | 15 | $session = intval($wgMemc->get(wfMemcKey('stats','request_with_session'))); |
18 | 16 | $noSession = intval($wgMemc->get(wfMemcKey('stats','request_without_session'))); |
19 | 17 | $total = $session + $noSession; |
| 18 | +if ( $total == 0 ) { |
| 19 | + die("You either have no stats or memcached isn't running. Aborting."); |
| 20 | +} |
| 21 | +print "Requests\n"; |
20 | 22 | printf( "with session: %-10d %6.2f%%\n", $session, $session/$total*100 ); |
21 | 23 | printf( "without session: %-10d %6.2f%%\n", $noSession, $noSession/$total*100 ); |
22 | 24 | printf( "total: %-10d %6.2f%%\n", $total, 100 ); |