CounterValue returns the value of a counter metric with the given name and labels.
(t testing.TB, reg prometheus.Gatherer, metricName string, labels prometheus.Labels)
| 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 { |
| 60 | t.Helper() |
| 61 | |
| 62 | labeled := MetricValue(t, reg, metricName, labels) |
| 63 | require.NotNilf(t, labeled, "metric %q with labels %v not found", metricName, labels) |
| 64 | return int(labeled.GetCounter().GetValue()) |
| 65 | } |
| 66 | |
| 67 | func MetricValue(t testing.TB, reg prometheus.Gatherer, metricName string, labels prometheus.Labels) *io_prometheus_client.Metric { |
| 68 | t.Helper() |