From 9c980c103a05fd34d949fbabd38b6eb689a0412c Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 12 Aug 2024 15:39:48 -0700 Subject: [PATCH] Fixed spelling error, moved incident calculation to correct location --- Server/db/mongo/modules/monitorModule.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Server/db/mongo/modules/monitorModule.js b/Server/db/mongo/modules/monitorModule.js index 9a0ed7463..7dbcb675e 100644 --- a/Server/db/mongo/modules/monitorModule.js +++ b/Server/db/mongo/modules/monitorModule.js @@ -219,6 +219,8 @@ const getMonitorStatsById = async (req) => { }) .limit(limit); + const incidents = getIncidents(dateRangeChecks); + // If more than numToDisplay checks, pick every nth check if ( numToDisplay !== undefined && @@ -233,10 +235,9 @@ const getMonitorStatsById = async (req) => { if (normalize !== undefined) { dateRangeChecks = NormalizeData(dateRangeChecks, 1, 100); } - + // Add common stats - const incidents = getIncidents(dateRangeChecks); - monitorStats.uptimeDuration = caluclteUptimeDuration(checksAll); + monitorStats.uptimeDuration = calculateUptimeDuration(checksAll); monitorStats.lastChecked = getLastChecked(checksAll); monitorStats.latestResponseTime = getLatestResponseTime(checksAll); monitorStats.incidents = incidents;