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

Detailed Description

Metric type that contains the labels: typing.Dict[str, str] and value: int.

The type is hashable and comparable:

# Checking for a particular metric
assert metrics.Metric({}, value=3) in values['sample']
# Comparing with a set of Metric
assert values['sample'] == {
metrics.Metric(labels={}, value=3),
metrics.Metric(labels={'label': 'b'}, value=2),
metrics.Metric(labels={'label': 'a'}, value=1),
}

Definition at line 70 of file metrics.py.

+ Collaboration diagram for pytest_userver.metrics.Metric:

Public Member Functions

bool __eq__ (self, typing.Any other)
 
int __hash__ (self)
 

Public Attributes

 labels
 
 value
 

Static Public Attributes

typing labels .Dict[str, str]
 
MetricValue value
 

Protected Attributes

 _type
 

Member Function Documentation

◆ __eq__()

bool pytest_userver.metrics.Metric.__eq__ ( self,
typing.Any other )

Definition at line 89 of file metrics.py.

◆ __hash__()

int pytest_userver.metrics.Metric.__hash__ ( self)

Definition at line 98 of file metrics.py.

Member Data Documentation

◆ _type

pytest_userver.metrics.Metric._type
protected

Definition at line 95 of file metrics.py.

◆ labels [1/2]

typing pytest_userver.metrics.Metric.labels .Dict[str, str]
static

Definition at line 81 of file metrics.py.

◆ labels [2/2]

pytest_userver.metrics.Metric.labels

Definition at line 93 of file metrics.py.

◆ value [1/2]

MetricValue pytest_userver.metrics.Metric.value
static

Definition at line 82 of file metrics.py.

◆ value [2/2]

pytest_userver.metrics.Metric.value

Definition at line 94 of file metrics.py.


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