MediaWiki 1.40.4
Wikimedia\Stats\Metrics\GaugeMetric Class Reference

Gauge Metric Implementation. More...

Inherits Wikimedia\Stats\Metrics\MetricInterface.

Collaboration diagram for Wikimedia\Stats\Metrics\GaugeMetric:

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

 
 set (float $value)
 Sets metric to value.
 
 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

Gauge Metric Implementation.

Gauge Metrics can be set to any numeric value and are identified by type "g".

Author
Cole White
Since
1.38

Definition at line 37 of file GaugeMetric.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 58 of file GaugeMetric.php.

Member Function Documentation

◆ copyToStatsdAt()

Wikimedia\Stats\Metrics\GaugeMetric::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 132 of file GaugeMetric.php.

◆ fresh()

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

Returns metric with cleared labels.

Returns
CounterMetric|GaugeMetric|TimingMetric|NullMetric

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 140 of file GaugeMetric.php.

◆ getComponent()

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

Returns
string

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 83 of file GaugeMetric.php.

◆ getLabelKeys()

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

Returns the list of defined label keys.

Returns
string[]

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 115 of file GaugeMetric.php.

◆ getName()

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

Returns
string

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 78 of file GaugeMetric.php.

◆ getSampleRate()

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

Returns
float

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 98 of file GaugeMetric.php.

◆ getSamples()

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

Returns subset of samples corresponding to sample rate setting.

Returns
Sample[]

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 93 of file GaugeMetric.php.

◆ getTypeIndicator()

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

Returns
string

Implements Wikimedia\Stats\Metrics\MetricInterface.

Definition at line 88 of file GaugeMetric.php.

◆ set()

Wikimedia\Stats\Metrics\GaugeMetric::set ( float $value)

Sets metric to value.

Parameters
float$value
Returns
void

Definition at line 69 of file GaugeMetric.php.

◆ withLabel()

Wikimedia\Stats\Metrics\GaugeMetric::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 120 of file GaugeMetric.php.

◆ withSampleRate()

Wikimedia\Stats\Metrics\GaugeMetric::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 103 of file GaugeMetric.php.


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