|
MediaWiki master
|
Singleton cache for Metric instances. More...
Public Member Functions | |
| 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. | |
Static Public Member Functions | |
| static | cacheKey (string $component, string $name) |
| Get the metric formatted name. | |
Public Attributes | |
| const | DELIMITER = '.' |
Singleton cache for Metric instances.
For reuse and collision avoidance. Serves as the data source for Metric Emitters.
Definition at line 23 of file StatsCache.php.
|
static |
Get the metric formatted name.
Takes the provided name and constructs a more specific name by combining component and name.
Definition at line 82 of file StatsCache.php.
Referenced by Wikimedia\Stats\StatsCache\get().
| Wikimedia\Stats\StatsCache::clear | ( | ) |
Clears the cache.
Definition at line 72 of file StatsCache.php.
| Wikimedia\Stats\StatsCache::get | ( | string | $component, |
| string | $name, | ||
| string | $expectedClass ) |
Get a metric object from cache or null.
| string | $component | |
| string | $name | |
| string | $expectedClass |
| TypeError | If cached value is for a different metric type. |
Definition at line 39 of file StatsCache.php.
References Wikimedia\Stats\StatsCache\cacheKey().
| Wikimedia\Stats\StatsCache::getAllMetrics | ( | ) |
| Wikimedia\Stats\StatsCache::set | ( | string | $component, |
| string | $name, | ||
| $metric ) |
Add a metric object to the cache.
| string | $component | |
| string | $name | |
| MetricInterface | NullMetric | $metric |
Definition at line 56 of file StatsCache.php.
| const Wikimedia\Stats\StatsCache::DELIMITER = '.' |
Definition at line 25 of file StatsCache.php.