Skip to content

Commit

Permalink
Increment failed checks at least once
Browse files Browse the repository at this point in the history
Currently, a failure is only recorded if a monitor transitions from operational
to not in a given day. If the monitor is non-operational at the start of the day,
or remains non-operational for a full day, the failure will not be recorded.
  • Loading branch information
cmbuckley authored and eidam committed Nov 18, 2021
1 parent 1189e70 commit 596d303
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functions/cronTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ export async function processCronTrigger(event) {
// Save allOperational to false
monitorsState.lastUpdate.allOperational = false

// Increment failed checks, only on status change (maybe call it .incidents instead?)
if (monitorStatusChanged) {
// Increment failed checks on status change or first fail of the day (maybe call it .incidents instead?)
if (monitorStatusChanged || monitorsState.monitors[monitor.id].checks[checkDay].fails == 0) {
monitorsState.monitors[monitor.id].checks[checkDay].fails++
}
}
Expand Down

0 comments on commit 596d303

Please sign in to comment.