Extension:EnhancedReportTime

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
EnhancedReportTime
Release status: stable
Implementation Skin
Description Displays enhanced information about generation time of wiki pages
Author(s) Dāvis Mošenkovs (DavisNTtalk)
Latest version 1.0.1 (2013-08-19)
MediaWiki MW 1.21+ (most likely works also on older versions)
Database changes No
License GPLv2+
Download Download instructions
Parameters
  • $wgERTUseServerStartTime
  • $wgERTSLATime
  • $wgERTTestFunction
  • $wgERTPages
Hooks used
SkinTemplateOutputPageBeforeExec
Translate the EnhancedReportTime extension if it is available at translatewiki.net
Check usage and version matrix.

The EnhancedReportTime extension in HTML comment of generated pages, along with page generation time, displays request start time source ($wgRequestTime or $_SERVER['REQUEST_TIME_FLOAT']) and whether a predefined generation time limit (usually SLA requirement) is met.

Usage[edit]

After plugin installation on specified pages (or entire wiki) additional information about page generation time is shown.

This allows more effective usage of webpage monitoring software/services lacking configurable request timeouts, but offering page content checking. When using EnhancedReportTime such monitoring service can be set to check a page that is never cached and not publicly editable (e.g. Special:Version) and search for "SLA of XX secs met." in it. This way a basic request time monitoring can be achieved.

Use only non-cached pages for monitoring as HTML comment about generation time gets cached. The EnhancedReportTime extension does not count entire request processing time on server as well as network latency (it is not a replacement for full featured monitoring solution).

Download instructions[edit]

Download both .php files from GitHub (feel free to move this repository to MediaWiki Git) and place them in $IP/extensions/EnhancedReportTime/.

Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation[edit]

To load this extension, add the following to LocalSettings.php:

require_once("$IP/extensions/EnhancedReportTime/EnhancedReportTime.php");

Afterwards (if required) place configuration parameters in LocalSettings.php (default values are shown here):

$wgERTUseServerStartTime = true;
If available, use request start timestamp from $_SERVER['REQUEST_TIME_FLOAT'] instead of $wgRequestTime. This should allow to count some more server overhead. Works on PHP 5.4.0+.
$wgERTSLATime = 10;
Maximum allowed generation time for which to report that SLA is met. Setting this to 0 suppresses SLA message.
$wgERTTestFunction = ;
Name of PHP function with additional tests. This function must return true on success or string with error message on failure. Error message will be displayed instead of SLA of XX secs met./SLA of XX secs NOT met. message. Execution time of this function is included in page generation time.
$wgERTPages = array('Special:Version');
Array with page names (see magic word {{FULLPAGENAME}}) where to enable EnhancedReportTime. Setting this to empty enables EnhancedReportTime on every page. Be aware of caching - use only non-cached pages for monitoring!