feat(telemetry): local move-preview adoption metrics (Phase 4) #155

Merged
developer merged 1 commits from feature/local-eval-telemetry into development 2026-07-01 21:39:59 +00:00
Owner

Phase 4 of the local move-preview accelerator (docs/ARCHITECTURE.md §5, §11).

Measures uptake so the feature can be watched before it is defaulted on:

  • local_eval_cold_start_total — app cold starts (the adoption denominator).
  • local_eval_dict_load_total (result = fetched/cache_hit/miss) — a dawg download that fills IndexedDB, a cache hit, or a warm-up that failed/timed out.
  • local_eval_preview_total (path = local/network) — the share computed on-device vs the network evaluate fallback.

Non-blocking by design: the in-app note* counters are plain in-memory increments on the gameplay path; only a periodic flush() touches the network (a session-gated POST /metrics/local-eval beacon, 60s timer + on backgrounding, fire-and-forget, keepalive). The gateway folds each batch into OTel counters (in-memory .Add), clamped against a spoofed inflation. Surfaced on the Scrabble — Users dashboard.

Verified: Go gofmt/vet/build; UI check, build, bundle (100.3/110), unit (361), e2e (160). Conformance is unaffected (no change to the dawg/validate/eval surface) and runs in CI.

Phase 4 of the local move-preview accelerator (docs/ARCHITECTURE.md §5, §11). Measures uptake so the feature can be watched before it is defaulted on: - `local_eval_cold_start_total` — app cold starts (the adoption denominator). - `local_eval_dict_load_total` (`result` = fetched/cache_hit/miss) — a dawg download that fills IndexedDB, a cache hit, or a warm-up that failed/timed out. - `local_eval_preview_total` (`path` = local/network) — the share computed on-device vs the network `evaluate` fallback. **Non-blocking by design:** the in-app `note*` counters are plain in-memory increments on the gameplay path; only a periodic `flush()` touches the network (a session-gated `POST /metrics/local-eval` beacon, 60s timer + on backgrounding, fire-and-forget, `keepalive`). The gateway folds each batch into OTel counters (in-memory `.Add`), clamped against a spoofed inflation. Surfaced on the **Scrabble — Users** dashboard. Verified: Go gofmt/vet/build; UI check, build, bundle (100.3/110), unit (361), e2e (160). Conformance is unaffected (no change to the dawg/validate/eval surface) and runs in CI.
developer added 1 commit 2026-07-01 21:32:03 +00:00
feat(telemetry): local move-preview adoption metrics (Phase 4)
CI / changes (pull_request) Successful in 3s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 57s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m17s
2e8fa83814
Measure uptake of the client-side local move-preview accelerator (§5) so
adoption can be watched before defaulting it on: app cold starts, dictionary
loads by result (fetched / cache_hit / miss) and move previews by path
(local / network — the backend load shed).

A small best-effort client beacon (POST /metrics/local-eval, session-gated)
batches counter deltas and posts them on a 60s timer and when the app is
backgrounded — never on the gameplay path: the in-app counters are plain
in-memory increments, only the periodic flush touches the network and it is
fire-and-forget. The gateway folds each batch into three OTel counters
(local_eval_cold_start_total, local_eval_dict_load_total,
local_eval_preview_total), clamped against a spoofed inflation.

- gateway: counters + recordLocalEval + session-gated /metrics/local-eval handler
- ui: localeval-metrics accumulator/beacon; hooks in the dict loader, in
  Game.recompute and in bootstrap (skipped under the mock harness)
- caddy: route /metrics/* to the gateway
- docs: ARCHITECTURE §11; Grafana "Scrabble — Users" dashboard panels
owner approved these changes 2026-07-01 21:39:39 +00:00
developer merged commit c864147982 into development 2026-07-01 21:39:59 +00:00
developer deleted branch feature/local-eval-telemetry 2026-07-01 21:40:00 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#155