MediaWiki
REL1_40
MetricInterface.php
Go to the documentation of this file.
1
<?php
20
namespace
Wikimedia\Stats\Metrics
;
21
22
use Psr\Log\LoggerInterface;
23
use
Wikimedia\Stats\Sample
;
24
31
interface
MetricInterface
{
36
public
function
__construct
(
BaseMetricInterface
$baseMetric, LoggerInterface $logger );
37
39
public
function
getName
(): string;
40
42
public
function
getComponent
(): string;
43
45
public
function
getSampleRate
(): float;
46
48
public
function
getTypeIndicator
(): string;
49
55
public
function
getSamples
(): array;
56
63
public
function
withSampleRate
(
float
$sampleRate );
64
70
public
function
getLabelKeys
(): array;
71
79
public
function
withLabel
(
string
$key,
string
$value );
80
87
public
function
copyToStatsdAt
(
string
$statsdNamespace );
88
94
public
function
fresh
();
95
}
Wikimedia\Stats\Sample
Sample Data Class.
Definition
Sample.php:32
Wikimedia\Stats\Metrics\BaseMetricInterface
Base Metric Interface.
Definition
BaseMetricInterface.php:35
Wikimedia\Stats\Metrics\MetricInterface
Metric Interface.
Definition
MetricInterface.php:31
Wikimedia\Stats\Metrics\MetricInterface\fresh
fresh()
Returns metric with cleared labels.
Wikimedia\Stats\Metrics\MetricInterface\getSamples
getSamples()
Returns subset of samples corresponding to sample rate setting.
Wikimedia\Stats\Metrics\MetricInterface\getTypeIndicator
getTypeIndicator()
Wikimedia\Stats\Metrics\MetricInterface\withLabel
withLabel(string $key, string $value)
Adds a label $key with $value.
Wikimedia\Stats\Metrics\MetricInterface\__construct
__construct(BaseMetricInterface $baseMetric, LoggerInterface $logger)
Wikimedia\Stats\Metrics\MetricInterface\getSampleRate
getSampleRate()
Wikimedia\Stats\Metrics\MetricInterface\getComponent
getComponent()
Wikimedia\Stats\Metrics\MetricInterface\getLabelKeys
getLabelKeys()
Returns the list of defined label keys.
Wikimedia\Stats\Metrics\MetricInterface\copyToStatsdAt
copyToStatsdAt(string $statsdNamespace)
Copies metric operation to StatsD at provided namespace.
Wikimedia\Stats\Metrics\MetricInterface\withSampleRate
withSampleRate(float $sampleRate)
Sets sample rate on a new metric instance.
Wikimedia\Stats\Metrics\MetricInterface\getName
getName()
Wikimedia\Stats\Metrics
Definition
BaseMetric.php:22
includes
libs
Stats
Metrics
MetricInterface.php
Generated on Thu Jun 27 2024 14:03:19 for MediaWiki by
1.10.0