MediaWiki master
MetricInterface.php
Go to the documentation of this file.
1<?php
21
22use Psr\Log\LoggerInterface;
24
31interface 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}
Sample Data Class.
Definition Sample.php:32
fresh()
Returns metric with cleared labels.
getSamples()
Returns subset of samples corresponding to sample rate setting.
getSampleCount()
Returns a count of samples recorded by the metric.
__construct(BaseMetricInterface $baseMetric, LoggerInterface $logger)
copyToStatsdAt( $statsdNamespaces)
Copies metric operation to StatsD at provided namespace.
setLabel(string $key, string $value)
Adds a label $key with $value.
setSampleRate(float $sampleRate)
Sets sample rate on a new metric instance.
getLabelKeys()
Returns the list of defined label keys.