MediaWiki master
|
Timing 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 () | |||||||
| |||||||
observe (float $milliseconds) | |||||||
Records a previously calculated observation in milliseconds. | |||||||
observeNanoseconds (float $nanoseconds) | |||||||
Record a previously calculated observation in nanoseconds. | |||||||
observeSeconds (float $seconds) | |||||||
Record a previously calculated observation in seconds. | |||||||
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.
| |||||||
start () | |||||||
Starts a timer. | |||||||
stop () | |||||||
Stops a running timer. | |||||||
Public Member Functions inherited from Wikimedia\Stats\Metrics\MetricInterface | |||||||
__construct (BaseMetricInterface $baseMetric, LoggerInterface $logger) | |||||||
Timing Metric Implementation.
Timing metrics track duration data which can be broken into histograms. They are identified by type "ms".
Definition at line 38 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::__construct | ( | $baseMetric, | |
$logger ) |
Definition at line 59 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::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 201 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::fresh | ( | ) |
Returns metric with cleared labels.
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 213 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::getComponent | ( | ) |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 147 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::getLabelKeys | ( | ) |
Returns the list of defined label keys.
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 184 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::getName | ( | ) |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 142 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::getSampleCount | ( | ) |
Returns a count of samples recorded by the metric.
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 162 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::getSampleRate | ( | ) |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 167 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::getSamples | ( | ) |
Returns subset of samples corresponding to sample rate setting.
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 157 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::getTypeIndicator | ( | ) |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 152 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::observe | ( | float | $milliseconds | ) |
Records a previously calculated observation in milliseconds.
float | $milliseconds |
Definition at line 93 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::observeNanoseconds | ( | float | $nanoseconds | ) |
Record a previously calculated observation in nanoseconds.
Common usage:
float | $nanoseconds |
Definition at line 137 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::observeSeconds | ( | float | $seconds | ) |
Record a previously calculated observation in seconds.
Common usage:
float | $seconds |
Definition at line 120 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::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 189 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::setSampleRate | ( | float | $sampleRate | ) |
Sets sample rate on a new metric instance.
float | $sampleRate |
Implements Wikimedia\Stats\Metrics\MetricInterface.
Definition at line 172 of file TimingMetric.php.
Wikimedia\Stats\Metrics\TimingMetric::start | ( | ) |
Wikimedia\Stats\Metrics\TimingMetric::stop | ( | ) |