Skip to content

Clarify TUI sampling semantics and preserve socket baselines - #141

Merged
zhongwencool merged 2 commits into
mainfrom
zw/clarify-sampling-semantics
Sep 28, 2026
Merged

zhongwencool merged 2 commits into
mainfrom
zw/clarify-sampling-semantics

Conversation

@zhongwencool

@zhongwencool zhongwencool commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Clarify the measurement contract in the interactive Home, Sockets, and System views without changing their memory data sources or the versioned CLI response schema.

  • Distinguish current values, cumulative Reds total, signed change columns, and Reds/s calculated from actual monotonic elapsed time.
  • Show warming up instead of lifetime totals in first-window results. Keep missing samples, counter resets, and pause/resume visible; preserve negative memory/heap/queue changes.
  • Preserve socket sampling baselines across sorting, paging, and refresh changes. Key baselines by socket identity, clear them after failed enumeration, and fence updated row mappings before accepting a selection.
  • Keep the developer-facing recon:proc_count(...) / recon:proc_window(...) expressions. Prefer a single navigation/status row, hide zero missing/reset counts, and wrap without truncating important status on narrow terminals.
  • Replace the ambiguous delta glyph with change / chg, distinguish socket window counters from lifetime maxima, and explicitly label Home's used memory versus System's allocated memory.
  • Document the semantics and add regression tests for real UDP deltas, missing/reset samples, socket identity, pause/resume, baseline preservation, and terminal widths.

CI and local runtime follow-up

  • Pin the OTP 29 test job and Mix job to OTP 29.1.1, and use the same version as the OTP 26 cross-version target.
  • Retain OTP 26-28 compatibility coverage, existing check names, and major-version release artifacts.
  • Lower the Codecov project target to 95%; keep the patch target at 50% and both thresholds at 0%.
  • Upgrade the local mise global Erlang default to OTP 29.1.1. This machine-local change is not a repository runtime pin; the existing Elixir configuration is unchanged.

Validation

Rebased onto current main (30bfc1a) before final validation.

  • mise exec -- rebar3 eunit — 811 tests passed on the new default OTP 29.1.1.
  • mise exec -- rebar3 as ci check (OTP 29.1.1) — passed compilation, lint, formatting, xref, Dialyzer, and HTML/Markdown/EPUB documentation generation.
  • mise exec -- scripts/escript-smoke.sh (OTP 29.1.1) — 17 cases passed, including remote TUI cleanup on stdin EOF.
  • rebar3 fmt --check and git diff --check — passed.
  • Captured live terminal output verified heap count/window switching, warm-up, and measured sample timing; automated rendering tests cover wide and narrow layouts.

The former OTP 28.0.2 default had an ExDoc re:import/1 incompatibility. The local default is now OTP 29.1.1, and the complete quality check, including ExDoc, passes without a per-command version override. Both YAML files were parsed and their OTP selection, stable check/artifact names, upload gates, and coverage targets were validated.

Scope and compatibility

  • No CLI schema changes, release, deployment, or main-branch write.
  • This builds on the merged System distribution changes rather than replacing them.
  • Socket reconnection identity is covered by fixtures; no new manual remote reconnect acceptance claim is made.
  • Hosted CI and cross-OTP acceptance are separate from the local checks above.

Changes:
- Distinguish current memory, cumulative reductions, signed window changes, and reductions per second measured with monotonic time.
- Show warm-up, missing samples, and counter resets explicitly, and preserve socket baselines across sort, page, and refresh changes.
- Keep recon-style mode expressions in a compact, width-aware header and label used versus allocated memory without changing data sources or the CLI schema.
- Add regression coverage for sampling, real UDP traffic, pause/resume, socket identity, baseline resets, and terminal layout; document the display contract.

Validation:
- After rebasing onto main, rebar3 eunit passed all 811 tests on OTP 28.0.2.
- mise exec erlang@28.5 -- rebar3 as ci check passed compilation, lint, formatting, xref, Dialyzer, and documentation generation.
- The default OTP 28.0.2 quality run reached ExDoc but failed on unavailable re:import/1; the complete check passed using installed OTP 28.5 without project configuration changes.
- scripts/escript-smoke.sh passed all 17 cases, including remote TUI stdin EOF cleanup.
- rebar3 fmt --check and git diff --check passed; captured terminal output verified heap count/window switching, warm-up, and measured sample timing.
@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.38202% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.81%. Comparing base (30bfc1a) to head (4d7e3ae).

Files with missing lines Patch % Lines
src/observer_cli_socket.erl 90.90% 8 Missing ⚠️
src/observer_cli_lib.erl 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
- Coverage   97.85%   97.81%   -0.05%     
==========================================
  Files          24       24              
  Lines        7939     8064     +125     
==========================================
+ Hits         7769     7888     +119     
- Misses        170      176       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Changes:
- Pin the OTP 29 test job, Mix job, and OTP 26 cross-version target to OTP 29.1.1 while retaining OTP 26-28 compatibility coverage.
- Keep major-version check names, release artifact names, and coverage-upload gates unchanged.
- Set the Codecov project target to 95%, preserving the 50% patch target and zero thresholds.

Validation:
- Parsed both YAML files and asserted resolved OTP versions, compatibility matrix entries, stable check/artifact names, upload gates, and coverage targets.
- With the local default upgraded to OTP 29.1.1, mise exec -- rebar3 as ci check passed compilation, lint, formatting, xref, Dialyzer, and documentation generation.
- mise exec -- rebar3 eunit passed all 811 tests on OTP 29.1.1.
- mise exec -- scripts/escript-smoke.sh passed all 17 cases on OTP 29.1.1.
- git diff --check passed; hosted CI will validate the updated workflow after push.
@zhongwencool
zhongwencool merged commit e0b9e19 into main Sep 28, 2026
8 checks passed
@zhongwencool
zhongwencool deleted the zw/clarify-sampling-semantics branch September 28, 2026 12:31
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