-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
use tools/tm-monitor to monitor a full node, open url http://127.0.0.1:26670/status/network, I find the health is always equal to FullHealth, but I find it is wrong, because the monitored node is not a validator node, the health Should be equal to ModerateHealth.
func (n *Network) updateHealth() {
// if we are connected to all validators, we're at full health
// TODO: make sure they're all at the same height (within a block)
// and all proposing (and possibly validating ) Alternatively, just
// check there hasn't been a new round in numValidators rounds
if n.NumValidators != 0 && n.NumNodesMonitoredOnline == n.NumValidators {
n.Health = FullHealth
} else if n.NumNodesMonitoredOnline > 0 && n.NumNodesMonitoredOnline <= n.NumNodesMonitored {
n.Health = ModerateHealth
} else {
n.Health = Dead
}
}
The following two functions modify NumNodesMonitoredOnline, function updateHealth() should be called, am I right?
// NewNode is called when the new node is added to the monitor.
func (n *Network) NewNode(name string) {
n.NumNodesMonitored++
n.NumNodesMonitoredOnline++
}
// NodeDeleted is called when the node is deleted from under the monitor.
func (n *Network) NodeDeleted(name string) {
n.NumNodesMonitored--
n.NumNodesMonitoredOnline--
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels