mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-18 14:08:21 +00:00
Total blocking time is CPU time, and the hosted runner's CPU is not a constant: Lighthouse's own benchmark of the runner moves by more than 2x between consecutive runs of one build on a two-core runner, and blocking time moves with it. A median of three raw measurements against a fixed budget therefore fails on the runner rather than on the page. Rescale each run's main-thread tasks by that run's benchmark index to a reference CPU, assert the lowest run instead of the median, and measure an over-budget batch once more before failing. Budgets move to their own file so a fork with a heavier client changes numbers only.
12 lines
420 B
TypeScript
12 lines
420 B
TypeScript
/** Budgets keyed by Lighthouse audit id. */
|
|
export type Budgets = Record<string, number>;
|
|
|
|
/**
|
|
* The numbers live apart from the runner so a fork that ships a heavier client changes this
|
|
* file alone. `total-blocking-time` is asserted at the reference CPU: see `measure.mts`.
|
|
*/
|
|
export const BUDGETS: Budgets = {
|
|
'largest-contentful-paint': 4500,
|
|
'cumulative-layout-shift': 0.1,
|
|
'total-blocking-time': 500,
|
|
};
|