Python module that provides helpers for functional testing of metrics with testsuite; see Functional service tests (testsuite) for an introduction.
Classes | |
| class | Histogram |
| Represents the value of a HIST_RATE (a.k.a. More... | |
| class | Metric |
| Metric type that contains the labels: dict[str, str] and value: int. More... | |
| class | _MetricsJSONEncoder |
| class | MetricsSnapshot |
| Snapshot of captured metrics that mimics the dict interface. More... | |
Functions | |
| bool | _type_eq (MetricType lhs, MetricType rhs) |
| tuple[tuple[str, str],...] | _get_labels_tuple (Metric metric) |
| Returns labels as a tuple of sorted items. | |
| float | _do_compute_percentile (Histogram hist, float percent) |
| MetricValue | _parse_metric_value (Any value) |
| _FlattenedSnapshot | _flatten_snapshot (values, bool ignore_zeros) |
| str | _diff_metric_snapshots (_FlattenedSnapshot lhs, _FlattenedSnapshot rhs, bool ignore_zeros) |
Variables | |
| TypeAlias | _FlattenedSnapshot = Set[tuple[str, Metric]] |
|
protected |
Definition at line 411 of file metrics.py.
|
protected |
Definition at line 362 of file metrics.py.
|
protected |
Definition at line 402 of file metrics.py.
|
protected |
Returns labels as a tuple of sorted items.
Definition at line 357 of file metrics.py.
|
protected |
Definition at line 384 of file metrics.py.
|
protected |
Definition at line 353 of file metrics.py.
|
protected |
Definition at line 399 of file metrics.py.