dowwntime 1.2.2 → 1.3.0
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 +25 -14
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +25 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -28375,7 +28375,14 @@ const run = async (options) => {
|
|
|
28375
28375
|
interval: 1e3
|
|
28376
28376
|
})(measure);
|
|
28377
28377
|
await Promise.all(Array.from(fetchConfigurations.keys()).map(async (path$4) => {
|
|
28378
|
-
const
|
|
28378
|
+
const results = await Promise.all(Array.from({ length: options.samples ?? 5 }).map(() => throttledMeasure(path$4)));
|
|
28379
|
+
const durations = results.map((r) => r?.durationMs ?? 0).sort((a, b) => a - b);
|
|
28380
|
+
const q1 = durations[Math.floor(durations.length * .25)] ?? 0;
|
|
28381
|
+
const q3 = durations[Math.floor(durations.length * .75)] ?? 0;
|
|
28382
|
+
const iqr = q3 - q1;
|
|
28383
|
+
const lowerBound = q1 - 1.5 * iqr;
|
|
28384
|
+
const upperBound = q3 + 1.5 * iqr;
|
|
28385
|
+
const measurement = results.filter((r) => r && r.durationMs >= lowerBound && r.durationMs <= upperBound).reduce((acc, curr) => {
|
|
28379
28386
|
if (!acc) return curr;
|
|
28380
28387
|
if (!curr) return acc;
|
|
28381
28388
|
acc.status = curr.status;
|
|
@@ -28424,20 +28431,24 @@ const run = async (options) => {
|
|
|
28424
28431
|
if (filtered.length === 0) return null;
|
|
28425
28432
|
return filtered.filter((item) => item.status === "degraded").length / filtered.length;
|
|
28426
28433
|
};
|
|
28434
|
+
const relDegraded60m = getRelativeDegraded(startOfPast60m);
|
|
28435
|
+
const relDegraded24h = getRelativeDegraded(startOfPast24h);
|
|
28436
|
+
const relDegraded7d = getRelativeDegraded(startOfPast7d);
|
|
28437
|
+
const relDegraded30d = getRelativeDegraded(startOfPast30d);
|
|
28427
28438
|
return {
|
|
28428
|
-
path: path$4
|
|
28429
|
-
relDowntime60m,
|
|
28430
|
-
|
|
28431
|
-
avgDuration60m,
|
|
28432
|
-
relDowntime24h,
|
|
28433
|
-
|
|
28434
|
-
avgDuration24h,
|
|
28435
|
-
relDowntime7d,
|
|
28436
|
-
|
|
28437
|
-
avgDuration7d,
|
|
28438
|
-
relDowntime30d,
|
|
28439
|
-
|
|
28440
|
-
avgDuration30d
|
|
28439
|
+
path: `${path$4} - ${history[history.length - 1]?.status ?? "unknown"} - ${history[history.length - 1]?.durationMs ?? 0}ms`,
|
|
28440
|
+
down60m: relDowntime60m,
|
|
28441
|
+
degr60m: relDegraded60m,
|
|
28442
|
+
dur60m: avgDuration60m,
|
|
28443
|
+
down24h: relDowntime24h,
|
|
28444
|
+
degr24h: relDegraded24h,
|
|
28445
|
+
dur24h: avgDuration24h,
|
|
28446
|
+
down7d: relDowntime7d,
|
|
28447
|
+
degr7d: relDegraded7d,
|
|
28448
|
+
dur7d: avgDuration7d,
|
|
28449
|
+
down30d: relDowntime30d,
|
|
28450
|
+
degr30d: relDegraded30d,
|
|
28451
|
+
dur30d: avgDuration30d
|
|
28441
28452
|
};
|
|
28442
28453
|
}));
|
|
28443
28454
|
console.table(reports);
|