MediaWiki master
BaseMetricInterface.php
Go to the documentation of this file.
1<?php
20declare( strict_types=1 );
21
23
26
36
41 public function __construct( string $component, string $name );
42
49 public function addSample( Sample $sample ): void;
50
56 public function getSampleRate(): float;
57
58 public function setSampleRate( float $sampleRate ): void;
59
65 public function getSamples(): array;
66
72 public function getSampleCount(): int;
73
79 public function getName(): string;
80
101 public function addLabel( string $key, string $value ): void;
102
108 public function getLabelKeys(): array;
109
115 public function getLabelValues(): array;
116
122 public function getComponent(): string;
123
129 public function clearLabels(): void;
130
134 public function getStatsdDataFactory();
135
142 public function setStatsdNamespaces( $statsdNamespaces ): void;
143
149 public function getStatsdNamespaces(): array;
150
158 public function withStatsdDataFactory( ?IBufferingStatsdDataFactory $statsdDataFactory );
159}
A container for a metric sample to be passed to the rendering function.
Definition Sample.php:30
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
addLabel(string $key, string $value)
Add a label with key => value.
__construct(string $component, string $name)
clearLabels()
Clears the working labels.
getStatsdNamespaces()
Returns the configured legacy StatsD namespaces.
getLabelKeys()
Returns array of label keys.
getSamples()
Returns subset of samples corresponding to sample rate setting.
getStatsdDataFactory()
Gets StatsD Data Factory instance or null.
getSampleCount()
Returns a count of samples recorded by the metric.
getLabelValues()
Returns an array of label values in the order of label keys.
setStatsdNamespaces( $statsdNamespaces)
Validates and sets legacy StatsD namespaces.
withStatsdDataFactory(?IBufferingStatsdDataFactory $statsdDataFactory)
StatsD Data Factory instance to copy metrics to.
addSample(Sample $sample)
Records a Metric Sample.
getSampleRate()
Returns the configured sample rate.
getComponent()
Returns the Metric Component.