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

Method RecordReloadAttempt

coderd/aibridged/metrics.go:67–72  ·  view source on GitHub ↗

RecordReloadAttempt stamps the attempt-time gauge at the start of a reload. A reload that hangs mid-flight is detected by watching the gap between this gauge and ProvidersLastReloadSuccessTimestampSeconds.

()

Source from the content-addressed store, hash-verified

65// reload. A reload that hangs mid-flight is detected by watching the
66// gap between this gauge and ProvidersLastReloadSuccessTimestampSeconds.
67func (m *Metrics) RecordReloadAttempt() {
68 if m == nil {
69 return
70 }
71 m.ProvidersLastReloadTimestampSeconds.Set(float64(time.Now().Unix()))
72}
73
74// RecordReloadSuccess rewrites the ProviderInfo GaugeVec from the
75// outcomes and stamps the success-time gauge. Reset clears series for

Callers 4

TestMetricsNilSafeFunction · 0.95
ReloadMethod · 0.80
ReloadMethod · 0.80

Calls 1

SetMethod · 0.65

Tested by 3

TestMetricsNilSafeFunction · 0.76
ReloadMethod · 0.64