add port types to monitor operations on BE
This commit is contained in:
1 parent
f155b8ceb8
commit
004184b0f4
2 files changed
+15
-5
No files matched your search
@@ -21,6 +21,7 @@ const CHECK_MODEL_LOOKUP = {
|
|||||||
http: Check,
|
http: Check,
|
||||||
ping: Check,
|
ping: Check,
|
||||||
docker: Check,
|
docker: Check,
|
||||||
|
port: Check,
|
||||||
pagespeed: PageSpeedCheck,
|
pagespeed: PageSpeedCheck,
|
||||||
hardware: HardwareCheck,
|
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
|
// HTTP/PING Specific stats
|
||||||
monitorStats.periodAvgResponseTime = getAverageResponseTime(checksForDateRange);
|
monitorStats.periodAvgResponseTime = getAverageResponseTime(checksForDateRange);
|
||||||
monitorStats.periodUptime = getUptimePercentage(checksForDateRange);
|
monitorStats.periodUptime = getUptimePercentage(checksForDateRange);
|
||||||
|
|||||||
@@ -144,10 +144,12 @@ const getMonitorsAndSummaryByTeamIdQueryValidation = joi.object({
|
|||||||
type: joi
|
type: joi
|
||||||
.alternatives()
|
.alternatives()
|
||||||
.try(
|
.try(
|
||||||
joi.string().valid("http", "ping", "pagespeed", "docker", "hardware"),
|
joi.string().valid("http", "ping", "pagespeed", "docker", "hardware", "port"),
|
||||||
joi
|
joi
|
||||||
.array()
|
.array()
|
||||||
.items(joi.string().valid("http", "ping", "pagespeed", "docker", "hardware"))
|
.items(
|
||||||
|
joi.string().valid("http", "ping", "pagespeed", "docker", "hardware", "port")
|
||||||
|
)
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -163,10 +165,12 @@ const getMonitorsByTeamIdQueryValidation = joi.object({
|
|||||||
type: joi
|
type: joi
|
||||||
.alternatives()
|
.alternatives()
|
||||||
.try(
|
.try(
|
||||||
joi.string().valid("http", "ping", "pagespeed", "docker", "hardware"),
|
joi.string().valid("http", "ping", "pagespeed", "docker", "hardware", "port"),
|
||||||
joi
|
joi
|
||||||
.array()
|
.array()
|
||||||
.items(joi.string().valid("http", "ping", "pagespeed", "docker", "hardware"))
|
.items(
|
||||||
|
joi.string().valid("http", "ping", "pagespeed", "docker", "hardware", "port")
|
||||||
|
)
|
||||||
),
|
),
|
||||||
page: joi.number(),
|
page: joi.number(),
|
||||||
rowsPerPage: joi.number(),
|
rowsPerPage: joi.number(),
|
||||||
|
|||||||
Reference in new issue
Block a user