diff options
| author | Jeff Carr <[email protected]> | 2024-11-13 18:53:13 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-13 18:53:13 -0600 |
| commit | bd2ddb278c2439cb87c62766a0983bd2e1ff6a74 (patch) | |
| tree | 351124a806be320d3efa632a1b4dd8cd95dd149f /dump.go | |
| parent | 0697375d44f9a4a93b1ff13a33809fe9e905b6d4 (diff) | |
better poll hyper outputv0.2.12
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'dump.go')
| -rw-r--r-- | dump.go | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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 { |
