MediaWiki master
Wikimedia\Stats\Metrics\HistogramMetric Class Reference

Histogram Metric Implementation. More...

Public Member Functions

 __construct (StatsFactory $statsFactory, string $name, array $buckets)
 
 fresh ()
 Returns metric with cleared labels.
 
 observe (float $value)
 Increments bucket associated with the provided value.
 
 setLabel (string $key, string $value)
 Adds a label $key with $value.
 

Detailed Description

Histogram Metric Implementation.

Histogram Metrics are a collection of CounterMetric arranged into buckets.

Author
Cole White
Since
1.44

Definition at line 22 of file HistogramMetric.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Stats\Metrics\HistogramMetric::__construct ( StatsFactory $statsFactory,
string $name,
array $buckets )

Definition at line 32 of file HistogramMetric.php.

Member Function Documentation

◆ fresh()

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

Returns metric with cleared labels.

Returns
HistogramMetric

Definition at line 117 of file HistogramMetric.php.

◆ observe()

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

Increments bucket associated with the provided value.

Definition at line 75 of file HistogramMetric.php.

◆ setLabel()

Wikimedia\Stats\Metrics\HistogramMetric::setLabel ( string $key,
string $value )

Adds a label $key with $value.

No order is respected.

Returns
HistogramMetric

Definition at line 106 of file HistogramMetric.php.


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