Singleton cache for Metric instances.
More...
|
| | clear () |
| | Clears the cache.
|
| |
| | get (string $component, string $name, string $expectedClass) |
| | Get a metric object from cache or null.
|
| |
| | getAllMetrics () |
| | Get all metrics from cache.
|
| |
| | set (string $component, string $name, $metric) |
| | Add a metric object to the cache.
|
| |
Singleton cache for Metric instances.
For reuse and collision avoidance. Serves as the data source for Metric Emitters.
- Author
- Cole White
- Since
- 1.41
Definition at line 37 of file StatsCache.php.
◆ clear()
| Wikimedia\Stats\StatsCache::clear |
( |
| ) |
|
◆ get()
| Wikimedia\Stats\StatsCache::get |
( |
string | $component, |
|
|
string | $name, |
|
|
string | $expectedClass ) |
Get a metric object from cache or null.
- Parameters
-
| string | $component | |
| string | $name | |
| string | $expectedClass | |
- Returns
- MetricInterface|null
- Exceptions
-
| TypeError | If cached value is for a different metric type. |
Definition at line 53 of file StatsCache.php.
◆ getAllMetrics()
| Wikimedia\Stats\StatsCache::getAllMetrics |
( |
| ) |
|
Get all metrics from cache.
- Returns
- MetricInterface[]
Definition at line 79 of file StatsCache.php.
◆ set()
| Wikimedia\Stats\StatsCache::set |
( |
string | $component, |
|
|
string | $name, |
|
|
| $metric ) |
Add a metric object to the cache.
- Parameters
-
| string | $component | |
| string | $name | |
| MetricInterface | NullMetric | $metric | |
Definition at line 70 of file StatsCache.php.
◆ DELIMITER
| const Wikimedia\Stats\StatsCache::DELIMITER = '.' |
The documentation for this class was generated from the following file: