MediaWiki REL1_40
|
Readers gather a batch of read operations, returning promises. More...
Public Member Functions | |
__construct (StatsStore $store, $specs, $prefix) | |
fetch () | |
Perform any queued fetch operations. | |
getRate ( $metricName, ?EntityKey $entity, TimeRange $range) | |
Queue a fetch operation. | |
getRates ( $metricNames, ?EntityKey $entity, TimeRange $range) | |
Queue a batch of fetch operations for different metrics with the same time range. | |
internalGetCount ( $metricName, EntityKey $entity, MetricSpec $metricSpec, SequenceSpec $seqSpec, TimeRange $range) | |
latest ( $numSeconds) | |
Get a TimeRange for some period ending at the current time. | |
perDay ( $rates) | |
Resolve a batch of RatePromise objects, returning their per-day rates. | |
perHour ( $rates) | |
Resolve a batch of RatePromise objects, returning their per-hour rates. | |
perMinute ( $rates) | |
Resolve a batch of RatePromise objects, returning their per-minute rates. | |
perSecond ( $rates) | |
Resolve a batch of RatePromise objects, returning their per-second rates. | |
resetCurrentTime () | |
Clear the current time so that it will be filled with the real current time on the next call. | |
setCurrentTime ( $now) | |
Set the current time to be used in latest() etc. | |
timeRange ( $start, $end) | |
Get a specified time range. | |
total ( $rates) | |
Resolve a batch of RatePromise objects, returning their counter totals, indexed as in the input array. | |
Readers gather a batch of read operations, returning promises.
The batch is executed when the first promise is resolved.
Definition at line 11 of file WRStatsReader.php.
Wikimedia\WRStats\WRStatsReader::__construct | ( | StatsStore | $store, |
$specs, | |||
$prefix ) |
StatsStore | $store | |
array | $specs | |
string | string[] | $prefix |
Definition at line 32 of file WRStatsReader.php.
Wikimedia\WRStats\WRStatsReader::fetch | ( | ) |
Perform any queued fetch operations.
Definition at line 127 of file WRStatsReader.php.
Referenced by Wikimedia\WRStats\WRStatsReader\internalGetCount().
Queue a fetch operation.
string | $metricName | The metric name, the key into $specs. |
EntityKey | null | $entity | Additional storage key components |
TimeRange | $range | The time range to fetch |
Definition at line 77 of file WRStatsReader.php.
Referenced by Wikimedia\WRStats\WRStatsReader\getRates().
Queue a batch of fetch operations for different metrics with the same time range.
string[] | $metricNames | |
EntityKey | null | $entity | |
TimeRange | $range |
Definition at line 116 of file WRStatsReader.php.
References Wikimedia\WRStats\WRStatsReader\getRate().
Wikimedia\WRStats\WRStatsReader::internalGetCount | ( | $metricName, | |
EntityKey | $entity, | ||
MetricSpec | $metricSpec, | ||
SequenceSpec | $seqSpec, | ||
TimeRange | $range ) |
string | $metricName | |
EntityKey | $entity | |
MetricSpec | $metricSpec | |
SequenceSpec | $seqSpec | |
TimeRange | $range |
Definition at line 170 of file WRStatsReader.php.
References Wikimedia\WRStats\WRStatsReader\fetch(), and Wikimedia\WRStats\TimeRange\getDuration().
Wikimedia\WRStats\WRStatsReader::latest | ( | $numSeconds | ) |
Get a TimeRange for some period ending at the current time.
Note that this will use the same value of the current time for subsequent calls until resetCurrentTime() is called.
int | float | $numSeconds |
Definition at line 53 of file WRStatsReader.php.
Wikimedia\WRStats\WRStatsReader::perDay | ( | $rates | ) |
Resolve a batch of RatePromise objects, returning their per-day rates.
RatePromise[] | $rates |
Definition at line 293 of file WRStatsReader.php.
Wikimedia\WRStats\WRStatsReader::perHour | ( | $rates | ) |
Resolve a batch of RatePromise objects, returning their per-hour rates.
RatePromise[] | $rates |
Definition at line 279 of file WRStatsReader.php.
Wikimedia\WRStats\WRStatsReader::perMinute | ( | $rates | ) |
Resolve a batch of RatePromise objects, returning their per-minute rates.
RatePromise[] | $rates |
Definition at line 265 of file WRStatsReader.php.
Wikimedia\WRStats\WRStatsReader::perSecond | ( | $rates | ) |
Resolve a batch of RatePromise objects, returning their per-second rates.
RatePromise[] | $rates |
Definition at line 251 of file WRStatsReader.php.
Wikimedia\WRStats\WRStatsReader::resetCurrentTime | ( | ) |
Clear the current time so that it will be filled with the real current time on the next call.
Definition at line 148 of file WRStatsReader.php.
Wikimedia\WRStats\WRStatsReader::setCurrentTime | ( | $now | ) |
Set the current time to be used in latest() etc.
int | float | $now |
Definition at line 140 of file WRStatsReader.php.
Wikimedia\WRStats\WRStatsReader::timeRange | ( | $start, | |
$end ) |
Get a specified time range.
int | float | $start | The UNIX time of the start of the range |
int | float | $end | The UNIX time of the end of the range |
Definition at line 65 of file WRStatsReader.php.
Wikimedia\WRStats\WRStatsReader::total | ( | $rates | ) |
Resolve a batch of RatePromise objects, returning their counter totals, indexed as in the input array.
RatePromise[] | $rates |
Definition at line 237 of file WRStatsReader.php.