|
MediaWiki master
|
The mathematical bits of partitioning a query by timestamp range. More...
Public Member Functions | |
| __construct (private int $minTime, private int $now, private int $limit, private int|float|null $rateEstimate, private int|float $densityEstimate, private int|float $rcSize, private int|float $rcMaxAge,) | |
| getMetrics () | |
| Get metrics describing the overall partitioning operation. | |
| getMinFoundTime () | |
| getNextPartition () | |
| Get the minimum timestamp, optional maximum timestamp and query limit for the next partitioned query. | |
| isDone () | |
| Check whether the overall set of queries is done. | |
| notifyResult (?int $earliestFound, int $numRows) | |
| Call this to tell us about the rows that were found by the query specified by the previous call to getNextPartition(). | |
The mathematical bits of partitioning a query by timestamp range.
Avoid dependencies so that this class is easily unit testable.
Definition at line 14 of file TimestampRangePartitioner.php.
| MediaWiki\RecentChanges\ChangesListQuery\TimestampRangePartitioner::__construct | ( | private int | $minTime, |
| private int | $now, | ||
| private int | $limit, | ||
| private int|float|null | $rateEstimate, | ||
| private int|float | $densityEstimate, | ||
| private int|float | $rcSize, | ||
| private int|float | $rcMaxAge ) |
| int | $minTime | The user-specified timestamp cutoff (UNIX time) |
| int | $now | The maximum UNIX timestamp, conventionally the current time. |
| int | $limit | The maximum number of rows to find |
| int | float | null | $rateEstimate | The query rate (rows/second) if available |
| int | float | $densityEstimate | An estimate of the query density. The number of rows returned per row scanned. The probability that the conditions will match. |
| int | float | $rcSize | The total number of rows in the table |
| int | float | $rcMaxAge | The maximum age of rows in the table |
Definition at line 69 of file TimestampRangePartitioner.php.
| MediaWiki\RecentChanges\ChangesListQuery\TimestampRangePartitioner::getMetrics | ( | ) |
Get metrics describing the overall partitioning operation.
Definition at line 139 of file TimestampRangePartitioner.php.
| MediaWiki\RecentChanges\ChangesListQuery\TimestampRangePartitioner::getMinFoundTime | ( | ) |
Definition at line 148 of file TimestampRangePartitioner.php.
| MediaWiki\RecentChanges\ChangesListQuery\TimestampRangePartitioner::getNextPartition | ( | ) |
Get the minimum timestamp, optional maximum timestamp and query limit for the next partitioned query.
Definition at line 86 of file TimestampRangePartitioner.php.
| MediaWiki\RecentChanges\ChangesListQuery\TimestampRangePartitioner::isDone | ( | ) |
Check whether the overall set of queries is done.
Definition at line 125 of file TimestampRangePartitioner.php.
| MediaWiki\RecentChanges\ChangesListQuery\TimestampRangePartitioner::notifyResult | ( | ?int | $earliestFound, |
| int | $numRows ) |
Call this to tell us about the rows that were found by the query specified by the previous call to getNextPartition().
| int | null | $earliestFound | The earliest found UNIX timestamp |
| int | $numRows | The number of rows found |
Definition at line 112 of file TimestampRangePartitioner.php.