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 37 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 96 of file StatsCache.php.
Referenced by Wikimedia\Stats\StatsCache\get().
Wikimedia\Stats\StatsCache::clear | ( | ) |
Clears the cache.
Definition at line 86 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 53 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 70 of file StatsCache.php.
const Wikimedia\Stats\StatsCache::DELIMITER = '.' |
Definition at line 39 of file StatsCache.php.