MediaWiki 1.42.0
|
Gauge Metric Implementation. More...
Inherits Wikimedia\Stats\Metrics\MetricInterface.
Public Member Functions | |||||||
__construct ( $baseMetric, $logger) | |||||||
copyToStatsdAt ( $statsdNamespaces) | |||||||
Copies metric operation to StatsD at provided namespace.Takes a namespace or multiple namespaces.
| |||||||
fresh () | |||||||
Returns metric with cleared labels.
| |||||||
getComponent () | |||||||
| |||||||
getLabelKeys () | |||||||
Returns the list of defined label keys.
| |||||||
getName () | |||||||
| |||||||
getSampleCount () | |||||||
Returns a count of samples recorded by the metric.
| |||||||
getSampleRate () | |||||||
| |||||||
getSamples () | |||||||
Returns subset of samples corresponding to sample rate setting.
| |||||||
getTypeIndicator () | |||||||
| |||||||
set (float $value) | |||||||
Sets metric to value. | |||||||
setLabel (string $key, string $value) | |||||||
Adds a label $key with $value.Note that the order in which labels are added is significant for StatsD output.Example: $statsFactory->getCounter( 'testMetric_total' )
->setLabel( 'first', 'foo' )
->setLabel( 'second', 'bar' )
->increment();
statsd: "mediawiki.testMetric_total.foo.bar" prometheus: "mediawiki_testMetric_total{ first='foo', second='bar' }
| |||||||
setSampleRate (float $sampleRate) | |||||||
Sets sample rate on a new metric instance.
| |||||||
Public Member Functions inherited from Wikimedia\Stats\Metrics\MetricInterface | |||||||
__construct (BaseMetricInterface $baseMetric, LoggerInterface $logger) | |||||||
Gauge Metric Implementation.
Gauge Metrics can be set to any numeric value and are identified by type "g".
Definition at line 37 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::__construct | ( | $baseMetric, | |
$logger ) |
Definition at line 55 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::copyToStatsdAt | ( | $statsdNamespaces | ) |
Copies metric operation to StatsD at provided namespace.Takes a namespace or multiple namespaces.
string | string[] | $statsdNamespaces |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 139 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::fresh | ( | ) |
Returns metric with cleared labels.
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 151 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::getComponent | ( | ) |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 85 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::getLabelKeys | ( | ) |
Returns the list of defined label keys.
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 122 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::getName | ( | ) |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 80 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::getSampleCount | ( | ) |
Returns a count of samples recorded by the metric.
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 100 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::getSampleRate | ( | ) |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 105 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::getSamples | ( | ) |
Returns subset of samples corresponding to sample rate setting.
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 95 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::getTypeIndicator | ( | ) |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 90 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::set | ( | float | $value | ) |
Sets metric to value.
float | $value |
Definition at line 66 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::setLabel | ( | string | $key, |
string | $value ) |
Adds a label $key with $value.Note that the order in which labels are added is significant for StatsD output.Example:
statsd: "mediawiki.testMetric_total.foo.bar" prometheus: "mediawiki_testMetric_total{ first='foo', second='bar' }
string | $key | |
string | $value |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 127 of file GaugeMetric.php.
Wikimedia\Stats\Metrics\GaugeMetric::setSampleRate | ( | float | $sampleRate | ) |
Sets sample rate on a new metric instance.
float | $sampleRate |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 110 of file GaugeMetric.php.