mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-24 10:39:40 -06:00
Store the percentage as a 0 and 1 instead of 0 - 100 for future calculations.
This commit is contained in:
@@ -35,10 +35,10 @@ const createCheck = async (checkData) => {
|
||||
}
|
||||
|
||||
if (monitor.uptimePercentage === undefined) {
|
||||
monitor.uptimePercentage = status ? 100 : 0;
|
||||
monitor.uptimePercentage = status ? 1 : 0;
|
||||
} else {
|
||||
monitor.uptimePercentage =
|
||||
(monitor.uptimePercentage * (n - 1) + (status ? 100 : 0)) / n;
|
||||
(monitor.uptimePercentage * (n - 1) + (status ? 1: 0)) / n;
|
||||
}
|
||||
|
||||
await monitor.save();
|
||||
|
||||
Reference in New Issue
Block a user