summaryrefslogtreecommitdiff
path: root/dump.go
diff options
context:
space:
mode:
Diffstat (limited to 'dump.go')
-rw-r--r--dump.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/dump.go b/dump.go
index 57a3404..9291bb1 100644
--- a/dump.go
+++ b/dump.go
@@ -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)
+ }
+ }
+ }
+}