Skip to content

Add network RX/TX metrics to TUI top-line header#12

Draft
Copilot wants to merge 7 commits into
testfrom
copilot/add-network-metrics
Draft

Add network RX/TX metrics to TUI top-line header#12
Copilot wants to merge 7 commits into
testfrom
copilot/add-network-metrics

Conversation

Copilot AI commented May 15, 2026

Copy link
Copy Markdown

The issue requested new top-line metrics in the main TUI header. This update adds cumulative network receive/transmit badges so header telemetry includes memory, swap, load, and network activity.

  • Header metrics update (ptop3/monitor.py)

    • Added network counters to TUI.draw() via psutil.net_io_counters().
    • Rendered two new badges in the existing top-line badge row:
      • rx = bytes_recv in GiB
      • tx = bytes_sent in GiB
    • Added safe fallback (0.0) when network counters are unavailable.
  • Targeted monitor test updates (tests/test_monitor.py)

    • Mocked psutil.net_io_counters() in draw-path tests.
    • Asserted that RX/TX labels and values appear in rendered header output.
    • Preserved existing coverage expectations by widening one fake screen scenario so full header badges render.
  • User-facing docs/changelog

    • Updated README feature summary to include network badges in the colored header.
    • Added an Unreleased changelog entry describing the new RX/TX top-line metrics.
net = psutil.net_io_counters()
rx_gib = net.bytes_recv / (1024 ** 3)
tx_gib = net.bytes_sent / (1024 ** 3)

badges.extend([
    ("rx", f"{rx_gib:.1f}G", bg_label, bg_neut),
    ("tx", f"{tx_gib:.1f}G", bg_label, bg_neut),
])

Copilot AI linked an issue May 15, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add network metrics to update top line Add network RX/TX metrics to TUI top-line header May 15, 2026
Copilot AI requested a review from spazyCZ May 15, 2026 14:57
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.

add network metrics

2 participants