Revert "Add metrics for nodes online and offline (#11050)"

This reverts commit f60bbdf86b.
This commit is contained in:
Harshavardhana
2020-12-08 09:23:35 -08:00
parent 6b7ced80fe
commit 4a564336fe
4 changed files with 31 additions and 88 deletions

View File

@@ -200,22 +200,13 @@ func (c *Client) MarkOffline() {
if atomic.LoadInt32(&c.connected) == closed {
return
}
if c.CheckOnlineStatus() {
if c.HealthCheckFn() {
atomic.CompareAndSwapInt32(&c.connected, offline, online)
logger.Info("Client %s online", c.url.String())
return
}
time.Sleep(time.Duration(r.Float64() * float64(c.HealthCheckInterval)))
}
}()
}
}
// CheckOnlineStatus checks if a client is online.
func (c *Client) CheckOnlineStatus() bool {
if c.HealthCheckFn != nil {
if c.HealthCheckFn() {
return true
}
}
return false
}