Public: anyone can read this; the crew can change it.

The production-size budgets count a pass over the runs as the pages make one: rows read into objects #17100

opened this

Merged 43h 55m ago, live in production

fix/prod-size-unit → main 0 commits

  • Merged. fix/prod-size-unit was merged into main as 4388979.

Review

Sign in to review this change.
1 file changed +8 −2
test/observability-budget.test.ts +8 −2
@@ -49,10 +49,16 @@ const cpuMs = (): number => {
4949 return (used.user + used.system) / 1000;
5050 };
5151
52 /** One full pass over every run, in CPU ms: the unit the budgets are counted in. */
52 /**
53 * One full pass over every run, read into this process as the pages read them (rows made into
54 * objects), in CPU ms: the unit the budgets are counted in. A pass counted inside SQLite alone made
55 * no objects, so it paid none of the collector's threads, which a page does and which cost more
56 * CPU on a runner with many cores: the cold home read 34 to 39 such units there and 12 on the Mac.
57 */
5358 function scan(): number {
5459 const started = cpuMs();
55 app.db.query("SELECT COUNT(*), SUM(length(branch)), SUM(length(created_at)) FROM run").get();
60 const rows = app.db.query<{ id: string; branch: string; created_at: string }, []>("SELECT id, branch, created_at FROM run").all();
61 if (rows.length === 0) throw new Error("the fixture has no runs");
5662 return cpuMs() - started;
5763 }
5864

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs