MediaWiki REL1_41
|
A factory for WRStats readers and writers. More...
Public Member Functions | |
__construct (StatsStore $store) | |
createRateLimiter ( $conditions, $prefix='WRStats', $options=[]) | |
Create a rate limiter. | |
createReader ( $specs, $prefix='WRStats') | |
Create a reader. | |
createWriter ( $specs, $prefix='WRStats') | |
Create a writer. | |
setCurrentTime ( $now) | |
Set a current timestamp to be injected into new instances on creation. | |
A factory for WRStats readers and writers.
Readers and writers should generally be used for a batch and then discarded. Factory objects can be retained indefinitely.
Definition at line 13 of file WRStatsFactory.php.
Wikimedia\WRStats\WRStatsFactory::__construct | ( | StatsStore | $store | ) |
StatsStore | $store |
Definition at line 23 of file WRStatsFactory.php.
Wikimedia\WRStats\WRStatsFactory::createRateLimiter | ( | $conditions, | |
$prefix = 'WRStats', | |||
$options = [] ) |
Create a rate limiter.
LimitCondition[] | $conditions | An array in which the key is the condition name, and the value is a LimitCondition describing the limit. |
string | string[] | $prefix | A string or array of strings to prefix before storage keys. |
array | $options | An associative array of options:
|
Definition at line 92 of file WRStatsFactory.php.
Wikimedia\WRStats\WRStatsFactory::createReader | ( | $specs, | |
$prefix = 'WRStats' ) |
Create a reader.
Readers gather a batch of read operations, returning promises. The batch is executed when the first promise is resolved.
array | $specs | |
string | string[] | $prefix |
Definition at line 71 of file WRStatsFactory.php.
Wikimedia\WRStats\WRStatsFactory::createWriter | ( | $specs, | |
$prefix = 'WRStats' ) |
Create a writer.
Writers gather a batch of increment operations and then commit them when flush() is called, or when the writer is destroyed.
array | $specs | An array of metric specification arrays, indexed by name, where each element is an associative array with the following keys (all optional):
|
string | string[] | $prefix | A string or array of strings to prefix before storage keys. |
Definition at line 53 of file WRStatsFactory.php.
Wikimedia\WRStats\WRStatsFactory::setCurrentTime | ( | $now | ) |
Set a current timestamp to be injected into new instances on creation.
float | int | $now | Seconds since epoch |
Definition at line 108 of file WRStatsFactory.php.