Skip to content

feat(#196): expose blocks/disk_growth/xvb_history on /api/state (Tier-1)#707

Merged
VijitSingh97 merged 2 commits into
develop-v1.11from
feat/196-telemetry-persistence-tier1
Jul 21, 2026
Merged

feat(#196): expose blocks/disk_growth/xvb_history on /api/state (Tier-1)#707
VijitSingh97 merged 2 commits into
develop-v1.11from
feat/196-telemetry-persistence-tier1

Conversation

@VijitSingh97

Copy link
Copy Markdown
Collaborator

Summary

Partial #196 — Tier-1 persistence.

The #196 telemetry-persistence epic's backbone (PR #600, already on develop/develop-v1.11) added
five dedicated SQLite tables — blocks, xvb_history, network_history, disk_growth,
worker_history — each with its own capture hook, retention, and per-table write-health signal.
That PR was deliberately scoped to storage only: "Backbone only — capture, storage, retention, and
a getter per series; charts/UI and /api/state exposure are deliberate follow-ups."

This PR is that follow-up for the three series the parent task calls Tier-1:

  • blocks — pool block-found events (permanent, event-driven)
  • disk_growth — hourly monerod-DB-size + host-disk-usage samples (permanent)
  • xvb_history — ~5-min XvB-credited scalar samples (30-day retention)

Each is now assembled in build_state() (build/dashboard/mining_dashboard/web/views.py) from the
existing StateManager.get_blocks() / get_disk_growth() / get_xvb_history() getters, range/window
-filtered the same way as the existing share_stats series, and bucket-averaged past the existing
700-point chart cap for disk_growth/xvb_history (both can exceed that cap over a long-lived
install; blocks can't — a handful of rows a week — so it isn't downsampled). A ponytail-review pass
folded the two gauge-series formatters into one shared helper (net -13 lines).

Deferred / out of scope (per the parent task's explicit instructions):

  • network_history and worker_history (Tier-2) are not exposed here — separate slice of the epic.
  • No chart/UI renders any of these three series yet. Storage, capture, retention, and now API
    exposure are done; charting is a further follow-up.
  • Pool-wide share-health (share_stats) was already shipped under Store share stats as time-series for reject-rate trends/charting #116 — untouched.

Because the storage/capture/retention/counter-reset backbone (including its own tests) was already
merged in #600, this PR is scoped to exactly the missing piece: the /api/state formatters, their
wiring, and their tests.

Targets the v1.11 integration branch; merges to develop after v1.10 ships.

Test plan

  • make lint — all surfaces pass except lint-proto (needs a Docker daemon, unavailable in
    this sandbox; unrelated to this change — the vendored Tari protos aren't touched).
  • make test-dashboard — 1472 passed, 96.66% overall coverage (gate: 80%).
  • diff-cover coverage.xml --compare-branch=origin/develop-v1.11 --fail-under=90 — 96.3% patch
    coverage (1 pre-existing-pattern uncovered defensive line, matching the identical branch in
    the existing _downsample_share_stats/_downsample_history).
  • bash tests/stack/run.sh — 1541 passed, 0 failed.
  • bash tests/stack/test_compose.sh — all checks passed.
  • bash tests/integration/selftest.sh — 132 passed, 0 failed.
  • uv run pytest tests/integration/fakes — 23 passed.
  • node --test build/dashboard/tests/frontend/*.test.mjs — 222 passed.
  • make lint-docs-voice / make lint-md — clean on the doc/changelog edits.

🤖 Generated with Claude Code

VijitSingh97 and others added 2 commits July 20, 2026 20:53
The #196 telemetry backbone (PR #600) added persisted SQLite tables and
capture hooks for five series but shipped without surfacing any of them
to the client. This adds the missing /api/state exposure for the three
Tier-1 series — blocks, disk_growth, xvb_history — range-filtered like
share_stats and bucket-averaged past the existing 700-point chart cap
for the two higher-cadence series. network_history and worker_history
(Tier-2) are untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e-series helper

ponytail-review: build_disk_growth and build_xvb_history duplicated the same
filter -> downsample -> {x, ...cols} shape, differing only in which columns
they carry. Shared _gauge_series helper, net -13 lines.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@VijitSingh97
VijitSingh97 merged commit 1058c0c into develop-v1.11 Jul 21, 2026
16 checks passed
VijitSingh97 added a commit that referenced this pull request Jul 21, 2026
…d branch — union CHANGELOG + dashboard.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@VijitSingh97
VijitSingh97 deleted the feat/196-telemetry-persistence-tier1 branch July 21, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant