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

Efficiency watcher: network bytes and cache hit rates by cause, filed when a cost doubles #7558

open not picked up yet opened this
opened this

Part of the epic #7553. Blocked by the maintainer framework (#7554).

Problem

The npm re-download (~30 GiB/day, #7541) went unnoticed until the steward measured network bytes and read caches by hand. The forge has no cost-per-cause view. #7546 adds the first number (registry bytes per hour); the rest is a watcher that reads it, compares to a baseline, and files when something doubles.

Build (duty: efficiency-watcher)

  • Hourly samples by cause: npm registry bytes, image pulls, git fetch/clone bytes, bytes per check/gate/preview run; cache hit rate per cache (bun install cache, check impact cache); install downloads per run; CPU-seconds and peak memory per run (reuse the 15 s sampler, src/boards/sampler.ts:1).
  • Baseline: median of the same hour over the last 7 days. Fire when a cost is 2x its baseline for 2 hours, or crosses an absolute ceiling.
  • A finding names the cause, the number, the baseline and the code path that starts the cost; one issue per cause, a comment while it stands, closed with a note when it has been back under for 24 h.
  • Samples land in a board source so the board can chart them.

Done when

  • With a seeded series where npm bytes jump 10x for 2 h, one issue is filed with cause, numbers and baseline; with the series flat, nothing is filed.
  • Replaying the #7541 series, the watcher files within 3 h of the first bad hour.
  • Tests: test/efficiency-baseline.test.ts, test/efficiency-double.test.ts, test/efficiency-dedupe.test.ts, test/efficiency-close-when-clear.test.ts.
  • Depends on the bytes number from #7546 (open; link, do not rebuild). Related: #7541, #7543, #7544, #7545.
commented

Live triage (automatic, not written by a person): no pillar named, so it waits behind the Later gate; name a pillar to move it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs