diff options
| author | Jeff Carr <[email protected]> | 2024-10-13 00:40:22 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-13 00:40:22 -0500 |
| commit | 62e9d8cfb1563ea7dbedf26a0dc593e4227cf413 (patch) | |
| tree | 69447443957681d21ffecc1b1b4a83670b542242 /poll.go | |
| parent | ba61b7863168c03812578d74fbe1e4532eb8b6a5 (diff) | |
cleanup STDOUT debugging
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'poll.go')
| -rw-r--r-- | poll.go | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -8,7 +8,7 @@ import ( "go.wit.com/log" ) -func (h HyperT) pollHypervisor() { +func (h *HyperT) pollHypervisor() { url := "http://" + h.Hostname + ":2520/vms" log.Log(POLL, "wget url =", url) s := shell.Wget(url) @@ -55,7 +55,7 @@ func (h HyperT) pollHypervisor() { log.Log(EVENT, name, "IS NEW. ADDED ON", h.Hostname) } } - // log.Info("i, s =", hostname, i, s) + h.lastpoll = time.Now() } func findDroplet(name string) *DropletT { @@ -74,6 +74,10 @@ func clusterHealthy() bool { continue } dur := time.Since(d.lastpoll) // Calculate the elapsed time + if d.CurrentState == "" { + // log.Info("SKIP. hostname has not been polled yet", d.Hostname, d.hname) + continue + } if d.CurrentState != "ON" { log.Info("BAD STATE", d.State, d.Hostname, d.hname, "CurrentState =", d.CurrentState, shell.FormatDuration(dur)) good = false @@ -84,13 +88,12 @@ func clusterHealthy() bool { good = false d.CurrentState = "MISSING" } - log.Info("GOOD STATE ON", d.Hostname, d.hname, shell.FormatDuration(dur)) + l := shell.FormatDuration(dur) + if l == "" { + log.Info("DUR IS EMPTY", dur) + } + // log.Info("GOOD STATE ON", d.Hostname, d.hname, "dur =", l) } } - if good { - log.Info("GOOD=true") - } else { - log.Info("GOOD=false") - } return good } |
