MediaWiki
master
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
62
public
function
getSampleCount
(): int;
63
70
public
function
setSampleRate
(
float
$sampleRate );
71
77
public
function
getLabelKeys
(): array;
78
97
public
function
setLabel
(
string
$key,
string
$value );
98
107
public
function
copyToStatsdAt
( $statsdNamespaces );
108
114
public
function
fresh
();
115
}
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\getSampleCount
getSampleCount()
Returns a count of samples recorded by the metric.
Wikimedia\Stats\Metrics\MetricInterface\__construct
__construct(BaseMetricInterface $baseMetric, LoggerInterface $logger)
Wikimedia\Stats\Metrics\MetricInterface\copyToStatsdAt
copyToStatsdAt( $statsdNamespaces)
Copies metric operation to StatsD at provided namespace.
Wikimedia\Stats\Metrics\MetricInterface\getSampleRate
getSampleRate()
Wikimedia\Stats\Metrics\MetricInterface\setLabel
setLabel(string $key, string $value)
Adds a label $key with $value.
Wikimedia\Stats\Metrics\MetricInterface\getComponent
getComponent()
Wikimedia\Stats\Metrics\MetricInterface\setSampleRate
setSampleRate(float $sampleRate)
Sets sample rate on a new metric instance.
Wikimedia\Stats\Metrics\MetricInterface\getLabelKeys
getLabelKeys()
Returns the list of defined label keys.
Wikimedia\Stats\Metrics\MetricInterface\getName
getName()
Wikimedia\Stats\Metrics
Definition
BaseMetric.php:22
includes
libs
Stats
Metrics
MetricInterface.php
Generated on Sat Sep 14 2024 00:24:09 for MediaWiki by
1.10.0