MediaWiki
1.42.0
BaseMetricInterface.php
Go to the documentation of this file.
1
<?php
20
declare( strict_types=1 );
21
22
namespace
Wikimedia\Stats\Metrics
;
23
24
use
IBufferingStatsdDataFactory
;
25
use
Wikimedia\Stats\Sample
;
26
35
interface
BaseMetricInterface
{
36
41
public
function
__construct
(
string
$component,
string
$name );
42
49
public
function
addSample
(
Sample
$sample ): void;
50
56
public
function
getSampleRate
(): float;
57
63
public
function
setSampleRate
(
float
$sampleRate ): void;
64
70
public
function
getSamples
(): array;
71
77
public
function
getSampleCount
(): int;
78
84
public
function
getName
(): string;
85
93
public
function
withStaticLabels
( array $labelKeys, array $labelValues ):
BaseMetricInterface
;
94
117
public
function
addLabel
(
string
$key,
string
$value ): void;
118
124
public
function
getLabelKeys
(): array;
125
131
public
function
getLabelValues
(): array;
132
138
public
function
getComponent
(): string;
139
145
public
function
clearLabels
(): void;
146
150
public
function
getStatsdDataFactory
();
151
158
public
function
setStatsdNamespaces
( $statsdNamespaces ): void;
159
165
public
function
getStatsdNamespaces
(): array;
166
173
public
function
withStatsdDataFactory
(
IBufferingStatsdDataFactory
$statsdDataFactory );
174
}
Wikimedia\Stats\Sample
Sample Data Class.
Definition
Sample.php:32
IBufferingStatsdDataFactory
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
Definition
IBufferingStatsdDataFactory.php:13
Wikimedia\Stats\Metrics\BaseMetricInterface
Base Metric Interface.
Definition
BaseMetricInterface.php:35
Wikimedia\Stats\Metrics\BaseMetricInterface\addLabel
addLabel(string $key, string $value)
Add a label with key => value.
Wikimedia\Stats\Metrics\BaseMetricInterface\getName
getName()
Returns the Metric Name.
Wikimedia\Stats\Metrics\BaseMetricInterface\withStaticLabels
withStaticLabels(array $labelKeys, array $labelValues)
Configures the metric with static labels.
Wikimedia\Stats\Metrics\BaseMetricInterface\__construct
__construct(string $component, string $name)
Wikimedia\Stats\Metrics\BaseMetricInterface\setSampleRate
setSampleRate(float $sampleRate)
Sets the sample rate.
Wikimedia\Stats\Metrics\BaseMetricInterface\clearLabels
clearLabels()
Clears the working labels.
Wikimedia\Stats\Metrics\BaseMetricInterface\getStatsdNamespaces
getStatsdNamespaces()
Returns the configured legacy StatsD namespaces.
Wikimedia\Stats\Metrics\BaseMetricInterface\getLabelKeys
getLabelKeys()
Returns array of label keys.
Wikimedia\Stats\Metrics\BaseMetricInterface\getSamples
getSamples()
Returns subset of samples corresponding to sample rate setting.
Wikimedia\Stats\Metrics\BaseMetricInterface\getStatsdDataFactory
getStatsdDataFactory()
Gets StatsD Data Factory instance or null.
Wikimedia\Stats\Metrics\BaseMetricInterface\getSampleCount
getSampleCount()
Returns a count of samples recorded by the metric.
Wikimedia\Stats\Metrics\BaseMetricInterface\getLabelValues
getLabelValues()
Returns an array of label values with static label values in the order of label keys.
Wikimedia\Stats\Metrics\BaseMetricInterface\setStatsdNamespaces
setStatsdNamespaces( $statsdNamespaces)
Validates and sets legacy StatsD namespaces.
Wikimedia\Stats\Metrics\BaseMetricInterface\withStatsdDataFactory
withStatsdDataFactory(IBufferingStatsdDataFactory $statsdDataFactory)
StatsD Data Factory instance to copy metrics to.
Wikimedia\Stats\Metrics\BaseMetricInterface\addSample
addSample(Sample $sample)
Records a Metric Sample.
Wikimedia\Stats\Metrics\BaseMetricInterface\getSampleRate
getSampleRate()
Returns the configured sample rate.
Wikimedia\Stats\Metrics\BaseMetricInterface\getComponent
getComponent()
Returns the Metric Component.
Wikimedia\Stats\Metrics
Definition
BaseMetric.php:22
includes
libs
Stats
Metrics
BaseMetricInterface.php
Generated on Thu Jun 13 2024 13:48:48 for MediaWiki by
1.10.0