HistogramStopWatchVec
HistogramStopWatchVec implements a stopwatch style interface that works with prometheus histogram
Methods
WithLabelValues()
@classmethod
def WithLabelValues(
values: string
) - > [HistogramStopWatch](labeled/histogramstopwatch.md?sid=flytestdlib_promutils_labeled_histogramstopwatch)
Retrieves a HistogramStopWatch instance with specific label values. Call this method to obtain a stopwatch that will record observations with the provided labels.
Parameters
| Name | Type | Description |
|---|---|---|
| values | string | The label values to associate with the HistogramStopWatch. These values correspond to the labels defined when the HistogramStopWatchVec was created. |
Returns
| Type | Description |
|---|---|
[HistogramStopWatch](labeled/histogramstopwatch.md?sid=flytestdlib_promutils_labeled_histogramstopwatch) | A HistogramStopWatch instance configured with the specified label values. |
GetMetricWith()
@classmethod
def GetMetricWith(
labels: prometheus.Labels
) - > ([HistogramStopWatch](labeled/histogramstopwatch.md?sid=flytestdlib_promutils_labeled_histogramstopwatch), error)
Retrieves a HistogramStopWatch instance for a given set of Prometheus labels. This method allows you to get a specific stopwatch metric by providing a map of label names to their values.
Parameters
| Name | Type | Description |
|---|---|---|
| labels | prometheus.Labels | A map of label names to their corresponding string values, used to identify the specific HistogramStopWatch metric. |
Returns
| Type | Description |
|---|---|
([HistogramStopWatch](labeled/histogramstopwatch.md?sid=flytestdlib_promutils_labeled_histogramstopwatch), error) | A tuple containing the HistogramStopWatch instance and an error if the metric could not be retrieved or created. |