summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--http.go10
-rw-r--r--windowZood.go5
2 files changed, 11 insertions, 4 deletions
diff --git a/http.go b/http.go
index 7534b87..cc19929 100644
--- a/http.go
+++ b/http.go
@@ -8,6 +8,7 @@ import (
"io/ioutil"
"net/http"
"strings"
+ "time"
"go.wit.com/log"
)
@@ -83,10 +84,13 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
}
var count int
var bad int
- all := me.machines.All()
- for all.Scan() {
- m := all.Next()
+ for m := range me.machines.IterAll() {
count += 1
+ if m.SinceLastUpdate() > 10*time.Minute {
+ // skip machines that have not been updated in the last 10 minutes
+ log.Info("ignoring old machine", m.Hostname)
+ continue
+ }
if findVersion(m, "zood") != me.zood.version {
bad += 1
}
diff --git a/windowZood.go b/windowZood.go
index d90a662..a2931dd 100644
--- a/windowZood.go
+++ b/windowZood.go
@@ -123,7 +123,10 @@ func AddMachinesPB(tbox *gui.Node, pb *zoopb.Machines) *zoopb.MachinesTable {
t.AddMemory()
t.AddCpus()
t.AddStringFunc("sMB", func(m *zoopb.Machine) string {
- return fmt.Sprintf("%d mb", m.Memory/(1024*1024))
+ if m.Memory/(1024*1024) > 10000 {
+ return fmt.Sprintf("%4d G", m.Memory/(1024*1024*1024))
+ }
+ return fmt.Sprintf("%4d M", m.Memory/(1024*1024))
})
t.AddStringFunc("zood", func(m *zoopb.Machine) string {