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

Method WithLabelValues

coderd/prometheusmetrics/collector.go:58–73  ·  view source on GitHub ↗
(operation VectorOperation, value float64, labelValues ...string)

Source from the content-addressed store, hash-verified

56}
57
58func (v *CachedGaugeVec) WithLabelValues(operation VectorOperation, value float64, labelValues ...string) {
59 switch operation {
60 case VectorOperationAdd, VectorOperationSet:
61 default:
62 panic("unsupported vector operation")
63 }
64
65 v.m.Lock()
66 defer v.m.Unlock()
67
68 v.records = append(v.records, vectorRecord{
69 operation: operation,
70 value: value,
71 labelValues: labelValues,
72 })
73}
74
75// Commit will set the internal value as the cached value to return from "Collect()".
76// The internal metric value is completely reset, so the caller should expect

Callers 15

TestCollector_AddFunction · 0.95
TestCollector_SetFunction · 0.95
TestCollector_Set_AddFunction · 0.95
AgentsFunction · 0.95
AgentStatsFunction · 0.95
dialContextMethod · 0.80
CloseMethod · 0.80
PrometheusFunction · 0.80

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45