Skip to content

impl(atlas): D1 hot-cache measurement report for the storage-economics prototype #13107

Open

Description

@dezren39

Implementation follow-on 6 of 6 under #9134 (Atlas D1 tenant hot cache design, doc/2026-11-23T08-06-00Z_design_atlas_d1_tenant_hot_cache/2026-11-23T08-06-00Z_design_atlas_d1_tenant_hot_cache.md, merged via PR #13098).

Scope (§7, §8 item 6 of the design): measurement — the counters (hits, skips, revalidations per class and tenant; stale-serves with expected value zero; estimated Turso cost avoided as skips x recorded fill cost, labelled an estimate with its method; D1 write/storage bytes per tenant vs quota) surfaced as a report the #9098 embed-storage economics prototype consumes, plus the first tuning round: after two weeks of counters (estimate cadence), re-set TTL_B, the heavy-query threshold, and tier weights from measured hit/skip ratios and record the new values on this issue.

Acceptance: report renders from live counters; tuning round recorded with before/after values and the measurements that drove them.

Activity

  1. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Progress: measurement report slice landed as PR #13381 (branch xaltha/13107-atlas-measurement, commits 8318717 + e15a51c).

    After this PR, npm test in pkgs/atlas-search/worker shows the §7 report rendering from live counters: HotCacheMeasurement accumulates hits/skips/revalidations/stale_serves/fills and D1 bytes per class and tenant; renderMeasurementReport gives per-class/per-tenant totals with skip/serve ratios, flags stale_serves as a defect when non-zero (expected zero, §1), labels the estimated Turso cost avoided with its method, and reports D1 stored bytes per tenant vs quota. Evidence: workflow run 12 failed on the test-only commit (Cannot find module '../src/measurement', 1 file failed / 7 passed); run 13 on the full slice is green (8 files, 75 tests, incl. the 20 new measurement tests).

    Acceptance status: "report renders from live counters" is met in the accumulator + renderer, fed through its public record API — but no live events flow into it yet (read-path integration is #13105), and the tuning round needs two weeks of live counters, so it is not in this slice; the report echoes the active config so the round has its before-values.

    Next slice: #13105 read-path integration, wiring live hit/skip/revalidation/fill events into the accumulator so the counters become live.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions