Files
hyperframes/packages/producer/src/perf-gate.ts
T
Vance Ingalls 20be2ea1c2 style: apply oxfmt baseline formatting across all source files (#25)
## Summary
- Run `oxfmt .` across the entire codebase to establish formatted baseline
- 299 files changed — mechanical formatting only, no logic changes
- Double quotes, semicolons, 2-space indent, trailing commas, 100 print width

Part 3/4 of [VA-851](https://linear.app/heygen/issue/VA-851/pre-migration-configure-eslint-prettier-and-conventional-commits)

## Test plan
- [x] `pnpm format:check` — all 426 files pass
- [x] `pnpm -r typecheck` — all packages pass
- [x] `pnpm build` — all packages build
- [x] All 348 tests pass
2026-03-23 17:15:14 -07:00

33 lines
1.0 KiB
TypeScript

import { readFileSync } from "node:fs";
import { resolve } from "node:path";
type PerfBaseline = {
parityFixtureMaxMs: number;
allowedRegressionRatio: number;
};
function main(): void {
const baselinePath = resolve(
process.env.PRODUCER_PERF_BASELINE_PATH || "producer/tests/perf/baseline.json",
);
const measuredMs = Number(process.env.PRODUCER_PARITY_ELAPSED_MS || "");
if (!Number.isFinite(measuredMs) || measuredMs <= 0) {
throw new Error("Missing PRODUCER_PARITY_ELAPSED_MS for perf gate");
}
const baselineRaw = readFileSync(baselinePath, "utf-8");
const baseline = JSON.parse(baselineRaw) as PerfBaseline;
const maxMs = Math.round(baseline.parityFixtureMaxMs * (1 + baseline.allowedRegressionRatio));
const payload = {
baselinePath,
measuredMs,
parityFixtureMaxMs: baseline.parityFixtureMaxMs,
maxMs,
};
console.log(`[PerfGate] ${JSON.stringify(payload)}`);
if (measuredMs > maxMs) {
throw new Error(`[PerfGate] Regression detected measured=${measuredMs}ms max=${maxMs}ms`);
}
}
main();