Add ParserOutput cache and expiry times to NewPP report
authorOri Livneh <ori@wikimedia.org>
Fri, 28 Aug 2015 02:05:27 +0000 (19:05 -0700)
committerOri Livneh <ori@wikimedia.org>
Fri, 28 Aug 2015 02:07:35 +0000 (19:07 -0700)
The labels are not localized, because I think this ought to be outputted as a
JSON blob, with uniform field names. But not doing that in this patch.

Change-Id: I235839b276632308ddeac7afe763d355b73c2a25

includes/parser/Parser.php

index 9731a20..f538153 100644 (file)
@@ -509,6 +509,9 @@ class Parser {
                        if ( $wgShowHostnames ) {
                                $limitReport .= 'Parsed by ' . wfHostname() . "\n";
                        }
+                       $limitReport .= 'Cached time: ' . $this->mOutput->getCacheTime() . "\n";
+                       $limitReport .= 'Cache expiry: ' . $this->mOutput->getCacheExpiry() . "\n";
+                       $limitReport .= 'Dyanmic content: ' . ( $this->mOutput->hasDynamicContent() ? 'true' : 'false' ) . "\n";
                        foreach ( $this->mOutput->getLimitReportData() as $key => $value ) {
                                if ( Hooks::run( 'ParserLimitReportFormat',
                                        array( $key, &$value, &$limitReport, false, false )