Add --monitor: live status view (downstream health, GPU lock, queue) via the control channel

This commit is contained in:
mram
2026-09-22 08:17:05 +02:00
parent a74cd49fe5
commit 16dc7fe462
9 changed files with 472 additions and 22 deletions
+18
View File
@@ -164,6 +164,24 @@ func (p *Process) Running() bool {
return p.cmd != nil
}
// Status describes the child for status displays: "external" when something
// else serves the port, "running" once ready, "starting" while the child
// boots, "stopped" otherwise.
func (p *Process) Status() string {
p.mu.Lock()
defer p.mu.Unlock()
switch {
case p.external:
return "external"
case p.cmd == nil:
return "stopped"
case p.ready:
return "running"
default:
return "starting"
}
}
// Ready reports whether the server has answered a probe since its last
// (re)start. Health checks use it to tell "starting up" from "outage".
func (p *Process) Ready() bool {