MediaWiki REL1_40
|
StatsFactory Implementation. More...
Public Member Functions | |
__construct (string $component, StatsCache $cache, EmitterInterface $emitter, LoggerInterface $logger) | |
StatsFactory builds, configures, and caches Metrics. | |
flush () | |
Send all buffered metrics to the target and destroy the cache. | |
getCounter (string $name) | |
Makes a new CounterMetric or fetches one from cache. | |
getGauge (string $name) | |
Makes a new GaugeMetric or fetches one from cache. | |
getTiming (string $name) | |
Makes a new TimingMetric or fetches one from cache. | |
withStaticLabel (string $key, string $value) | |
Adds a label key-value pair to all metrics created by this StatsFactory instance. | |
withStatsdDataFactory (IBufferingStatsdDataFactory $statsdDataFactory) | |
StatsFactory Implementation.
This is the primary interface for validating metrics definitions caching defined metrics, and returning metric instances from cache if previously defined.
Definition at line 47 of file StatsFactory.php.
Wikimedia\Stats\StatsFactory::__construct | ( | string | $component, |
StatsCache | $cache, | ||
EmitterInterface | $emitter, | ||
LoggerInterface | $logger ) |
StatsFactory builds, configures, and caches Metrics.
string | $component | |
StatsCache | $cache | |
EmitterInterface | $emitter | |
LoggerInterface | $logger |
Definition at line 78 of file StatsFactory.php.
References Wikimedia\Stats\StatsUtils\normalizeString().
Wikimedia\Stats\StatsFactory::flush | ( | ) |
Send all buffered metrics to the target and destroy the cache.
Definition at line 164 of file StatsFactory.php.
Wikimedia\Stats\StatsFactory::getCounter | ( | string | $name | ) |
Makes a new CounterMetric or fetches one from cache.
If a collision occurs, returns a NullMetric to suppress exceptions.
string | $name |
Definition at line 133 of file StatsFactory.php.
Wikimedia\Stats\StatsFactory::getGauge | ( | string | $name | ) |
Makes a new GaugeMetric or fetches one from cache.
If a collision occurs, returns a NullMetric to suppress exceptions.
string | $name |
Definition at line 145 of file StatsFactory.php.
Wikimedia\Stats\StatsFactory::getTiming | ( | string | $name | ) |
Makes a new TimingMetric or fetches one from cache.
If a collision occurs, returns a NullMetric to suppress exceptions.
string | $name |
Definition at line 157 of file StatsFactory.php.
Wikimedia\Stats\StatsFactory::withStaticLabel | ( | string | $key, |
string | $value ) |
Adds a label key-value pair to all metrics created by this StatsFactory instance.
string | $key | |
string | $value |
Definition at line 109 of file StatsFactory.php.
Wikimedia\Stats\StatsFactory::withStatsdDataFactory | ( | IBufferingStatsdDataFactory | $statsdDataFactory | ) |
Definition at line 120 of file StatsFactory.php.