Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2hwyx3x8nx is past its budget: trevato/forge: "/map on the forge-sized fixture, warm > (unnamed)" failed on 3 pulls in the last hour — the lane's red,… #3064
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/3060-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork
1 file
changed +15
−10
test/map-cache.test.ts +15 −10
| @@ -72,9 +72,15 @@ describe("/map on the forge-sized fixture, warm", () => { | ||
| 72 | 72 | // Both viewers share one cache, so drop it here: the first request is a |
| 73 | 73 | // real cold build for this viewer, whichever test ran before. |
| 74 | 74 | clearMapCache(); |
| 75 | const coldStarted = performance.now(); | |
| 76 | const warm = await get(servers, "/map", cookie); | |
| 77 | const cold = performance.now() - coldStarted; | |
| 75 | const coldCounter = countStatements(f.app.db); | |
| 76 | let cold: number; | |
| 77 | let warm: string; | |
| 78 | try { | |
| 79 | warm = await get(servers, "/map", cookie); | |
| 80 | cold = coldCounter.count; | |
| 81 | } finally { | |
| 82 | coldCounter.stop(); | |
| 83 | } | |
| 78 | 84 | const lanes = lanesIn(warm); |
| 79 | 85 | expect(lanes).toBeGreaterThan(5); |
| 80 | 86 | const counter = countStatements(f.app.db); |
| @@ -93,17 +99,16 @@ describe("/map on the forge-sized fixture, warm", () => { | ||
| 93 | 99 | } |
| 94 | 100 | times.sort((a, b) => a - b); |
| 95 | 101 | const p95 = times[Math.ceil(times.length * 0.95) - 1]!; |
| 96 | const median = times[times.length >> 1]!; | |
| 97 | 102 | // The steady state: a lane's minute or the UTC day turning over mid-loop |
| 98 | 103 | // rebuilds one request, and that is the cache working, not failing. |
| 99 | 104 | counts.sort((a, b) => a - b); |
| 100 | 105 | const statements = counts[counts.length >> 1]!; |
| 101 | console.log(`${who}: ${lanes} lanes, p95 ${p95.toFixed(1)} ms, ${statements} statements`); | |
| 102 | // Wall-clock is the check machine's, so it is only ever a ratio between | |
| 103 | // two timings taken here, a real cold build and the warm median: a | |
| 104 | // missing cache puts them level. The doc's 50 ms budget is read off | |
| 105 | // bench/map-home.ts. p95 below is a hang guard, nothing more. | |
| 106 | expect(median * 3).toBeLessThan(cold); | |
| 106 | console.log(`${who}: ${lanes} lanes, p95 ${p95.toFixed(1)} ms, ${statements} statements (cold ${cold})`); | |
| 107 | // Wall-clock is the check machine's load, so the verdict is read from | |
| 108 | // statement counts, which depend only on the code: a missing cache | |
| 109 | // puts the cold and warm counts level. The doc's 50 ms budget is read | |
| 110 | // off bench/map-home.ts. p95 below is a hang guard, nothing more. | |
| 111 | expect(statements * 3).toBeLessThan(cold); | |
| 107 | 112 | expect(p95).toBeLessThan(5_000); |
| 108 | 113 | // The page's own chrome costs a fixed ~25 statements (session, settings, |
| 109 | 114 | // the repository lists); a lane costs at most two. Cold, it was ~2,700. |
new above
offline