MediaWiki  master
Wikimedia\Stats\Metrics\BaseMetricInterface Interface Reference

Base Metric Interface. More...

Inheritance diagram for Wikimedia\Stats\Metrics\BaseMetricInterface:

Public Member Functions

 __construct (string $component, string $name)
 
 addLabel (string $key, string $value)
 Add a label with key => value. More...
 
 addSample (Sample $sample)
 Records a Metric Sample. More...
 
 clearLabels ()
 Clears the working labels. More...
 
 getComponent ()
 Returns the Metric Component. More...
 
 getLabelKeys ()
 Returns array of label keys. More...
 
 getLabelValues ()
 Returns an array of label values with static label values in the order of label keys. More...
 
 getName ()
 Returns the Metric Name. More...
 
 getSampleRate ()
 Returns the configured sample rate. More...
 
 getSamples ()
 Returns subset of samples corresponding to sample rate setting. More...
 
 getStatsdDataFactory ()
 Gets StatsD Data Factory instance or null. More...
 
 setSampleRate (float $sampleRate)
 Sets the sample rate. More...
 
 withStaticLabels (array $labelKeys, array $labelValues)
 Configures the metric with static labels. More...
 
 withStatsdDataFactory (IBufferingStatsdDataFactory $statsdDataFactory)
 StatsD Data Factory instance to copy metrics to. More...
 

Detailed Description

Base Metric Interface.

Interface for defining a Base Metric.

Author
Cole White
Since
1.41

Definition at line 35 of file BaseMetricInterface.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Stats\Metrics\BaseMetricInterface::__construct ( string  $component,
string  $name 
)
Parameters
string$componentThe component this metric will track.
string$nameThe Metric Name.

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

Member Function Documentation

◆ addLabel()

Wikimedia\Stats\Metrics\BaseMetricInterface::addLabel ( string  $key,
string  $value 
)

Add a label with key => value.

Parameters
string$key
string$value
Returns
void

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ addSample()

Wikimedia\Stats\Metrics\BaseMetricInterface::addSample ( Sample  $sample)

Records a Metric Sample.

Parameters
Sample$sample
Returns
void

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ clearLabels()

Wikimedia\Stats\Metrics\BaseMetricInterface::clearLabels ( )

Clears the working labels.

Returns
void

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ getComponent()

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

Returns the Metric Component.

Returns
string

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ getLabelKeys()

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

Returns array of label keys.

Returns
string[]

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ getLabelValues()

Wikimedia\Stats\Metrics\BaseMetricInterface::getLabelValues ( )

Returns an array of label values with static label values in the order of label keys.

Returns
string[]

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ getName()

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

Returns the Metric Name.

Returns
string

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ getSampleRate()

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

Returns the configured sample rate.

Returns
float

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ getSamples()

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

Returns subset of samples corresponding to sample rate setting.

Returns
Sample[]

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ getStatsdDataFactory()

Wikimedia\Stats\Metrics\BaseMetricInterface::getStatsdDataFactory ( )

Gets StatsD Data Factory instance or null.

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ setSampleRate()

Wikimedia\Stats\Metrics\BaseMetricInterface::setSampleRate ( float  $sampleRate)

Sets the sample rate.

Parameters
float$sampleRate

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ withStaticLabels()

Wikimedia\Stats\Metrics\BaseMetricInterface::withStaticLabels ( array  $labelKeys,
array  $labelValues 
)

Configures the metric with static labels.

Parameters
string[]$labelKeys
string[]$labelValues
Returns
BaseMetricInterface

Implemented in Wikimedia\Stats\Metrics\BaseMetric.

◆ withStatsdDataFactory()

Wikimedia\Stats\Metrics\BaseMetricInterface::withStatsdDataFactory ( IBufferingStatsdDataFactory  $statsdDataFactory)

StatsD Data Factory instance to copy metrics to.

Parameters
IBufferingStatsdDataFactory$statsdDataFactory
Returns
BaseMetricInterface

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