HistogramStopWatchVec
HistogramStopWatchVec implements a stopwatch style interface that works with prometheus histogram
Methods
WithLabelValues()
@classmethod
def WithLabelValues(
values: string
) - > HistogramStopWatch
Retrieves a HistogramStopWatch instance with specific label values. Callers use this to obtain a stopwatch for a particular set of metric dimensions.
Parameters
| Name | Type | Description |
|---|---|---|
| values | string | The label values to associate with the HistogramStopWatch, typically provided as a variadic argument list. |
Returns
| Type | Description |
|---|---|
HistogramStopWatch | A HistogramStopWatch instance configured with the provided label values. |
GetMetricWith()
@classmethod
def GetMetricWith(
labels: prometheus.Labels
) - > (HistogramStopWatch, error)
Retrieves a HistogramStopWatch instance associated with the given Prometheus labels. This method allows callers to get a specific metric vector element for observation.
Parameters
| Name | Type | Description |
|---|---|---|
| labels | prometheus.Labels | A map of label names to label values used to identify the specific metric vector element. |
Returns
| Type | Description |
|---|---|
(HistogramStopWatch, error) | A tuple containing the HistogramStopWatch instance and an error if the metric could not be retrieved or created. |