feat(tools): add perf measurement script for books API #3

Merged
zombor merged 1 commit from bd-grimmory-n55.1 into develop 2026-05-11 00:52:11 +00:00
Owner

Summary

Bead: grimmory-n55.1 (spike, part of epic grimmory-n55 — Scale to tens of thousands of books)

Adds a re-runnable read-only script that measures the cost of the books endpoints, so each subsequent child of the epic can record before/after numbers on its bead.

Originally scoped to also seed a synthetic 10k/50k/100k catalog, but the production server already holds 65,758 books — synthetic seeding is no longer needed.

What changed

  • tools/perf/measure-books-api.sh — bash + curl + jq. Args: --base-url, --token (also BD_BASE_URL / BD_TOKEN env). Measures three endpoints (unpaginated /books, paged ?size=30, paged ?size=200) and prints a markdown table of HTTP / wall-time / TTFB / payload / gzipped-payload.
  • tools/perf/README.md — how to run, what the metrics mean, recording table for epic children.
  • Justfilejust perf recipe.

Read-only by construction (GETs only). A header comment warns that the unpaginated call is expensive (~1 GiB heap on production) and should be run during quiet windows.

Baseline (already captured on bead grimmory-n55.1)

GET /api/v1/books against the production server: TTFB 19.5s, payload 50.3 MB, pod heap +972 MiB. Paged variant at size=30 returns in 117ms with 32 KB. The entire epic's case is grounded in those numbers.

Test plan

  • bash -n tools/perf/measure-books-api.sh parses.
  • --help and missing-arg paths print usage and exit non-zero.
  • Run just perf (or the script directly) against the prod server post-merge to confirm output renders cleanly.
## Summary Bead: **grimmory-n55.1** (spike, part of epic **grimmory-n55** — Scale to tens of thousands of books) Adds a re-runnable read-only script that measures the cost of the books endpoints, so each subsequent child of the epic can record before/after numbers on its bead. Originally scoped to also seed a synthetic 10k/50k/100k catalog, but the production server already holds 65,758 books — synthetic seeding is no longer needed. ## What changed - `tools/perf/measure-books-api.sh` — bash + curl + jq. Args: `--base-url`, `--token` (also `BD_BASE_URL` / `BD_TOKEN` env). Measures three endpoints (unpaginated `/books`, paged `?size=30`, paged `?size=200`) and prints a markdown table of HTTP / wall-time / TTFB / payload / gzipped-payload. - `tools/perf/README.md` — how to run, what the metrics mean, recording table for epic children. - `Justfile` — `just perf` recipe. Read-only by construction (GETs only). A header comment warns that the unpaginated call is expensive (~1 GiB heap on production) and should be run during quiet windows. ## Baseline (already captured on bead grimmory-n55.1) `GET /api/v1/books` against the production server: TTFB 19.5s, payload 50.3 MB, pod heap +972 MiB. Paged variant at `size=30` returns in 117ms with 32 KB. The entire epic's case is grounded in those numbers. ## Test plan - [x] `bash -n tools/perf/measure-books-api.sh` parses. - [x] `--help` and missing-arg paths print usage and exit non-zero. - [ ] Run `just perf` (or the script directly) against the prod server post-merge to confirm output renders cleanly.
feat(tools): add perf measurement script for books API
Some checks failed
notify-discord-release-notes.yml / feat(tools): add perf measurement script for books API (push) Failing after 0s
notify-discord-release-notes.yml / feat(tools): add perf measurement script for books API (pull_request) Failing after 0s
CI - Validate / Upload Event File (pull_request) Failing after 5s
CodeQL / Analyze (actions) (pull_request) Failing after 4s
CI - Validate / Check for DB Migrations (pull_request) Successful in 11s
CodeQL / Analyze (java-kotlin) (pull_request) Failing after 2s
CodeQL / Analyze (javascript-typescript) (pull_request) Failing after 2s
CI - Semantic PR Title / Validate PR Title (pull_request) Successful in 1s
CI - Frontend Quality Thresholds / Frontend Lint Threshold Check (pull_request) Failing after 12m35s
CI - Validate / Flyway DB Migration Preview (pull_request) Has been skipped
CI - Validate / Flyway Migration Check (pull_request) Successful in 0s
CI - Validate / Backend Tests (pull_request) Failing after 2s
CI - Validate / Frontend Tests (pull_request) Failing after 3s
CI - Validate / Test Suite (pull_request) Failing after 0s
CI - Validate / Packaging Smoke Test (pull_request) Has been skipped
notify-discord-release-notes.yml / Merge pull request 'feat(tools): add perf measurement script for books API' (#3) from bd-grimmory-n55.1 into develop (pull_request) Failing after 0s
19559b243a
Adds tools/perf/measure-books-api.sh and a README documenting how to
capture before/after metrics for the grimmory-n55 epic. Also wires a
minimal `just perf` recipe so the script is discoverable from the root
command surface.

Refs: grimmory-n55.1
zombor merged commit db16d7e3b3 into develop 2026-05-11 00:52:11 +00:00
zombor deleted branch bd-grimmory-n55.1 2026-05-11 00:52:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zombor/grimmory!3
No description provided.