|
MediaWiki master
|
A helper class for testing metrics in Unit Tests. More...
Public Member Functions | |
| __construct () | |
| consumeAllFormatted () | |
| Get all samples in dogstatsd format and clear the buffer. | |
| count (string $selector) | |
| How many samples were observed for a given metric. | |
| getAllFormatted () | |
| Get all samples in dogstatsd format. | |
| getStatsFactory () | |
| Get the underlying StatsFactory, to pass to your subject under test. | |
| last (string $selector) | |
| The last recorded sample value for a given metric. | |
| max (string $selector) | |
| The max of all sample values for a given metric. | |
| median (string $selector) | |
| The median of all sample values for a given metric. | |
| min (string $selector) | |
| The min of all sample values for a given metric. | |
| sum (string $selector) | |
| The sum of all sample values for a given metric. | |
| withComponent (string $component) | |
| Set a component on the underlying StatsFactory. | |
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 26 of file UnitTestingHelper.php.
| Wikimedia\Stats\UnitTestingHelper::__construct | ( | ) |
Definition at line 40 of file UnitTestingHelper.php.
| Wikimedia\Stats\UnitTestingHelper::consumeAllFormatted | ( | ) |
Get all samples in dogstatsd format and clear the buffer.
Definition at line 88 of file UnitTestingHelper.php.
| Wikimedia\Stats\UnitTestingHelper::count | ( | string | $selector | ) |
How many samples were observed for a given metric.
Example:
Definition at line 102 of file UnitTestingHelper.php.
| Wikimedia\Stats\UnitTestingHelper::getAllFormatted | ( | ) |
Get all samples in dogstatsd format.
Definition at line 74 of file UnitTestingHelper.php.
| Wikimedia\Stats\UnitTestingHelper::getStatsFactory | ( | ) |
Get the underlying StatsFactory, to pass to your subject under test.
Definition at line 65 of file UnitTestingHelper.php.
| Wikimedia\Stats\UnitTestingHelper::last | ( | string | $selector | ) |
The last recorded sample value for a given metric.
Example:
Definition at line 114 of file UnitTestingHelper.php.
| Wikimedia\Stats\UnitTestingHelper::max | ( | string | $selector | ) |
The max of all sample values for a given metric.
Example:
Definition at line 143 of file UnitTestingHelper.php.
| Wikimedia\Stats\UnitTestingHelper::median | ( | string | $selector | ) |
The median of all sample values for a given metric.
Example:
Definition at line 161 of file UnitTestingHelper.php.
| Wikimedia\Stats\UnitTestingHelper::min | ( | string | $selector | ) |
The min of all sample values for a given metric.
Example:
Definition at line 173 of file UnitTestingHelper.php.
| Wikimedia\Stats\UnitTestingHelper::sum | ( | string | $selector | ) |
The sum of all sample values for a given metric.
Example:
Definition at line 127 of file UnitTestingHelper.php.
| Wikimedia\Stats\UnitTestingHelper::withComponent | ( | string | $component | ) |
Set a component on the underlying StatsFactory.
Definition at line 56 of file UnitTestingHelper.php.
| const Wikimedia\Stats\UnitTestingHelper::EQUALS = '=' |
Definition at line 27 of file UnitTestingHelper.php.
| const Wikimedia\Stats\UnitTestingHelper::EQUALS_REGEX = '=~' |
Definition at line 29 of file UnitTestingHelper.php.
| const Wikimedia\Stats\UnitTestingHelper::NOT_EQUALS = '!=' |
Definition at line 28 of file UnitTestingHelper.php.
| const Wikimedia\Stats\UnitTestingHelper::NOT_EQUALS_REGEX = '!~' |
Definition at line 30 of file UnitTestingHelper.php.