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

Struct CachedGaugeVec

coderd/prometheusmetrics/collector.go:19–24  ·  view source on GitHub ↗

CachedGaugeVec is a wrapper for the prometheus.GaugeVec which allows for staging changes in the metrics vector. Calling "WithLabelValues(...)" will update the internal gauge value, but it will not be returned by "Collect(...)" until the "Commit()" method is called. The "Commit()" method resets the i

Source from the content-addressed store, hash-verified

17// in the middle of metrics recalculation, between "Reset()" and the last
18// "WithLabelValues()" call.
19type CachedGaugeVec struct {
20 m sync.Mutex
21
22 gaugeVec *prometheus.GaugeVec
23 records []vectorRecord
24}
25
26var _ prometheus.Collector = new(CachedGaugeVec)
27

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected