dowwntime 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -28407,20 +28407,20 @@ const run = async (options) => {
28407
28407
  }
28408
28408
  const reports = await Promise.all([...fetchConfigurations.keys()].map(async (path$4) => {
28409
28409
  const history = await measurements.getHistory(path$4);
28410
- const startOfPast60m = (0, import_dayjs_min.default)().subtract(60, "minute").startOf("minute").get("milliseconds");
28411
- const startOfPast24h = (0, import_dayjs_min.default)().subtract(24, "hours").startOf("hour").get("milliseconds");
28412
- const startOfPast7d = (0, import_dayjs_min.default)().subtract(7, "day").startOf("day").get("milliseconds");
28413
- const startOfPast30d = (0, import_dayjs_min.default)().subtract(30, "day").startOf("day").get("milliseconds");
28414
- const getAvergageDuration = (since) => {
28410
+ const startOfPast60m = (0, import_dayjs_min.default)().subtract(60, "minute").startOf("minute").valueOf();
28411
+ const startOfPast24h = (0, import_dayjs_min.default)().subtract(24, "hours").startOf("hour").valueOf();
28412
+ const startOfPast7d = (0, import_dayjs_min.default)().subtract(7, "day").startOf("day").valueOf();
28413
+ const startOfPast30d = (0, import_dayjs_min.default)().subtract(30, "day").startOf("day").valueOf();
28414
+ const getAverageDuration = (since) => {
28415
28415
  const filtered = history.filter((item) => item.timestamp >= since);
28416
28416
  if (filtered.length === 0) return null;
28417
28417
  const total = filtered.reduce((acc, curr) => acc + curr.durationMs, 0);
28418
28418
  return Math.round(total / filtered.length);
28419
28419
  };
28420
- const avgDuration60m = getAvergageDuration(startOfPast60m);
28421
- const avgDuration24h = getAvergageDuration(startOfPast24h);
28422
- const avgDuration7d = getAvergageDuration(startOfPast7d);
28423
- const avgDuration30d = getAvergageDuration(startOfPast30d);
28420
+ const avgDuration60m = getAverageDuration(startOfPast60m);
28421
+ const avgDuration24h = getAverageDuration(startOfPast24h);
28422
+ const avgDuration7d = getAverageDuration(startOfPast7d);
28423
+ const avgDuration30d = getAverageDuration(startOfPast30d);
28424
28424
  const getRelativeDowntime = (since) => {
28425
28425
  const filtered = history.filter((item) => item.timestamp >= since);
28426
28426
  if (filtered.length === 0) return null;