summaryrefslogtreecommitdiff
path: root/dump.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-28 11:44:53 -0500
committerJeff Carr <[email protected]>2024-10-28 11:44:53 -0500
commitc26699571d65178fe94390617d26055f8c1daf6f (patch)
treecf424079476e5e2fa491477fe545294df16277aa /dump.go
parent42d54a418d05192e2f19c443e4ac3c5594340a5e (diff)
ready to release a debian package?
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'dump.go')
-rw-r--r--dump.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/dump.go b/dump.go
index 511312b..dcec8a8 100644
--- a/dump.go
+++ b/dump.go
@@ -49,6 +49,8 @@ func dumpDroplets(w http.ResponseWriter) {
// status of the hypervisors
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)
@@ -57,12 +59,19 @@ func dumpHypervisors(w http.ResponseWriter) {
for name, t := range h.lastDroplets {
dur := time.Since(t)
tmp := shell.FormatDuration(dur)
+ totalDroplets += 1
d := findDroplet(name)
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.CurrentState)
}
}
}
+ if totalUnknownDroplets == 0 {
+ fmt.Fprintln(w, "\tTotal Droplets", totalDroplets)
+ } else {
+ fmt.Fprintln(w, "\tTotal Droplets", totalDroplets, "total libvirt only droplets =", totalUnknownDroplets)
+ }
}