diff --git a/dump.go b/dump.go index f0e1a2d..7bdd6be 100644 --- a/dump.go +++ b/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 {