This content originally appeared on DEV Community and was authored by Anderson Yu-Hong Cai
Introduction
Recently, I contributed a Windows-specific network monitoring feature to the open-source project SysMood — a small system stats CLI that originally showed only CPU and memory usage.
This post documents how I went from opening an issue to submitting a pull request, including what I built, the challenges I met, and what I learned along the way.
PR: https://github.com/RayBreeze/SysMood/pull/8
Background
- Project: SysMood (lightweight CLI system monitor)
- Goal: Add Network Sent / Received (KB/s) to the main display
- Environment: Windows (MinGW / g++, CMake)
Workflow
- Opened Issue #7 proposing network monitoring for Hacktoberfest.
- Created a
feature/network-monitor-windowsbranch. - Implemented logic in
network_monitor.hfor quick testing. - Adjusted
main.cppdisplay and “mood” thresholds. - Compiled, tested, and fixed bugs repeatedly.
- Submitted the PR with clear description and Closes #7.
Technical Highlights
-
API Used:
GetIfTable(fromiphlpapi) to retrieve interface counters.- Tried
GetIfTable2for 64-bit stats but reverted for broader compatibility.
- Tried
-
Build: Requires linking
-liphlpapi(CMake already handles this). -
Filtering: Deduplicated interfaces by
dwIndexand ignored inactive ones. - Overflow Handling: Added wrap-around logic since counters are 32-bit.
- Sampling: Two readings (3s apart), rate = Δbytes / elapsed time.
- Display: Unified units to KB/s with simple thresholds (0, 1, 10, 100, 1000).
Key Challenges & Fixes
-
Linking Error: Fixed by linking
-liphlpapi. -
Header Incompatibility:
GetIfTable2unavailable in MinGW → fallback. - Timing Bug: Corrected order of t0/t1 sampling and interval computation.
- Unit Confusion: Clarified KB/s vs Kb/s and adjusted mood thresholds.
Lessons Learned
- Windows IP Helper API quirks and MinGW compatibility details.
- Importance of documenting quick build commands (
g++ ... -liphlpapi). - Counter wrap-around is a real issue in performance stats.
- Even small contributions benefit from clear issue planning and minimal PR scope.
Future Ideas
- Support
GetIfTable2when headers allow (native 64-bit). - Move logic into
src/network_monitor.cppfor cleaner structure. - Add an optional
--network-debugmode for verbose output. - Consider smoother averaging for display (EMA or multi-sample).
Conclusion
This Issue → PR journey helped me understand Windows network monitoring in depth — from API details to linking traps.
For anyone planning similar contributions: start with a well-defined issue, test iteratively, and keep your PRs small and review-friendly.
This content originally appeared on DEV Community and was authored by Anderson Yu-Hong Cai
Anderson Yu-Hong Cai | Sciencx (2025-10-12T05:16:53+00:00) PR-02 at Hacktoberfest: From Issue to Pull Request: Adding Windows Network Monitoring to SysMood. Retrieved from https://www.scien.cx/2025/10/12/pr-02-at-hacktoberfest-from-issue-to-pull-request-adding-windows-network-monitoring-to-sysmood-2/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.