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

One slow backup night is a finding, not an issue: the growth duty files on duration only after two slow nights in a row #15233

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

One slow upload night is now only a finding. Duration files an issue only when the last two nights are each over twice the median of the seven before them. bun x tsc --noEmit, bun scripts/gate.ts --fix and test/backup-growth.test.ts (9 tests) pass here.

Notes

shipped production is serving it deploy cfe12e4

opened this

One slow upload night is now only a finding. Duration files an issue only when the last two nights are each over twice the median of the seven before them. bun x tsc --noEmit, bun scripts/gate.ts --fix and test/backup-growth.test.ts (9 tests) pass here. I did not run the full suite.

What changed

  • Window logic: Growth in src/snapshot/growth.ts gains previous (the night before the last, read against its own prior seven) and files (the measures that justify an issue). Size files on one night, as before. Duration files only when the previous night was also over twice its median. over is unchanged, so the duty still reports a single slow night as a finding.
  • Duty: src/maintain/duties/backup_growth.ts returns the finding without filing when files is empty. The two-day freshness guard, fileIssueOnce and the closed-since-this-night check are untouched.
  • Filed body: it names which measure tripped. When duration tripped it gives both nights' numbers. It ends with one line saying what to look at: the upload path to the destination, not the code, when only duration tripped. When size tripped it points at what grew in the data directory first, then the upload path.
  • Tests: new cases in test/backup-growth.test.ts cover one slow night (finding, no issue), two slow nights (one issue naming both nights), a slow night then a normal one (nothing), and one night of size growth (files). The duration cases would fail on the old code. No new test file, so nothing to add to the gate list.

Judgement calls

  • I read "the seven before them" as each of the two nights against its own preceding seven. A slow first night barely moves the median, so this is close to the other reading.
  • In the test I back-dated the earlier closed defect, because issue created_at uses the real clock and would otherwise trip the closed-since-this-night check.

Closes #15232

commented

One slow upload night is now only a finding. Duration files an issue only when the last two nights are each over twice the median of the seven before them. bun x tsc --noEmit, bun scripts/gate.ts --fix and test/backup-growth.test.ts (9 tests) pass here. I did not run the full suite.

What changed

  • Window logic: Growth in src/snapshot/growth.ts gains previous (the night before the last, read against its own prior seven) and files (the measures that justify an issue). Size files on one night, as before. Duration files only when the previous night was also over twice its median. over is unchanged, so the duty still reports a single slow night as a finding.
  • Duty: src/maintain/duties/backup_growth.ts returns the finding without filing when files is empty. The two-day freshness guard, fileIssueOnce and the closed-since-this-night check are untouched.
  • Filed body: it names which measure tripped. When duration tripped it gives both nights' numbers. It ends with one line saying what to look at: the upload path to the destination, not the code, when only duration tripped. When size tripped it points at what grew in the data directory first, then the upload path.
  • Tests: new cases in test/backup-growth.test.ts cover one slow night (finding, no issue), two slow nights (one issue naming both nights), a slow night then a normal one (nothing), and one night of size growth (files). The duration cases would fail on the old code. No new test file, so nothing to add to the gate list.

Judgement calls

  • I read "the seven before them" as each of the two nights against its own preceding seven. A slow first night barely moves the median, so this is close to the other reading.
  • In the test I back-dated the earlier closed defect, because issue created_at uses the real clock and would otherwise trip the closed-since-this-night check.
Approved

Approved. Duration now files only after two consecutive nights over twice their own prior-seven median. Size still files on one night. The body names the tripped measure, both nights for duration, and an upload-path line. Tests cover the four cases and no new test file was added. This is a backend duty with no page, so the preview has nothing to exercise.

Two things I would do next:

  1. Add a duty-level test that a size-only night files with no duration line for the previous night. At the moment that case is asserted only on growthOf().files.
  2. Compute previous one level deep rather than recursing through the whole history in growthOf. Each night currently carries a full chain of previous. Also break the long one-line expressions in bodyOf and rewrap the header comment, which wraps unevenly.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs