MediaWiki master
|
A helper class for testing metrics in Unit Tests. More...
Public Member Functions | |
__construct () | |
count (string $selector) | |
Returns a count of the number of samples for a given metric. | |
getStatsFactory () | |
Returns the testing StatsFactory instance. | |
last (string $selector) | |
Returns the last recorded sample value for a given metric. | |
max (string $selector) | |
Returns the max of all sample values for a given metric. | |
median (string $selector) | |
Returns the median of all sample values for a given metric. | |
min (string $selector) | |
Returns the min of all sample values for a given metric. | |
sum (string $selector) | |
Returns the sum of all sample values for a given metric. | |
withComponent (string $component) | |
Sets the component for the StatsFactory instance. | |
Public Attributes | |
const | EQUALS = '=' |
const | EQUALS_REGEX = '=~' |
const | NOT_EQUALS = '!=' |
const | NOT_EQUALS_REGEX = '!~' |
A helper class for testing metrics in Unit Tests.
Definition at line 38 of file UnitTestingHelper.php.
Wikimedia\Stats\UnitTestingHelper::__construct | ( | ) |
Definition at line 49 of file UnitTestingHelper.php.
Wikimedia\Stats\UnitTestingHelper::count | ( | string | $selector | ) |
Returns a count of the number of samples for a given metric.
Example:
Definition at line 79 of file UnitTestingHelper.php.
Wikimedia\Stats\UnitTestingHelper::getStatsFactory | ( | ) |
Returns the testing StatsFactory instance.
Definition at line 67 of file UnitTestingHelper.php.
Wikimedia\Stats\UnitTestingHelper::last | ( | string | $selector | ) |
Returns the last recorded sample value for a given metric.
Example:
Definition at line 91 of file UnitTestingHelper.php.
Wikimedia\Stats\UnitTestingHelper::max | ( | string | $selector | ) |
Returns the max of all sample values for a given metric.
Example:
Definition at line 120 of file UnitTestingHelper.php.
Wikimedia\Stats\UnitTestingHelper::median | ( | string | $selector | ) |
Returns the median of all sample values for a given metric.
Example:
Definition at line 139 of file UnitTestingHelper.php.
Wikimedia\Stats\UnitTestingHelper::min | ( | string | $selector | ) |
Returns the min of all sample values for a given metric.
Example:
Definition at line 152 of file UnitTestingHelper.php.
Wikimedia\Stats\UnitTestingHelper::sum | ( | string | $selector | ) |
Returns the sum of all sample values for a given metric.
Example:
Definition at line 104 of file UnitTestingHelper.php.
Wikimedia\Stats\UnitTestingHelper::withComponent | ( | string | $component | ) |
Sets the component for the StatsFactory instance.
Definition at line 58 of file UnitTestingHelper.php.
const Wikimedia\Stats\UnitTestingHelper::EQUALS = '=' |
Definition at line 39 of file UnitTestingHelper.php.
const Wikimedia\Stats\UnitTestingHelper::EQUALS_REGEX = '=~' |
Definition at line 41 of file UnitTestingHelper.php.
const Wikimedia\Stats\UnitTestingHelper::NOT_EQUALS = '!=' |
Definition at line 40 of file UnitTestingHelper.php.
const Wikimedia\Stats\UnitTestingHelper::NOT_EQUALS_REGEX = '!~' |
Definition at line 42 of file UnitTestingHelper.php.