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 35 of file metrics.py.

+ Collaboration diagram for pytest_userver.metrics.Histogram:

Public Member Functions

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

Public Attributes

 buckets
 

Static Public Attributes

typing bounds .List[float]
 
typing buckets .List[int]
 
int inf
 

Member Function Documentation

◆ count()

int pytest_userver.metrics.Histogram.count ( self)

Definition at line 49 of file metrics.py.

◆ percentile()

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

Definition at line 52 of file metrics.py.

Member Data Documentation

◆ bounds

typing pytest_userver.metrics.Histogram.bounds .List[float]
static

Definition at line 45 of file metrics.py.

◆ buckets [1/2]

typing pytest_userver.metrics.Histogram.buckets .List[int]
static

Definition at line 46 of file metrics.py.

◆ buckets [2/2]

pytest_userver.metrics.Histogram.buckets

Definition at line 50 of file metrics.py.

◆ inf

int pytest_userver.metrics.Histogram.inf
static

Definition at line 47 of file metrics.py.


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