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

Method RecordReloadSuccess

coderd/aibridged/metrics.go:78–84  ·  view source on GitHub ↗

RecordReloadSuccess rewrites the ProviderInfo GaugeVec from the outcomes and stamps the success-time gauge. Reset clears series for providers that have left the configuration so they don't linger as stale.

(outcomes []ProviderOutcome)

Source from the content-addressed store, hash-verified

76// providers that have left the configuration so they don't linger as
77// stale.
78func (m *Metrics) RecordReloadSuccess(outcomes []ProviderOutcome) {
79 if m == nil {
80 return
81 }
82 WriteProviderInfoSnapshot(m.ProviderInfo, outcomes)
83 m.ProvidersLastReloadSuccessTimestampSeconds.Set(float64(time.Now().Unix()))
84}
85
86// WriteProviderInfoSnapshot Resets info and writes one series per
87// outcome. Both aibridged and aibridgeproxyd use this so the

Callers 5

TestMetricsNilSafeFunction · 0.95
ReloadMethod · 0.80
ReloadMethod · 0.80

Calls 2

SetMethod · 0.65

Tested by 4

TestMetricsNilSafeFunction · 0.76
ReloadMethod · 0.64