GaugeValue returns the value of a gauge metric with the given name and labels.
(t testing.TB, reg prometheus.Gatherer, metricName string, labels prometheus.Labels)
| 48 | |
| 49 | // GaugeValue returns the value of a gauge metric with the given name and labels. |
| 50 | func GaugeValue(t testing.TB, reg prometheus.Gatherer, metricName string, labels prometheus.Labels) int { |
| 51 | t.Helper() |
| 52 | |
| 53 | labeled := MetricValue(t, reg, metricName, labels) |
| 54 | require.NotNilf(t, labeled, "metric %q with labels %v not found", metricName, labels) |
| 55 | return int(labeled.GetGauge().GetValue()) |
| 56 | } |
| 57 | |
| 58 | // CounterValue returns the value of a counter metric with the given name and labels. |
| 59 | func CounterValue(t testing.TB, reg prometheus.Gatherer, metricName string, labels prometheus.Labels) int { |