MediaWiki REL1_40
Wikimedia\Stats\Metrics\TimingMetric Class Reference

Timing Metric Implementation. More...

Inherits Wikimedia\Stats\Metrics\MetricInterface.

Collaboration diagram for Wikimedia\Stats\Metrics\TimingMetric:

Public Member Functions

 __construct ( $baseMetric, $logger)
 
 copyToStatsdAt (string $statsdNamespace)
 Copies metric operation to StatsD at provided namespace.
Parameters
string$statsdNamespace
Returns
CounterMetric|GaugeMetric|TimingMetric|NullMetric

 
 fresh ()
 Returns metric with cleared labels.
Returns
CounterMetric|GaugeMetric|TimingMetric|NullMetric

 
 getComponent ()
 
Returns
string

 
 getLabelKeys ()
 Returns the list of defined label keys.
Returns
string[]

 
 getName ()
 
Returns
string

 
 getSampleRate ()
 
Returns
float

 
 getSamples ()
 Returns subset of samples corresponding to sample rate setting.
Returns
Sample[]

 
 getTypeIndicator ()
 
Returns
string

 
 observe (float $value)
 Records a previously calculated observation.
 
 start ()
 Starts a timer.
 
 stop ()
 Stops a running timer.
 
 withLabel (string $key, string $value)
 Adds a label $key with $value.
Parameters
string$key
string$value
Returns
CounterMetric|GaugeMetric|TimingMetric|NullMetric

 
 withSampleRate (float $sampleRate)
 Sets sample rate on a new metric instance.
Parameters
float$sampleRate
Returns
CounterMetric|GaugeMetric|TimingMetric|NullMetric

 
- Public Member Functions inherited from Wikimedia\Stats\Metrics\MetricInterface
 __construct (BaseMetricInterface $baseMetric, LoggerInterface $logger)
 

Detailed Description

Timing Metric Implementation.

Timing metrics track duration data which can be broken into histograms. They are identified by type "ms".

Author
Cole White
Since
1.38

Definition at line 38 of file TimingMetric.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Stats\Metrics\TimingMetric::__construct ( $baseMetric,
$logger )

Definition at line 62 of file TimingMetric.php.

Member Function Documentation

◆ copyToStatsdAt()

Wikimedia\Stats\Metrics\TimingMetric::copyToStatsdAt ( string $statsdNamespace)

Copies metric operation to StatsD at provided namespace.

Parameters
string$statsdNamespace
Returns
CounterMetric|GaugeMetric|TimingMetric|NullMetric

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 159 of file TimingMetric.php.

◆ fresh()

Wikimedia\Stats\Metrics\TimingMetric::fresh ( )

Returns metric with cleared labels.

Returns
CounterMetric|GaugeMetric|TimingMetric|NullMetric

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 167 of file TimingMetric.php.

◆ getComponent()

Wikimedia\Stats\Metrics\TimingMetric::getComponent ( )

Returns
string

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 110 of file TimingMetric.php.

◆ getLabelKeys()

Wikimedia\Stats\Metrics\TimingMetric::getLabelKeys ( )

Returns the list of defined label keys.

Returns
string[]

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 142 of file TimingMetric.php.

◆ getName()

Wikimedia\Stats\Metrics\TimingMetric::getName ( )

Returns
string

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 105 of file TimingMetric.php.

◆ getSampleRate()

Wikimedia\Stats\Metrics\TimingMetric::getSampleRate ( )

Returns
float

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 125 of file TimingMetric.php.

◆ getSamples()

Wikimedia\Stats\Metrics\TimingMetric::getSamples ( )

Returns subset of samples corresponding to sample rate setting.

Returns
Sample[]

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 120 of file TimingMetric.php.

◆ getTypeIndicator()

Wikimedia\Stats\Metrics\TimingMetric::getTypeIndicator ( )

Returns
string

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 115 of file TimingMetric.php.

◆ observe()

Wikimedia\Stats\Metrics\TimingMetric::observe ( float $value)

Records a previously calculated observation.

Parameters
float$value
Returns
void

Definition at line 96 of file TimingMetric.php.

◆ start()

Wikimedia\Stats\Metrics\TimingMetric::start ( )

Starts a timer.

Returns
void

Definition at line 72 of file TimingMetric.php.

◆ stop()

Wikimedia\Stats\Metrics\TimingMetric::stop ( )

Stops a running timer.

Returns
void

Definition at line 81 of file TimingMetric.php.

◆ withLabel()

Wikimedia\Stats\Metrics\TimingMetric::withLabel ( string $key,
string $value )

Adds a label $key with $value.

Parameters
string$key
string$value
Returns
CounterMetric|GaugeMetric|TimingMetric|NullMetric

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 147 of file TimingMetric.php.

◆ withSampleRate()

Wikimedia\Stats\Metrics\TimingMetric::withSampleRate ( float $sampleRate)

Sets sample rate on a new metric instance.

Parameters
float$sampleRate
Returns
CounterMetric|GaugeMetric|TimingMetric|NullMetric

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 130 of file TimingMetric.php.


The documentation for this class was generated from the following file: