feat(tools): add perf measurement script for books API #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bd-grimmory-n55.1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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(alsoBD_BASE_URL/BD_TOKENenv). 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 perfrecipe.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/booksagainst the production server: TTFB 19.5s, payload 50.3 MB, pod heap +972 MiB. Paged variant atsize=30returns in 117ms with 32 KB. The entire epic's case is grounded in those numbers.Test plan
bash -n tools/perf/measure-books-api.shparses.--helpand missing-arg paths print usage and exit non-zero.just perf(or the script directly) against the prod server post-merge to confirm output renders cleanly.