Skip to content

Commit

Permalink
Add TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
louislam committed Feb 9, 2023
1 parent 68ead34 commit b404af6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions server/model/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,17 @@ class Monitor extends BeanModel {
}
}

/**
* TODO
* @param {number} day 30 or 365 etc
* @param {number} monitorID
* @param {boolean} forceNoCache
* @returns {Promise<number>}
*/
static async calcUptimeByDay(day, monitorID, forceNoCache = false) {
// TODO sum daily aggreated uptime + today's uptime from 00:00 to now
}

/**
* Uptime with calculation
* Calculation based on:
Expand All @@ -975,6 +986,8 @@ class Monitor extends BeanModel {
*/
static async calcUptime(duration, monitorID, forceNoCache = false) {

// TODO: aggregate daily uptime for previous date, skip if it is already aggregated

if (!forceNoCache) {
let cachedUptime = UptimeCacheList.getUptime(monitorID, duration);
if (cachedUptime != null) {
Expand Down

0 comments on commit b404af6

Please sign in to comment.