perf: enforce journey budgets and reference traces

This commit is contained in:
2026-09-02 07:48:02 +03:00
parent 8089d061ec
commit f4cf9fc77e
25 changed files with 1432 additions and 23 deletions

View File

@@ -97,6 +97,16 @@ export const wrongTokenFaultUrl = (origin: string, fault: PortfolioFaultId): str
fault,
);
export const authorizedPerformanceUrl = (origin: string, tier: 'high' | 'low'): string => {
const token = process.env.PORTFOLIO_TEST_TOKEN;
if (token === undefined) throw new Error('The per-run portfolio test token is unavailable.');
const url = new URL(origin);
url.searchParams.set('__portfolio_performance', 'drive-trace.v1');
url.searchParams.set('__portfolio_test_token', token);
url.searchParams.set('__portfolio_tier', tier);
return url.href;
};
export interface BrowserErrorCollector {
readonly pageErrors: string[];
}