|
MediaWiki master
|
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<string,array> | $specs | |
| string | string[] | $prefix |
Definition at line 31 of file WRStatsReader.php.
| Wikimedia\WRStats\WRStatsReader::fetch | ( | ) |
Perform any queued fetch operations.
Definition at line 133 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 76 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 122 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 175 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 52 of file WRStatsReader.php.
| Wikimedia\WRStats\WRStatsReader::perDay | ( | $rates | ) |
Resolve a batch of RatePromise objects, returning their per-day rates.
| array<mixed,RatePromise> | $rates |
Definition at line 298 of file WRStatsReader.php.
| Wikimedia\WRStats\WRStatsReader::perHour | ( | $rates | ) |
Resolve a batch of RatePromise objects, returning their per-hour rates.
| array<mixed,RatePromise> | $rates |
Definition at line 284 of file WRStatsReader.php.
| Wikimedia\WRStats\WRStatsReader::perMinute | ( | $rates | ) |
Resolve a batch of RatePromise objects, returning their per-minute rates.
| array<mixed,RatePromise> | $rates |
Definition at line 270 of file WRStatsReader.php.
| Wikimedia\WRStats\WRStatsReader::perSecond | ( | $rates | ) |
Resolve a batch of RatePromise objects, returning their per-second rates.
| array<mixed,RatePromise> | $rates |
Definition at line 256 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 154 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 146 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 64 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.
| array<mixed,RatePromise> | $rates |
Definition at line 242 of file WRStatsReader.php.