MediaWiki REL1_40
|
Base Metric Implementation V1. More...
Inherits Wikimedia\Stats\Metrics\BaseMetricInterface.
Public Member Functions | |||||||
__construct (string $component, string $name) | |||||||
| |||||||
addLabel (string $key, string $value) | |||||||
Add a label with key => value.
| |||||||
addSample (Sample $sample) | |||||||
Records a Metric Sample.
| |||||||
clearLabels () | |||||||
Clears the working labels.
| |||||||
getComponent () | |||||||
Returns the Metric Component.
| |||||||
getLabelKeys () | |||||||
getLabelValues () | |||||||
Combines the provided associative array of labels with the associative array of staticLabels and returns the values in the order of labelKeys. | |||||||
getName () | |||||||
Returns the Metric Name.
| |||||||
getSampleRate () | |||||||
Returns the configured sample rate.
| |||||||
getSamples () | |||||||
Returns subset of samples corresponding to sample rate setting.
| |||||||
getStatsdDataFactory () | |||||||
Gets StatsD Data Factory instance or null. | |||||||
setSampleRate (float $sampleRate) | |||||||
Sets the sample rate.
| |||||||
withStaticLabels (array $labelKeys, array $labelValues) | |||||||
Configures the metric with static labels.
| |||||||
withStatsdDataFactory ( $statsdDataFactory) | |||||||
Public Member Functions inherited from Wikimedia\Stats\Metrics\BaseMetricInterface | |||||||
withStatsdDataFactory (IBufferingStatsdDataFactory $statsdDataFactory) | |||||||
StatsD Data Factory instance to copy metrics to. | |||||||
Base Metric Implementation V1.
Implements shared Metric functionality:
Definition at line 42 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::__construct | ( | string | $component, |
string | $name ) |
string | $component | The component this metric will track. |
string | $name | The Metric Name. |
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 69 of file BaseMetric.php.
References Wikimedia\Stats\StatsUtils\normalizeString().
Wikimedia\Stats\Metrics\BaseMetric::addLabel | ( | string | $key, |
string | $value ) |
Add a label with key => value.
string | $key | |
string | $value |
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 112 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::addSample | ( | Sample | $sample | ) |
Records a Metric Sample.
Sample | $sample |
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 75 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::clearLabels | ( | ) |
Clears the working labels.
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 176 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::getComponent | ( | ) |
Returns the Metric Component.
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 181 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::getLabelKeys | ( | ) |
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 155 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::getLabelValues | ( | ) |
Combines the provided associative array of labels with the associative array of staticLabels and returns the values in the order of labelKeys.
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 166 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::getName | ( | ) |
Returns the Metric Name.
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 90 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::getSampleRate | ( | ) |
Returns the configured sample rate.
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 95 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::getSamples | ( | ) |
Returns subset of samples corresponding to sample rate setting.
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 100 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::getStatsdDataFactory | ( | ) |
Gets StatsD Data Factory instance or null.
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 121 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::setSampleRate | ( | float | $sampleRate | ) |
Sets the sample rate.
float | $sampleRate |
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 80 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::withStaticLabels | ( | array | $labelKeys, |
array | $labelValues ) |
Configures the metric with static labels.
string[] | $labelKeys | |
string[] | $labelValues |
Implements Wikimedia\Stats\Metrics\BaseMetricInterface.
Definition at line 105 of file BaseMetric.php.
Wikimedia\Stats\Metrics\BaseMetric::withStatsdDataFactory | ( | $statsdDataFactory | ) |
Definition at line 126 of file BaseMetric.php.