Use simpler health calculation

This commit is contained in:
Joshua Boniface 2023-12-07 11:17:31 -05:00
parent a13273335d
commit 60dac143f2
1 changed files with 3 additions and 8 deletions

View File

@ -683,14 +683,9 @@ class MonitoringInstance(object):
# Map our check results to fault results
# These are not 1-to-1, as faults are cluster-wide.
# So a single node even with a severe fault is not alone enough to make the
# whole cluster report a serious fault. But 2 is, so 25 is chosen here.
if result.health_delta < 10:
fault_delta = 0
elif result.health_delta < 50:
fault_delta = 10
else:
fault_delta = 25
# We divide the delta by two since 2 nodes with the same problem
# should equal what the result says.
fault_delta = int(result.health_delta / 2)
fault_message = (
f"{self.this_node.name} {result.plugin_name}: {result.message}"