Skip to content

Commit

Permalink
Update server monitor criteria and request handling for accurate time…
Browse files Browse the repository at this point in the history
… tracking
  • Loading branch information
simlarsen committed Dec 19, 2024
1 parent 43faeb6 commit 282373b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class ServerMonitorCriteria {
input.criteriaFilter.evaluateOverTimeOptions
) {
offlineIfNotCheckedInMinutes =
input.criteriaFilter.evaluateOverTimeOptions.timeValueInMinutes || 2;
input.criteriaFilter.evaluateOverTimeOptions.timeValueInMinutes || 3;
}

if (
Expand Down
3 changes: 3 additions & 0 deletions ProbeIngest/API/ServerMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Express, {
import MonitorResourceUtil from "Common/Server/Utils/Monitor/MonitorResource";
import Response from "Common/Server/Utils/Response";
import Monitor from "Common/Models/DatabaseModels/Monitor";
import OneUptimeDate from "Common/Types/Date";

const router: ExpressRouter = Express.getRouter();

Expand Down Expand Up @@ -107,6 +108,8 @@ router.post(

serverMonitorResponse.monitorId = monitor.id;

serverMonitorResponse.requestReceivedAt = OneUptimeDate.getCurrentDate();

// process probe response here.
const probeApiIngestResponse: ProbeApiIngestResponse =
await MonitorResourceUtil.monitorResource(serverMonitorResponse);
Expand Down
2 changes: 1 addition & 1 deletion Worker/Jobs/ServerMonitor/CheckOnlineStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RunCron(
{ schedule: EVERY_MINUTE, runOnStartup: false },
async () => {
try {
const threeMinsAgo: Date = OneUptimeDate.getSomeMinutesAgo(3);
const threeMinsAgo: Date = OneUptimeDate.getSomeMinutesAgo(2);

const serverMonitors: Array<Monitor> = await MonitorService.findBy({
query: {
Expand Down

0 comments on commit 282373b

Please sign in to comment.