Skip to content

feat: pg_stat_io screen (hotkey j/J) — count + time sub-screens (#006)#141

Merged
lesovsky merged 20 commits into
developfrom
feature/pg-stat-io
Jun 21, 2026
Merged

feat: pg_stat_io screen (hotkey j/J) — count + time sub-screens (#006)#141
lesovsky merged 20 commits into
developfrom
feature/pg-stat-io

Conversation

@lesovsky

Copy link
Copy Markdown
Owner

Feature 006: pg_stat_io screen (flagship of 0.11.0)

New TUI screen for pg_stat_io (PostgreSQL 16+) in pgcenter top — unified IO breakdown by
backend_type × object × context, shown as per-interval rates.

What's new

  • Two sub-screens (no horizontal scroll in pgcenter, so split like pg_stat_statements):
    • j — count screen (operations + KiB throughput); repeat j toggles to timings.
    • J — 2-item menu (pg_stat_io operations / pg_stat_io timings).
  • Version-aware query: PG 16/17 (op_bytes) vs PG 18 (native read_bytes/write_bytes/extend_bytes + object='wal' rows).
  • Synthetic io_key for cross-sample row matching (single-column UniqueKey, like statements_io).
  • coalesce(...,0) on every diffed column (NULL-abort safety, ADR [005]); KiB via integer /1024.
  • TUI-only, NotRecordable: true — record/report is a separate 0.11.0 feature.
  • PG 14/15 → standard "not supported" message (MinRequiredVersion = PostgresV16).

Files

internal/query/io.go (+ query.go constants PostgresV15–18), internal/view/view.go
(views stat_io / stat_io_time), top/{keybindings,menu,config_view,help}.go. +426/−4.

Testing

  • Unit: selector shape per version {14–18}, NULL-safety, menuStatIO item count, statioNextView toggle, switchViewTo wiring.
  • Integration (CI matrix PG 14–18): live query shape; PG 18 job gates native *_bytes + object='wal'.
  • make build ✅ · make lint ✅ (0 findings) · feature-package tests ✅.

Verification notes

  • Manual TUI walk (US1–US4) confirmed on live PG 17 by the maintainer.
  • PG 18 object='wal' + native bytes — gated by the CI PG18 job (not reproducible in the dev sandbox).

Planning artifacts (user-spec → tech-spec → tasks → decisions → QA report) under docs/features/006-feat-pg-stat-io/.

🤖 Generated with Claude Code

Alexey Lesovsky and others added 20 commits June 21, 2026 19:39
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e, add column priority, menu binding, width estimate

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Also sync user-spec: io_key is a visible md5 column (column hiding not supported by align).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ols by priority, consts in io.go, tighten align rationale

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…c naming

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-18 constants)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…res)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…view reports

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…views

Adding stat_io + stat_io_time (both NotRecordable) raises filterViews' dropped count by 2 on every version; wantV unchanged. Missed in the sandbox where the record package also fails on connection-refused, masking this pure-unit assertion.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ech debt, metrics, archive

Update overview/architecture/patterns; add features-catalog + 3 ADRs + tech-debt [007]; spec reconciliation (io_key visible); metrics summary to docs/metrics/; archive feature dir.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lesovsky lesovsky merged commit 0768752 into develop Jun 21, 2026
1 check passed
@lesovsky lesovsky deleted the feature/pg-stat-io branch June 21, 2026 16:28
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