MCPcopy Index your code
hub / github.com/coder/coder / GaugeValue

Function GaugeValue

coderd/coderdtest/promhelp/metrics.go:50–56  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

48
49// GaugeValue returns the value of a gauge metric with the given name and labels.
50func 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.
59func CounterValue(t testing.TB, reg prometheus.Gatherer, metricName string, labels prometheus.Labels) int {

Callers 3

TestConcurrencyFunction · 0.92
TestReleaseFunction · 0.92
TestGithubRateLimitsFunction · 0.92

Calls 3

MetricValueFunction · 0.85
HelperMethod · 0.65
GetValueMethod · 0.45

Tested by 3

TestConcurrencyFunction · 0.74
TestReleaseFunction · 0.74
TestGithubRateLimitsFunction · 0.74