Cleanup to statistics:
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 23 Jan 2012 16:27:13 +0000 (16:27 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 23 Jan 2012 16:27:13 +0000 (16:27 +0000)
* Removed 'pcache_miss_invalid' from stats.php and clear_stats.php, no longer used
* Added missing 'job-insert' and 'job-pop' to clear_stats.php
* Added missing call to wfIncrStats( 'pcache_miss_absent' ) when there's no key in ParserCacge::get()
* Removed useless 'pcache_not_possible' stat from OutputPage::addWikiTextTitle() since that function is mostly used for interface messages

includes/OutputPage.php
includes/parser/ParserCache.php
maintenance/clear_stats.php
maintenance/stats.php

index e7364ea..54f6f33 100644 (file)
@@ -1467,8 +1467,6 @@ class OutputPage extends ContextSource {
 
                wfProfileIn( __METHOD__ );
 
-               wfIncrStats( 'pcache_not_possible' );
-
                $popts = $this->parserOptions();
                $oldTidy = $popts->setTidy( $tidy );
                $popts->setInterfaceMessage( (bool) $interface );
index f91f26a..493d1df 100644 (file)
@@ -158,6 +158,7 @@ class ParserCache {
 
                $parserOutputKey = $this->getKey( $article, $popts, $useOutdated );
                if ( $parserOutputKey === false ) {
+                       wfIncrStats( 'pcache_miss_absent' );
                        wfProfileOut( __METHOD__ );
                        return false;
                }
index 8f91864..61314e6 100644 (file)
@@ -36,7 +36,6 @@ class clear_stats extends Maintenance {
                        $wgMemc->delete( "$db:stats:request_with_session" );
                        $wgMemc->delete( "$db:stats:request_without_session" );
                        $wgMemc->delete( "$db:stats:pcache_hit" );
-                       $wgMemc->delete( "$db:stats:pcache_miss_invalid" );
                        $wgMemc->delete( "$db:stats:pcache_miss_expired" );
                        $wgMemc->delete( "$db:stats:pcache_miss_absent" );
                        $wgMemc->delete( "$db:stats:pcache_miss_stub" );
@@ -46,6 +45,8 @@ class clear_stats extends Maintenance {
                        $wgMemc->delete( "$db:stats:diff_cache_hit" );
                        $wgMemc->delete( "$db:stats:diff_cache_miss" );
                        $wgMemc->delete( "$db:stats:diff_uncacheable" );
+                       $wgMemc->delete( "$db:stats:job-insert" );
+                       $wgMemc->delete( "$db:stats:job-pop" );
                }
        }
 }
index 1fb46fa..46926dd 100644 (file)
@@ -54,14 +54,12 @@ class CacheStats extends Maintenance {
 
                $this->output( "\nParser cache\n" );
                $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_hit' ) ) );
-               $invalid = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_invalid' ) ) );
                $expired = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_expired' ) ) );
                $absent = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_absent' ) ) );
                $stub = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_stub' ) ) );
-               $total = $hits + $invalid + $expired + $absent + $stub;
+               $total = $hits + $expired + $absent + $stub;
                if ( $total ) {
                        $this->output( sprintf( "hits:              %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
-                       $this->output( sprintf( "invalid:           %-10d %6.2f%%\n", $invalid, $invalid / $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 ) );