Add --monitor: live status view (downstream health, GPU lock, queue) via the control channel
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user