Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:14q2ira1ie is past its budget: trevato/forge: "a plan of 2,000 closed and 300 open issues, 3,000 pulls and 1,500 runs reads in under 50 ms with the sa… #6402
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/6382-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 2 commits fork 1 thread · 1 unresolved
1 file
changed +8
−1
test/milestones-shape.test.ts +8 −1
| @@ -7,6 +7,7 @@ import { createRepo } from "../src/actions/repos.ts"; | ||
| 7 | 7 | import { createApp, type App } from "../src/app.ts"; |
| 8 | 8 | import { openIssue } from "../src/actions/issues.ts"; |
| 9 | 9 | import { planStamp, readPlan } from "../src/core/milestones.ts"; |
| 10 | import { getIssuesOfRepo } from "../src/core/issues.ts"; | |
| 10 | 11 | import { getRepo } from "../src/core/repos.ts"; |
| 11 | 12 | import { createUser, getUserByName } from "../src/core/users.ts"; |
| 12 | 13 | import { expectBudget } from "./helpers/budget.ts"; |
| @@ -92,8 +93,14 @@ const BEFORE = [ | ||
| 92 | 93 | ]; |
| 93 | 94 | |
| 94 | 95 | test("a plan of 2,000 closed and 300 open issues, 3,000 pulls and 1,500 runs reads in under 50 ms with the same limbs", async () => { |
| 95 | const against = 1; | |
| 96 | 96 | const repo = getRepo(app.db, "alice", "forge")!; |
| 97 | // the same run's yardstick: the plan's own first stretch, every issue of the repository read lean, which slows with the machine as the plan does | |
Good: the yardstick scales with the machine. The comment is long; consider trimming it to one clause. |
||
| 98 | let against = Infinity; | |
| 99 | for (let n = 0; n < 5; n++) { | |
| 100 | const t = performance.now(); | |
| 101 | getIssuesOfRepo(app.db, repo.id, "issue", true); | |
| 102 | against = Math.min(against, performance.now() - t); | |
| 103 | } | |
| 97 | 104 | readPlan(app.db, repo, { spend: true }); |
| 98 | 105 | const times: number[] = []; |
| 99 | 106 | for (let n = 0; n < 7; n++) { |
new above
offline
Nit: the LIKE scan is cheap on short bodies, so against x10 may stay below 50 and the limit stays flat. Confirm it is large enough to track load.