Fixed spelling error, moved incident calculation to correct location
This commit is contained in:
1 parent
2d20eef31d
commit
9c980c103a
1 file changed
+4
-3
@@ -219,6 +219,8 @@ const getMonitorStatsById = async (req) => {
|
|||||||
})
|
})
|
||||||
.limit(limit);
|
.limit(limit);
|
||||||
|
|
||||||
|
const incidents = getIncidents(dateRangeChecks);
|
||||||
|
|
||||||
// If more than numToDisplay checks, pick every nth check
|
// If more than numToDisplay checks, pick every nth check
|
||||||
if (
|
if (
|
||||||
numToDisplay !== undefined &&
|
numToDisplay !== undefined &&
|
||||||
@@ -233,10 +235,9 @@ const getMonitorStatsById = async (req) => {
|
|||||||
if (normalize !== undefined) {
|
if (normalize !== undefined) {
|
||||||
dateRangeChecks = NormalizeData(dateRangeChecks, 1, 100);
|
dateRangeChecks = NormalizeData(dateRangeChecks, 1, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add common stats
|
// Add common stats
|
||||||
const incidents = getIncidents(dateRangeChecks);
|
monitorStats.uptimeDuration = calculateUptimeDuration(checksAll);
|
||||||
monitorStats.uptimeDuration = caluclteUptimeDuration(checksAll);
|
|
||||||
monitorStats.lastChecked = getLastChecked(checksAll);
|
monitorStats.lastChecked = getLastChecked(checksAll);
|
||||||
monitorStats.latestResponseTime = getLatestResponseTime(checksAll);
|
monitorStats.latestResponseTime = getLatestResponseTime(checksAll);
|
||||||
monitorStats.incidents = incidents;
|
monitorStats.incidents = incidents;
|
||||||
|
|||||||
Reference in new issue
Block a user