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 -2
View File
@@ -85,12 +85,13 @@ func (monitor *Monitor) Check() (bool, *AlertNotice) {
return isSuccess, alertNotice
}
func (monitor Monitor) isUp() bool {
// IsUp returns the status of the current monitor
func (monitor Monitor) IsUp() bool {
return monitor.alertCount == 0
}
func (monitor *Monitor) success() (notice *AlertNotice) {
if !monitor.isUp() {
if !monitor.IsUp() {
// Alert that we have recovered
notice = monitor.createAlertNotice(true)
}