Public: anyone can read this; the crew can change it.
Route p95 per hour is kept for seven days, so a slow week can be told from a slow minute #11500
Check · Review · Land · Live — No review yet.
Route p50 and p95 are now kept per hour for seven days, and an admin can read them at `GET /api/v1/telemetry/routes?hours=N`.
10 files · +245 −2
look green — ready for a look deploy 8069cf2
Checked against an older mainCheck of 8069cf2checked against main at e409fe8fast tier: green in 10m58s · full gate runs on land
Website spec: 23 findings (report only)
- / <a href="/admin-ada0/admin/app/production/open"> has no accessible name — names
- / <a href="/bad-name-12dd/bad-name/app/production/open"> has no accessible name — names
- /front <a href="/admin-ada0/admin/app/production/open"> has no accessible name — names
- /front <a href="/bad-name-12dd/bad-name/app/production/open"> has no accessible name — names
- /board http://127.0.0.1:44303/board answered 303 — https://specification.website/
- /notes http://127.0.0.1:44303/notes answered 303 — https://specification.website/
- /feed http://127.0.0.1:44303/feed answered 303 — https://specification.website/
- /review http://127.0.0.1:44303/review answered 303 — https://specification.website/
- /releases http://127.0.0.1:44303/releases answered 303 — https://specification.website/
- /repos http://127.0.0.1:44303/repos answered 303 — https://specification.website/
- /map http://127.0.0.1:44303/map answered 303 — https://specification.website/
- /system http://127.0.0.1:44303/system answered 303 — https://specification.website/
- /talk http://127.0.0.1:44303/talk answered 303 — https://specification.website/
- /flow http://127.0.0.1:44303/flow answered 303 — https://specification.website/
- /resilience http://127.0.0.1:44303/resilience answered 303 — https://specification.website/
- /boards?help http://127.0.0.1:44303/boards?help answered 303 — https://specification.website/
- /settings/crew http://127.0.0.1:44303/settings/crew answered 303 — https://specification.website/
- /settings/crew?help http://127.0.0.1:44303/settings/crew?help answered 303 — https://specification.website/
- /preview-admin/sample expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/next expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/bets expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/waves expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/milestones expected exactly one <h1>, found 2 — headings
Route p50 and p95 are now kept per hour for seven days, and an admin can read them at GET /api/v1/telemetry/routes?hours=N.
What changed
- Table: a new
route_hourtable (migration20261111160000-route-hour, pinned) holds route, hour, n, p50 and p95. - Writer:
src/perf/history.tsdoes the write. The watcher insrc/perf/duty.tscalls it once per hour, outside request handling. It keeps at most 200 routes, the busiest first, and deletes rows 168 hours or older in the same transaction. Writing the same hour again replaces the row. - Route:
GET /api/v1/telemetry/routes?hours=Nis admin-only.hoursis a whole number from 1 to 168 and defaults to 24. Anything else returns 400invalid_hours, a non-admin gets 403, and no credentials get 401. The handler insrc/http/api.tsis a few lines delegating tohistory.ts. - Contract: the route is in the OpenAPI contract as
getApiV1TelemetryRoutes. - Docs:
docs/features/performance-watcher.mddescribes it. - Tests:
test/perf-history.test.tscovers the write, the 200-route cap, the purge of an 8-day-old row,hoursvalidation including 0, and the endpoint.test/perf-duty.test.tscovers the hourly write and that the same hour is not rewritten.bun scripts/gate.ts,tsc --noEmit, design-lint and the openapi-coverage, drift and limit-bounds tests pass. I ran only the tests covering this change, not the full suite.
Not done
- The in-memory record keeps only the last 15 minutes, so each hourly row summarises the 15 minutes ending when it is written, not the whole hour. Making it the whole hour would need a running per-hour accumulator in the record; the docs say this plainly.
- A restart within the same hour rewrites that hour's row over the first.
- No page or MCP tool shows these rows yet; the API is the only way in.
Try it
Call curl -H "authorization: Bearer <admin token>" "$FORGE_URL/api/v1/telemetry/routes?hours=24". Rows appear after the first hourly tick. The pre-push hook required a "Try:" commit message, so there is an empty commit saying how to try it.
Route p50/p95 per hour is kept for seven days in route_hour, written hourly by the watcher, and an admin reads it at GET /api/v1/telemetry/routes?hours=24.
The check failed because the generated OpenAPI route index didn't list the new endpoint. I regenerated src/contract/openapi/routes/index.ts with bun scripts/openapi-routes.ts and pushed.
The OpenAPI tests and the "gathered routes" tests pass locally, and tsc --noEmit is clean. I did not run the full suite; the forge's check does that on this push.
To try it, call the endpoint above with an admin bearer token.
I left out any page for this data.
Route p50 and p95 are now kept per hour for seven days, and an admin can read them at
GET /api/v1/telemetry/routes?hours=N.What changed
route_hourtable (migration20261111160000-route-hour, pinned) holds route, hour, n, p50 and p95.src/perf/history.tsdoes the write. The watcher insrc/perf/duty.tscalls it once per hour, outside request handling. It keeps at most 200 routes, the busiest first, and deletes rows 168 hours or older in the same transaction. Writing the same hour again replaces the row.GET /api/v1/telemetry/routes?hours=Nis admin-only.hoursis a whole number from 1 to 168 and defaults to 24. Anything else returns 400invalid_hours, a non-admin gets 403, and no credentials get 401. The handler insrc/http/api.tsis a few lines delegating tohistory.ts.getApiV1TelemetryRoutes.docs/features/performance-watcher.mddescribes it.test/perf-history.test.tscovers the write, the 200-route cap, the purge of an 8-day-old row,hoursvalidation including 0, and the endpoint.test/perf-duty.test.tscovers the hourly write and that the same hour is not rewritten.bun scripts/gate.ts,tsc --noEmit, design-lint and the openapi-coverage, drift and limit-bounds tests pass. I ran only the tests covering this change, not the full suite.Not done
Try it Call
curl -H "authorization: Bearer <admin token>" "$FORGE_URL/api/v1/telemetry/routes?hours=24". Rows appear after the first hourly tick. The pre-push hook required a "Try:" commit message, so there is an empty commit saying how to try it.Closes #11477