add port types to monitor operations on BE

This commit is contained in:
Alex Holliday
2024-12-27 11:16:09 -08:00
parent f155b8ceb8
commit 004184b0f4
2 changed files with 15 additions and 5 deletions
+7 -1
View File
@@ -21,6 +21,7 @@ const CHECK_MODEL_LOOKUP = {
http: Check,
ping: Check,
docker: Check,
port: Check,
pagespeed: PageSpeedCheck,
hardware: HardwareCheck,
};
@@ -351,7 +352,12 @@ const getMonitorStatsById = async (req) => {
),
};
if (monitor.type === "http" || monitor.type === "ping" || monitor.type === "docker") {
if (
monitor.type === "http" ||
monitor.type === "ping" ||
monitor.type === "docker" ||
monitor.type === "port"
) {
// HTTP/PING Specific stats
monitorStats.periodAvgResponseTime = getAverageResponseTime(checksForDateRange);
monitorStats.periodUptime = getUptimePercentage(checksForDateRange);