MediaWiki REL1_39
|
A class representing a batch of increment/peek operations on a WRStatsRateLimiter. More...
Public Member Functions | |
__construct (WRStatsRateLimiter $limiter, $defaultAmount) | |
globalOp ( $condName, $components=[], $amount=null) | |
Construct a global entity key and queue an operation for it. | |
incr () | |
Execute the batch, unconditionally incrementing all the specified metrics. | |
localOp ( $condName, $components=[], $amount=null) | |
Construct a local entity key and queue an operation for it. | |
peek () | |
Execute the batch, checking each operation against the defined limit, but don't actually increment the metrics. | |
tryIncr () | |
Execute the batch, checking each operation against the defined limit. | |
A class representing a batch of increment/peek operations on a WRStatsRateLimiter.
Definition at line 10 of file LimitBatch.php.
Wikimedia\WRStats\LimitBatch::__construct | ( | WRStatsRateLimiter | $limiter, |
$defaultAmount ) |
WRStatsRateLimiter | $limiter | |
int | $defaultAmount |
Definition at line 26 of file LimitBatch.php.
Wikimedia\WRStats\LimitBatch::globalOp | ( | $condName, | |
$components = [], | |||
$amount = null ) |
Construct a global entity key and queue an operation for it.
string | $condName | The condition name to be incremented/tested, which must match one of the ones passed to createRateLimiter() |
mixed | $components | Entity key components |
int | null | $amount | The amount, or null to use the default |
Definition at line 64 of file LimitBatch.php.
Wikimedia\WRStats\LimitBatch::incr | ( | ) |
Execute the batch, unconditionally incrementing all the specified metrics.
Definition at line 99 of file LimitBatch.php.
Wikimedia\WRStats\LimitBatch::localOp | ( | $condName, | |
$components = [], | |||
$amount = null ) |
Construct a local entity key and queue an operation for it.
string | $condName | The condition name to be incremented/tested, which must match one of the ones passed to createRateLimiter() |
mixed | $components | Entity key component or array of components |
int | null | $amount | The amount to increment by, or null to use the default |
Definition at line 43 of file LimitBatch.php.
Wikimedia\WRStats\LimitBatch::peek | ( | ) |
Execute the batch, checking each operation against the defined limit, but don't actually increment the metrics.
Definition at line 92 of file LimitBatch.php.
Wikimedia\WRStats\LimitBatch::tryIncr | ( | ) |
Execute the batch, checking each operation against the defined limit.
If all operations are allowed, all metrics will be incremented. If some of the operations exceed the limit, none of the metrics will be incremented.
Definition at line 111 of file LimitBatch.php.