Update exported status metric to properly reflect alerting status of a monitor

It was using the result of the individual check and not the monitor as a whole
This commit is contained in:
Ian Fijolek
2020-07-14 17:09:56 -07:00
parent 5dc5ba5257
commit aad9eaa32f
3 changed files with 7 additions and 6 deletions
+3 -3
View File
@@ -56,7 +56,7 @@ func TestMonitorShouldCheck(t *testing.T) {
}
}
// TestMonitorIsUp tests the Monitor.isUp()
// TestMonitorIsUp tests the Monitor.IsUp()
func TestMonitorIsUp(t *testing.T) {
cases := []struct {
monitor Monitor
@@ -71,9 +71,9 @@ func TestMonitorIsUp(t *testing.T) {
for _, c := range cases {
log.Printf("Testing case %s", c.name)
actual := c.monitor.isUp()
actual := c.monitor.IsUp()
if actual != c.expected {
t.Errorf("isUp(%v), expected=%t actual=%t", c.name, c.expected, actual)
t.Errorf("IsUp(%v), expected=%t actual=%t", c.name, c.expected, actual)
log.Printf("Case failed: %s", c.name)
}
log.Println("-----")