dowwntime 1.2.3 → 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 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 measurement = (await Promise.all(Array.from({ length: options.samples ?? 5 }).map(() => throttledMeasure(path$4)))).reduce((acc, curr) => {
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;