userver: pytest_userver.metrics.Histogram Class Reference
Loading...
Searching...
No Matches
pytest_userver.metrics.Histogram Class Reference

Detailed Description

Represents the value of a HIST_RATE (a.k.a.

Histogram) metric.

Usage example:

histogram = metrics.Histogram(
bounds=[10, 20, 30],
buckets=[1, 3, 4],
inf=3,
)
assert histogram.count() == 11
assert histogram.percentile(0.6) == 30

Normally obtained from MetricsSnapshot

Definition at line 40 of file metrics.py.

Public Member Functions

int count (self)
 
float percentile (self, float percent)
 

Static Public Attributes

list bounds [float]
 
list buckets [int]
 
TypeAlias MetricValue = float | Histogram
 

Member Function Documentation

◆ count()

int pytest_userver.metrics.Histogram.count ( self)

Definition at line 54 of file metrics.py.

◆ percentile()

float pytest_userver.metrics.Histogram.percentile ( self,
float percent )

Definition at line 57 of file metrics.py.

Member Data Documentation

◆ bounds

list pytest_userver.metrics.Histogram.bounds [float]
static

Definition at line 50 of file metrics.py.

◆ buckets

pytest_userver.metrics.Histogram.buckets [int]
static

Definition at line 51 of file metrics.py.

◆ MetricValue

TypeAlias pytest_userver.metrics.Histogram.MetricValue = float | Histogram
static

Definition at line 71 of file metrics.py.


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