better poll hyper output
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
0697375d44
commit
bd2ddb278c
11
dump.go
11
dump.go
|
@ -6,6 +6,7 @@ import (
|
|||
"time"
|
||||
|
||||
pb "go.wit.com/lib/protobuf/virtbuf"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
/*
|
||||
|
@ -76,21 +77,17 @@ func dumpHypervisors(w http.ResponseWriter) {
|
|||
var totalDroplets int
|
||||
var totalUnknownDroplets int
|
||||
for _, h := range me.hypers {
|
||||
// lastpoll time.Time // the last time the hypervisor polled
|
||||
dur := time.Since(h.lastpoll)
|
||||
tmp := pb.FormatDuration(dur)
|
||||
fmt.Fprintln(w, h.pb.Hostname, "killcount =", h.killcount, "lastpoll:", tmp)
|
||||
for name, t := range h.lastDroplets {
|
||||
dur := time.Since(t)
|
||||
tmp := pb.FormatDuration(dur)
|
||||
for name, _ := range h.lastDroplets {
|
||||
totalDroplets += 1
|
||||
d := me.cluster.FindDropletByName(name)
|
||||
header := d.SprintDumpHeader() + " "
|
||||
if d == nil {
|
||||
totalUnknownDroplets += 1
|
||||
fmt.Fprintln(w, "\t", h.pb.Hostname, "name =", name, "lastpoll:", tmp)
|
||||
} else {
|
||||
fmt.Fprintln(w, "\t", h.pb.Hostname, "name =", name, "lastpoll:", tmp, d.Current.State)
|
||||
}
|
||||
log.Info("\t", header, d.Hostname)
|
||||
}
|
||||
}
|
||||
if totalUnknownDroplets == 0 {
|
||||
|
|
Loading…
Reference in New Issue