feat: add network, process, and system info collectors#6
Conversation
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.
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
dev-dami
left a comment
There was a problem hiding this comment.
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.
Summary
Adds three new metric collectors that turn gim from a basic CPU/memory/disk tool into something worth actually using.
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
feat(modules): add network interface traffic collectorfeat(modules): add process collector with top-5 by memory and CPUfeat(modules): add system info collector with OS, uptime, and loadfeat(modules): register network, process, and system in mod.rsSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.