perf: enforce journey budgets and reference traces
This commit is contained in:
11
scripts/aggregate-drive-traces.mjs
Normal file
11
scripts/aggregate-drive-traces.mjs
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env node
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { aggregateFiveDriveTraces } from './lib/performance-aggregation.mjs';
|
||||
|
||||
const paths = process.argv.slice(2);
|
||||
if (paths.length !== 5) throw new Error('Pass exactly five explicit drive-trace.v1 JSON paths.');
|
||||
const runs = [];
|
||||
for (const path of paths) runs.push(JSON.parse(await readFile(path, 'utf8')));
|
||||
const aggregate = aggregateFiveDriveTraces(runs);
|
||||
process.stdout.write(`${JSON.stringify(aggregate, null, 2)}\n`);
|
||||
if (!aggregate.passes) process.exitCode = 1;
|
||||
Reference in New Issue
Block a user