MediaWiki  master
Wikimedia\Metrics\TimingMetric Class Reference
Collaboration diagram for Wikimedia\Metrics\TimingMetric:

Public Member Functions

 __construct (array $config, MetricUtils $metricUtils)
 
 observe (float $value, array $labels=[])
 
 render ()
 
 validateLabels (array $labels=[])
 Validate provided labels. More...
 

Private Attributes

MetricUtils $metricUtils
 

Detailed Description

Definition at line 32 of file TimingMetric.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Metrics\TimingMetric::__construct ( array  $config,
MetricUtils  $metricUtils 
)
Parameters
array$configassociative array:
  • name: (string) The metric name
  • extension: (string) The extension generating the metric
  • labels: (array) List of metric dimensional instantiations for filters and aggregations
  • sampleRate: (float) Optional sampling rate to apply
MetricUtils$metricUtils

Definition at line 54 of file TimingMetric.php.

References Wikimedia\Metrics\TimingMetric\$metricUtils, Wikimedia\Metrics\MetricUtils\setTypeIndicator(), and Wikimedia\Metrics\MetricUtils\validateConfig().

Member Function Documentation

◆ observe()

Wikimedia\Metrics\TimingMetric::observe ( float  $value,
array  $labels = [] 
)
Parameters
float$value
string[]$labels

Definition at line 73 of file TimingMetric.php.

◆ render()

Wikimedia\Metrics\TimingMetric::render ( )
Returns
string[]

Definition at line 84 of file TimingMetric.php.

◆ validateLabels()

Wikimedia\Metrics\TimingMetric::validateLabels ( array  $labels = [])

Validate provided labels.

Parameters
string[]$labels

Definition at line 65 of file TimingMetric.php.

Member Data Documentation

◆ $metricUtils

MetricUtils Wikimedia\Metrics\TimingMetric::$metricUtils
private
Initial value:
=
private const TYPE_INDICATOR 'ms'

Definition at line 44 of file TimingMetric.php.

Referenced by Wikimedia\Metrics\TimingMetric\__construct().


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