Skip to content

feat(fetcher): cross-platform system fetchers via sysinfo - #50

Merged
unhappychoice merged 4 commits into
mainfrom
feat/system-fetchers
Apr 21, 2026
Merged

unhappychoice merged 4 commits into
mainfrom
feat/system-fetchers

Conversation

@unhappychoice

Copy link
Copy Markdown
Owner

Summary

  • Seven sysinfo-backed fetchers replace the disk/system stubs and fill the realtime system block in the meta: widget catalog & roadmap #41 catalog: system, cpu_load, memory, uptime, load_average, process_top (realtime), plus disk (cached). All Safety::Safe, cross-platform (Linux / macOS / Windows), multi-shape so each fetcher feeds several renderers.
  • refresh_payloads no longer recomputes realtime fetchers each frame — the pre-loop compute persists through the 2s animation window. Fixes the footgun where process_top's /proc/*/stat walk would run up to 40× per splash invocation.
  • Dogfood .splashboard/config.toml adds cpu/memory/uptime/load/process widgets so the dev splash exercises every new fetcher end-to-end.

Catalog (#41)

Ticks:

  • system (realtime rollup)
  • cpu_load
  • memory
  • disk (replace stub)
  • uptime
  • load_average (new entry)
  • process_top

Explicitly out-of-scope (each would need per-OS native APIs or delta tracking that breaks the realtime <1ms contract): battery, network_speed, wifi_ssid, gpu, sensor_temperatures, ip_addresses, mounted_volumes.

Test plan

  • cargo test — 220 passed
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo run in this repo renders without panics, every new widget displays real data
  • Verify on macOS (load_average, process_top, disks from /Volumes)
  • Verify on Windows (load_average shows n/a (windows), disk picks system drive)

🤖 Generated with Claude Code

unhappychoice and others added 3 commits April 22, 2026 06:27
Previously `refresh_payloads` recomputed realtime payloads on every frame
tick (up to 40 times during the 2s animation window). Animation is a
renderer concern — fetchers producing different data each tick was never
the contract. Pre-loop initial compute now persists for the whole window;
only cache-backed entries refresh between frames.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Replaces the `disk` and `system` stubs with seven sysinfo-backed
fetchers covering the realtime system block from the #41 catalog:

- system     (Entries/Lines) — OS/host/uptime/load/cpu/memory rollup
- cpu_load   (Ratio/Lines)
- memory     (Ratio/Lines/Entries)
- uptime     (Lines)
- load_average (Lines/Entries) — Windows shows n/a
- process_top  (Entries/Lines) — top 5 by CPU
- disk       (Ratio/Lines/Bars) — cached, largest disk picked as primary

All classified Safety::Safe (local kernel counters only, no network or
exec). Multi-shape so each can feed text/ascii_art/gauge/table renderers
as the config chooses. Cross-platform via sysinfo's unified API.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Adds cpu_load/memory/uptime/load_average/process_top widgets so the dev
splash exercises the new fetchers end-to-end. Each picks one valid
renderer from the fetcher's shape list; the existing system+disk widgets
now draw real data instead of the canned stub values.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 21, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@unhappychoice has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 19 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 4 minutes and 19 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48555a19-ea03-4205-a9e8-b4cbd5f07991

📥 Commits

Reviewing files that changed from the base of the PR and between 1a755fd and a659ad8.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .splashboard/config.toml
  • Cargo.toml
  • src/fetcher/mod.rs
  • src/fetcher/stub.rs
  • src/fetcher/system.rs
  • src/runtime.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/system-fetchers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@unhappychoice
unhappychoice merged commit 6ada113 into main Apr 21, 2026
5 checks passed
@unhappychoice
unhappychoice deleted the feat/system-fetchers branch April 21, 2026 21:34
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