Add POST /api/admin/reset-latency endpoint
Zeroes block-update latency counters (count, sum, last, wasted work) in both memory and the kv store. Used by the StartOS reset-latency action to let operators start fresh after tuning.
This commit is contained in:
@@ -38,6 +38,7 @@ func (s *Server) Handler() http.Handler {
|
||||
mux.HandleFunc("GET /api/snapshot", s.snapshot)
|
||||
mux.HandleFunc("GET /api/ws", s.handleWS)
|
||||
mux.HandleFunc("GET /api/admin/debug-blocks", s.debugBlocks)
|
||||
mux.HandleFunc("POST /api/admin/reset-latency", s.resetLatency)
|
||||
mux.Handle("/", spaHandler(webui.FS()))
|
||||
return mux
|
||||
}
|
||||
@@ -208,3 +209,8 @@ func (s *Server) debugBlocks(w http.ResponseWriter, r *http.Request) {
|
||||
"db": db,
|
||||
})
|
||||
}
|
||||
|
||||
func (s *Server) resetLatency(w http.ResponseWriter, _ *http.Request) {
|
||||
s.Agg.ResetLatency()
|
||||
writeJSON(w, http.StatusOK, map[string]any{"ok": true})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user