PR-02 at Hacktoberfest: From Issue to Pull Request: Adding Windows Network Monitoring to SysMood

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…


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

  1. Opened Issue #7 proposing network monitoring for Hacktoberfest.
  2. Created a feature/network-monitor-windows branch.
  3. Implemented logic in network_monitor.h for quick testing.
  4. Adjusted main.cpp display and “mood” thresholds.
  5. Compiled, tested, and fixed bugs repeatedly.
  6. Submitted the PR with clear description and Closes #7.

Technical Highlights

  • API Used: GetIfTable (from iphlpapi) to retrieve interface counters.
    • Tried GetIfTable2 for 64-bit stats but reverted for broader compatibility.
  • Build: Requires linking -liphlpapi (CMake already handles this).
  • Filtering: Deduplicated interfaces by dwIndex and 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: GetIfTable2 unavailable 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 GetIfTable2 when headers allow (native 64-bit).
  • Move logic into src/network_monitor.cpp for cleaner structure.
  • Add an optional --network-debug mode 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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » PR-02 at Hacktoberfest: From Issue to Pull Request: Adding Windows Network Monitoring to SysMood." Anderson Yu-Hong Cai | Sciencx - Sunday October 12, 2025, https://www.scien.cx/2025/10/12/pr-02-at-hacktoberfest-from-issue-to-pull-request-adding-windows-network-monitoring-to-sysmood-2/
HARVARD
Anderson Yu-Hong Cai | Sciencx Sunday October 12, 2025 » PR-02 at Hacktoberfest: From Issue to Pull Request: Adding Windows Network Monitoring to SysMood., viewed ,<https://www.scien.cx/2025/10/12/pr-02-at-hacktoberfest-from-issue-to-pull-request-adding-windows-network-monitoring-to-sysmood-2/>
VANCOUVER
Anderson Yu-Hong Cai | Sciencx - » PR-02 at Hacktoberfest: From Issue to Pull Request: Adding Windows Network Monitoring to SysMood. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/10/12/pr-02-at-hacktoberfest-from-issue-to-pull-request-adding-windows-network-monitoring-to-sysmood-2/
CHICAGO
" » PR-02 at Hacktoberfest: From Issue to Pull Request: Adding Windows Network Monitoring to SysMood." Anderson Yu-Hong Cai | Sciencx - Accessed . https://www.scien.cx/2025/10/12/pr-02-at-hacktoberfest-from-issue-to-pull-request-adding-windows-network-monitoring-to-sysmood-2/
IEEE
" » PR-02 at Hacktoberfest: From Issue to Pull Request: Adding Windows Network Monitoring to SysMood." Anderson Yu-Hong Cai | Sciencx [Online]. Available: https://www.scien.cx/2025/10/12/pr-02-at-hacktoberfest-from-issue-to-pull-request-adding-windows-network-monitoring-to-sysmood-2/. [Accessed: ]
rf:citation
» PR-02 at Hacktoberfest: From Issue to Pull Request: Adding Windows Network Monitoring to SysMood | Anderson Yu-Hong Cai | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.