Browse Source

tm-monitor: update health after we added / removed node (#2694)

Refs #2693
checked_ints
zhangzheng 6 years ago
committed by Anton Kaliaev
parent
commit
bbf15b3d09
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      tools/tm-monitor/monitor/network.go

+ 8
- 0
tools/tm-monitor/monitor/network.go View File

@ -140,14 +140,22 @@ func (n *Network) NodeIsOnline(name string) {
// NewNode is called when the new node is added to the monitor.
func (n *Network) NewNode(name string) {
n.mu.Lock()
defer n.mu.Unlock()
n.NumNodesMonitored++
n.NumNodesMonitoredOnline++
n.updateHealth()
}
// NodeDeleted is called when the node is deleted from under the monitor.
func (n *Network) NodeDeleted(name string) {
n.mu.Lock()
defer n.mu.Unlock()
n.NumNodesMonitored--
n.NumNodesMonitoredOnline--
n.updateHealth()
}
func (n *Network) updateHealth() {


Loading…
Cancel
Save