summaryrefslogtreecommitdiff
path: root/windowHypervisors.go
diff options
context:
space:
mode:
Diffstat (limited to 'windowHypervisors.go')
-rw-r--r--windowHypervisors.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/windowHypervisors.go b/windowHypervisors.go
index 4db757b..31da9f6 100644
--- a/windowHypervisors.go
+++ b/windowHypervisors.go
@@ -5,6 +5,7 @@ package main
import (
"sync"
+ "time"
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
@@ -64,6 +65,33 @@ func (dw *stdHypervisorTableWin) doStdHypervisors(pb *virtpb.Hypervisors) {
t.AddHostname()
t.AddMemory()
t.AddCpus()
+ t.AddKillcount()
+ t.AddTimeFunc("last poll", func(h *virtpb.Hypervisor) time.Time {
+ // hm := me.hmap[h]
+ // tmp := hm.lastpoll
+ // log.Info("poll age", h.Hostname, virtpb.FormatDuration(time.Since(tmp)))
+ return time.Now()
+ })
+ t.AddStringFunc("droplets", func(h *virtpb.Hypervisor) string {
+ /*
+ var totalDroplets int
+ var totalUnknownDroplets int
+ // dur := time.Since(h.lastpoll)
+ // tmp := virtpb.FormatDuration(dur)
+ // fmt.Fprintln(w, h.pb.Hostname, "killcount =", h.killcount, "lastpoll:", tmp)
+ hm := me.hmap[h]
+ for name, _ := range hm.lastDroplets {
+ totalDroplets += 1
+ d := me.cluster.FindDropletByName(name)
+ if d == nil {
+ totalUnknownDroplets += 1
+ }
+ }
+ log.Printf("Total Droplets %d total libvirt only droplets = %d\n", totalDroplets, totalUnknownDroplets)
+ return fmt.Sprintf("%d", totalDroplets)
+ */
+ return "todo"
+ })
// display the protobuf
dw.TB = t