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

Function HistogramValue

coderd/coderdtest/promhelp/metrics.go:41–47  ·  view source on GitHub ↗

HistogramValue returns the value of a histogram 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

39
40// HistogramValue returns the value of a histogram metric with the given name and labels.
41func HistogramValue(t testing.TB, reg prometheus.Gatherer, metricName string, labels prometheus.Labels) *io_prometheus_client.Histogram {
42 t.Helper()
43
44 labeled := MetricValue(t, reg, metricName, labels)
45 require.NotNilf(t, labeled, "metric %q with labels %v not found", metricName, labels)
46 return labeled.GetHistogram()
47}
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 {

Callers 4

TestInTxMetricsFunction · 0.92
TestMetricsFunction · 0.92
TestUpdateLifecycleFunction · 0.92

Calls 2

MetricValueFunction · 0.85
HelperMethod · 0.65

Tested by 4

TestInTxMetricsFunction · 0.74
TestMetricsFunction · 0.74
TestUpdateLifecycleFunction · 0.74