Skip to content

Commit ead4db0

Browse files
fix: align performance monitor bundle measurement with CI script (#1050) (#1053)
Co-authored-by: Ona <no-reply@ona.com>
1 parent 2b23d98 commit ead4db0

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

.ona/automations/performance-monitor.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ action:
3030
search_events(organizationSlug, naturalLanguageQuery="count of errors last week")
3131
Flag if error count increased >50%.
3232
33-
3. Build size: run `pnpm build` and check the output for page sizes.
34-
Flag any page over 200KB (first load JS).
33+
3. Build size: run `pnpm build`, then run `pnpm test:bundle` to measure
34+
gzipped first-load JS per route. This script reads
35+
`.next/diagnostics/route-bundle-stats.json`, gzips each chunk file,
36+
and sums per route — the same method CI uses.
37+
Parse the table from its stdout (columns: Route, Size (gzip), Budget, Status).
38+
Flag any route marked ❌ (over 200kB gzipped budget).
39+
Do NOT estimate sizes from `pnpm build` console output — those numbers
40+
use a different methodology and will not match CI.
3541
3642
## Output
3743
@@ -51,11 +57,11 @@ action:
5157
- Last week: Y errors
5258
- Trend: ↑/↓/→
5359
54-
## Build Size
55-
| Page | First Load JS | Status |
56-
|---|---|---|
57-
| / | XkB | ✅/⚠️/❌ |
58-
| /login | XkB | ✅/⚠️/❌ |
60+
## Build Size (via `pnpm test:bundle`)
61+
| Route | First Load JS (gzip) | Budget | Status |
62+
|---|---|---|---|
63+
Copy the table rows directly from `pnpm test:bundle` output.
64+
Do NOT re-measure or estimate sizes from build console output.
5965
6066
## Action Items
6167
- [list any issues that need fixing, or "No action needed"]

0 commit comments

Comments
 (0)