Skip to content

feat: add network, process, and system info collectors#6

Merged
dev-dami merged 4 commits intomainfrom
feat/new-modules
Feb 2, 2026
Merged

feat: add network, process, and system info collectors#6
dev-dami merged 4 commits intomainfrom
feat/new-modules

Conversation

@dev-dami
Copy link
Owner

@dev-dami dev-dami commented Feb 2, 2026

Summary

Adds three new metric collectors that turn gim from a basic CPU/memory/disk tool into something worth actually using.

  • network — enumerates all network interfaces via sysinfo's Networks API, reports total rx/tx bytes and per-interface breakdown
  • process — snapshots all running processes, reports total count and top 5 by memory and CPU usage (name, pid, value)
  • system — reports OS name, version, kernel, hostname, arch, uptime (seconds + human readable), and 1/5/15m load averages

All three implement the existing MetricCollector trait so they slot into the engine and both frontends without changes. mod.rs updated to export them.

Commits

  1. feat(modules): add network interface traffic collector
  2. feat(modules): add process collector with top-5 by memory and CPU
  3. feat(modules): add system info collector with OS, uptime, and load
  4. feat(modules): register network, process, and system in mod.rs

Summary by CodeRabbit

  • New Features
    • Added network metrics monitoring to track interface activity, bytes received and transmitted, and interface count details.
    • Added process metrics monitoring to display the top-5 processes ranked by memory and CPU usage.
    • Added system metrics reporting including OS name and version, kernel information, hostname, CPU architecture, uptime, and load averages.

✏️ Tip: You can customize this high-level summary in your review settings.

NetworkCollector uses sysinfo's Networks::new_with_refreshed_list()
to enumerate all network interfaces and sum total bytes received and
transmitted. Reports per-interface breakdown as a List metric with
human-readable byte formatting. Useful for spotting which interface
is handling traffic and rough bandwidth consumption.
ProcessCollector snapshots all running processes and reports total
count, top 5 by memory consumption (name, pid, MB), and top 5 by
CPU usage (name, pid, percentage). Gives a quick htop-style summary
without needing a separate tool.
SystemCollector reports OS name, version, kernel version, hostname,
CPU architecture, uptime in seconds and human-readable format (Xd Yh Zm),
and 1/5/15 minute load averages. Uses sysinfo static methods so it
does not need a System instance refresh. Load averages return zeros
on Windows which is expected behavior.
Exports the three new modules so they can be imported by the engine.
@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The pull request adds three new metric collector modules—network, process, and system—to gather runtime statistics. The module declarations are updated to expose these collectors publicly, with memory module reordered in the declaration list.

Changes

Cohort / File(s) Summary
Module Declarations
src/modules/mod.rs
Reordered public module declarations; added three new public module exports: network, process, and system alongside existing cpu and disk modules.
New Metric Collectors
src/modules/network.rs, src/modules/process.rs, src/modules/system.rs
Introduced three new metric collector implementations each with a public struct and new() constructor that implement the MetricCollector trait. Network collects interface statistics, process gathers top-5 CPU and memory consumers, and system captures OS and hardware information.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Three collectors hop through the code,
Network, process, system load,
Each one metrics swift collect,
Data flowing, all correct! 📊
Into mod.rs they blend,
On this journey, code will mend. ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/new-modules

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.

Copy link
Owner Author

@dev-dami dev-dami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all 4 commits: network collector with interface enumeration, process collector with top-5 sorting, system info collector with OS/uptime/load, and mod.rs registration. Implementation follows existing collector patterns (returns Vec, uses sysinfo refresh). LGTM.

@dev-dami dev-dami merged commit 6941ad2 into main Feb 2, 2026
2 of 4 checks passed
@dev-dami dev-dami deleted the feat/new-modules branch February 2, 2026 03: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