Skip to content

Commit

Permalink
Merge pull request #956 from hpcc-systems/yadhap/JM-Frequency-increased
Browse files Browse the repository at this point in the history
Made JM run more often. Removed some code that was interferring with …
  • Loading branch information
FancMa01 authored Nov 25, 2024
2 parents 872b282 + 6ea11a0 commit 2b389e4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Tombolo/server/config/monitorings.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Job Monitoring configuration
const job_monitoring_interval = 30; // in minutes
const job_monitoring_interval = 20; // in minutes
const jobMonitoringConfig = {
job_monitoring_interval,
intermediate_job_monitoring_interval: 10, // in minutes
job_punctuality_monitoring_interval: job_monitoring_interval + 10
intermediate_job_monitoring_interval: 15, // in minutes
job_punctuality_monitoring_interval: 10, // in minutes
};


Expand Down
32 changes: 20 additions & 12 deletions Tombolo/server/jobs/jobMonitoring/monitorJobPunctuality.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,24 +165,31 @@ const Integrations = models.integrations;
continue;
}

let alertTimePassed = false;
let lateByInMinutes = 0;
// --------------------------------------------------
// let alertTimePassed = false;
// let lateByInMinutes = 0;

/* jobLevelSeverity < severityThreshHold means the job is not so severe.
We can wait until expected completion time before notifying about unpunctuality */

if (jobLevelSeverity < severityThreshHold || !severityThreshHold) {
alertTimePassed = window.end < window.currentTime;
// if (jobLevelSeverity < severityThreshHold || !severityThreshHold) {
// alertTimePassed = window.end < window.currentTime;

lateByInMinutes = Math.floor(
(window.currentTime - window.end) / 60000
);
} else {
lateByInMinutes = Math.floor(
(window.currentTime - window.start) / 60000
);
}
// lateByInMinutes = Math.floor(
// (window.currentTime - window.end) / 60000
// );
// } else {
// lateByInMinutes = Math.floor(
// (window.currentTime - window.start) / 60000
// );
// }
// -----------------------------------------------------

alertTimePassed = window.end < window.currentTime;

lateByInMinutes = Math.floor(
(window.currentTime - window.end) / 60000
);

// If the time has not passed, or with in grace period of 10 minutes, continue
if (!alertTimePassed || lateByInMinutes < 10) {
Expand All @@ -196,6 +203,7 @@ const Integrations = models.integrations;

if (jobPunctualityDetails) {
const { windowStartTime, windowEndTime } = jobPunctualityDetails;

if (
windowStartTime === window.start.toISOString() &&
windowEndTime === window.end.toISOString()
Expand Down

0 comments on commit 2b389e4

Please sign in to comment.