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
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
106 public function addLabel( string $key, string $value ): void;
107
113 public function getLabelKeys(): array;
114
120 public function getLabelValues(): array;
121
127 public function getComponent(): string;
128
134 public function clearLabels(): void;
135
139 public function getStatsdDataFactory();
140
147 public function setStatsdNamespaces( $statsdNamespaces ): void;
148
154 public function getStatsdNamespaces(): array;
155
162 public function withStatsdDataFactory( IBufferingStatsdDataFactory $statsdDataFactory );
163}
Sample Data Class.
Definition Sample.php:32
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
addLabel(string $key, string $value)
Add a label with key => value.
__construct(string $component, string $name)
setSampleRate(float $sampleRate)
Sets the sample rate.
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.