MediaWiki REL1_32
|
An interface to help developers measure the performance of their applications. More...
Public Member Functions | |
__construct (array $params=[]) | |
clearMarks ( $markName=null) | |
getEntries () | |
getEntriesByType ( $entryType) | |
getEntryByName ( $name) | |
mark ( $markName) | |
Store a timestamp with the associated name (a "mark") | |
measure ( $measureName, $startMark='requestStart', $endMark=null) | |
This method stores the duration between two marks along with the associated name (a "measure"). | |
setLogger (LoggerInterface $logger) | |
Sets a logger instance on the object. | |
Protected Attributes | |
LoggerInterface | $logger |
Private Member Functions | |
sortEntries () | |
Sort entries in chronological order with respect to startTime. | |
Private Attributes | |
array[] | $entries = [] |
An interface to help developers measure the performance of their applications.
This interface closely matches the W3C's User Timing specification. The key differences are:
The in-line documentation incorporates content from the User Timing Specification https://www.w3.org/TR/user-timing/ Copyright © 2013 World Wide Web Consortium, (MIT, ERCIM, Keio, Beihang). https://www.w3.org/Consortium/Legal/2015/doc-license
Definition at line 45 of file Timing.php.
Timing::__construct | ( | array | $params = [] | ) |
Definition at line 53 of file Timing.php.
References $params, clearMarks(), and setLogger().
Timing::clearMarks | ( | $markName = null | ) |
string | null | $markName | The name of the mark that should be cleared. If not specified, all marks will be cleared. |
Definition at line 89 of file Timing.php.
Referenced by __construct().
Timing::getEntries | ( | ) |
Definition at line 165 of file Timing.php.
References $entries, and sortEntries().
Timing::getEntriesByType | ( | $entryType | ) |
string | $entryType |
Definition at line 175 of file Timing.php.
References $entries, and sortEntries().
Timing::getEntryByName | ( | $name | ) |
string | $name |
Definition at line 190 of file Timing.php.
References $name.
Referenced by measure().
Timing::mark | ( | $markName | ) |
Store a timestamp with the associated name (a "mark")
string | $markName | The name associated with the timestamp. If there already exists an entry by that name, it is overwritten. |
Definition at line 75 of file Timing.php.
Referenced by TimingTest\testGetEntriesByType(), TimingTest\testMark(), and TimingTest\testMeasure().
Timing::measure | ( | $measureName, | |
$startMark = 'requestStart', | |||
$endMark = null ) |
This method stores the duration between two marks along with the associated name (a "measure").
If neither the startMark nor the endMark argument is specified, measure() will store the duration from $_SERVER['REQUEST_TIME_FLOAT'] to the current time. If the startMark argument is specified, but the endMark argument is not specified, measure() will store the duration from the most recent occurrence of the start mark to the current time. If both the startMark and endMark arguments are specified, measure() will store the duration from the most recent occurrence of the start mark to the most recent occurrence of the end mark.
string | $measureName | |
string | $startMark | |
string | null | $endMark |
Definition at line 124 of file Timing.php.
References getEntryByName().
Referenced by ResourceLoader\measureResponseTime().
Timing::setLogger | ( | LoggerInterface | $logger | ) |
Sets a logger instance on the object.
LoggerInterface | $logger |
Definition at line 64 of file Timing.php.
References $logger.
Referenced by __construct().
|
private |
Sort entries in chronological order with respect to startTime.
Definition at line 156 of file Timing.php.
Referenced by getEntries(), and getEntriesByType().
|
private |
Definition at line 48 of file Timing.php.
Referenced by getEntries(), and getEntriesByType().
|
protected |
Definition at line 51 of file Timing.php.
Referenced by setLogger().