MediaWiki REL1_40
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
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}
Sample Data Class.
Definition Sample.php:32
fresh()
Returns metric with cleared labels.
getSamples()
Returns subset of samples corresponding to sample rate setting.
withLabel(string $key, string $value)
Adds a label $key with $value.
__construct(BaseMetricInterface $baseMetric, LoggerInterface $logger)
getLabelKeys()
Returns the list of defined label keys.
copyToStatsdAt(string $statsdNamespace)
Copies metric operation to StatsD at provided namespace.
withSampleRate(float $sampleRate)
Sets sample rate on a new metric instance.