diff options
| author | Jeff Carr <[email protected]> | 2024-10-27 11:02:50 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-27 11:02:50 -0500 |
| commit | 8fc2fbd9c9a6f05852cd597b246f0b4e634af7d7 (patch) | |
| tree | 707c6044781eb4ef1f3ed9c4b756f6e605e4b6c8 /dump.go | |
| parent | d38865a6cf3d9e11803e9f565a0dd0c763de479d (diff) | |
track droplets reported from each hypervisor
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'dump.go')
| -rw-r--r-- | dump.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -4,7 +4,9 @@ import ( "fmt" "net/http" "strings" + "time" + "go.wit.com/lib/gui/shell" pb "go.wit.com/lib/protobuf/virtbuf" ) @@ -44,3 +46,23 @@ func dumpDroplets(w http.ResponseWriter) { } } } + +// status of the hypervisors +func dumpHypervisors(w http.ResponseWriter) { + for _, h := range me.hypers { + // lastpoll time.Time // the last time the hypervisor polled + dur := time.Since(h.lastpoll) + tmp := shell.FormatDuration(dur) + fmt.Fprintln(w, h.pb.Hostname, "killcount =", h.killcount, "lastpoll:", tmp) + for name, t := range h.lastDroplets { + dur := time.Since(t) + tmp := shell.FormatDuration(dur) + d := findDroplet(name) + if d == nil { + fmt.Fprintln(w, "\t", h.pb.Hostname, "name =", name, "lastpoll:", tmp) + } else { + fmt.Fprintln(w, "\t", h.pb.Hostname, "name =", name, "lastpoll:", tmp, d.CurrentState) + } + } + } +} |
