From f80ba127d8fe2c706a1fbc7e8ade5e17b5b30b7b Mon Sep 17 00:00:00 2001 From: Jan Novak Date: Sat, 29 Aug 2026 00:05:00 +0200 Subject: [PATCH] body-drain: rename server stat new= to accepted_total= to avoid reading it as open conns Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GbnJj9ZqEx9nUvzkjdwfMq --- 99-experiments/body-drain/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/99-experiments/body-drain/main.go b/99-experiments/body-drain/main.go index faba84f..d4fd088 100644 --- a/99-experiments/body-drain/main.go +++ b/99-experiments/body-drain/main.go @@ -143,7 +143,9 @@ func serveForever(addr string) { s.close() return case <-tick.C: - fmt.Printf("%s new=%d active=%d goroutines=%d\n", + // accepted_total only ever grows (every conn ever accepted); + // active is what's open right now. + fmt.Printf("%s accepted_total=%d active=%d goroutines=%d\n", time.Now().Format("15:04:05"), s.newConns.Load(), s.activeConns.Load(), runtime.NumGoroutine()) } }