MediaWiki REL1_39
|
Public Member Functions | |
__construct (array $config, LoggerInterface $logger) | |
MetricsFactory builds, configures, and caches Metrics. | |
flush () | |
Send all buffered metrics to the target and destroy the cache. | |
getCounter (array $config=[]) | |
Makes a new CounterMetric or fetches one from cache. | |
getGauge (array $config=[]) | |
Makes a new GaugeMetric or fetches one from cache. | |
getTiming (array $config=[]) | |
Makes a new TimingMetric or fetches one from cache. | |
Static Public Member Functions | |
static | normalizeArray (array $entities) |
Normalize an array of strings. | |
static | normalizeString (string $entity) |
Normalize strings to a metrics-compatible format. | |
Protected Member Functions | |
send (UDPTransport $transport) | |
Render the buffer of samples, group them into payloads, and send them through the provided UDPTransport instance. | |
Definition at line 40 of file MetricsFactory.php.
Wikimedia\Metrics\MetricsFactory::__construct | ( | array | $config, |
LoggerInterface | $logger ) |
MetricsFactory builds, configures, and caches Metrics.
array | $config | associative array:
|
LoggerInterface | $logger |
UndefinedPrefixException | |
UnsupportedFormatException |
Definition at line 84 of file MetricsFactory.php.
References Wikimedia\Metrics\MetricsFactory\normalizeString().
Wikimedia\Metrics\MetricsFactory::flush | ( | ) |
Send all buffered metrics to the target and destroy the cache.
Definition at line 189 of file MetricsFactory.php.
References Wikimedia\Metrics\MetricsFactory\send().
Wikimedia\Metrics\MetricsFactory::getCounter | ( | array | $config = [] | ) |
Makes a new CounterMetric or fetches one from cache.
If a collision occurs, returns a NullMetric to suppress exceptions.
array | $config | associative array:
|
Definition at line 113 of file MetricsFactory.php.
Wikimedia\Metrics\MetricsFactory::getGauge | ( | array | $config = [] | ) |
Makes a new GaugeMetric or fetches one from cache.
If a collision occurs, returns a NullMetric to suppress exceptions.
array | $config | associative array: name: (string) The metric name. extension: (string) The extension generating the metric. labels: (array) Labels that further identify the metric. |
Definition at line 141 of file MetricsFactory.php.
Wikimedia\Metrics\MetricsFactory::getTiming | ( | array | $config = [] | ) |
Makes a new TimingMetric or fetches one from cache.
If a collision occurs, returns a NullMetric to suppress exceptions.
array | $config | associative array:
|
Definition at line 170 of file MetricsFactory.php.
|
static |
Normalize an array of strings.
string[] | $entities |
Definition at line 339 of file MetricsFactory.php.
|
static |
Normalize strings to a metrics-compatible format.
Replace any other non-alphanumeric characters with underscores. Eliminate repeated underscores. Trim leading or trailing underscores.
string | $entity |
Definition at line 327 of file MetricsFactory.php.
Referenced by Wikimedia\Metrics\MetricsFactory\__construct().
|
protected |
Render the buffer of samples, group them into payloads, and send them through the provided UDPTransport instance.
UDPTransport | $transport |
Definition at line 246 of file MetricsFactory.php.
Referenced by Wikimedia\Metrics\MetricsFactory\flush().