You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PUT /api/banner (admin-token-gated, header X-Admin-Token or query param)
updates the dashboard's amber notice in-place. Persisted to
\$STORE_DIR/banner.txt atomically; survives restart. Both GET and PUT
are admin-only (the public still reads the rendered banner via
/api/stats.maintenance_banner). Empty-body PUT clears the banner.
8-case test coverage: 401 without token, 401 wrong token, valid PUT
round-trip, public /api/stats surfaces banner, persistence file
written, empty-body clears, 405 on DELETE.
staleThreshold:=flag.Duration("stale-threshold", 30*time.Minute, "how long since last heartbeat before a node is considered stale on the dashboard (e.g. 30m, 5m). Default 30m tolerates spoof reconnect storms; smaller values give faster dashboard reflection of disconnects.")
42
+
mutexProfileFraction:=flag.Int("mutex-profile-fraction", 1000, "rate for runtime mutex contention profiling (1/N events sampled; 0 = off). Always-on at low overhead so future incidents have profile data ready without scrambling.")
43
+
blockProfileRate:=flag.Int("block-profile-rate", 10000, "rate for runtime blocking profile in nanoseconds (0 = off). Captures goroutines blocked on chan/select/Cond — same rationale as -mutex-profile-fraction.")
36
44
flag.Parse()
37
45
38
46
if*configPath!="" {
@@ -45,6 +53,16 @@ func main() {
45
53
46
54
logging.Setup(*logLevel, *logFormat)
47
55
56
+
// Enable mutex + block profiling early so contention from startup paths
57
+
// is captured. Net runtime cost at the chosen rates is ~1% CPU; the
58
+
// rendezvous endpoint exposes /debug/pprof/{mutex,block} via DefaultServeMux.
0 commit comments