Skip to content

feat(system_monitor): Add Network and Disk I/O metrics for observability#49

Open
moksha-hub wants to merge 1 commit intomofa-org:mainfrom
moksha-hub:feat/network-disk-metrics
Open

feat(system_monitor): Add Network and Disk I/O metrics for observability#49
moksha-hub wants to merge 1 commit intomofa-org:mainfrom
moksha-hub:feat/network-disk-metrics

Conversation

@moksha-hub
Copy link
Copy Markdown

@moksha-hub moksha-hub commented Feb 27, 2026

Add Network and Disk I/O monitoring capabilities to the system monitor for complete observability of system resources.

Motivation

Currently, the system monitor only tracks CPU, memory, and GPU usage. For real-time applications and performance monitoring, network and disk I/O metrics are essential to understand:

  • Network throughput (upload/download rates)
  • Disk activity (read/write rates)
  • Potential I/O bottlenecks

Proposed Solution

Add the following metrics to system_monitor.rs:

Network I/O

  • get_network_tx_rate() — Network transmission rate (bytes/sec)
  • get_network_rx_rate() — Network receive rate (bytes/sec)
  • get_network_total_rate() — Combined network I/O rate
  • format_network_rate() — Human-readable formatting (KB/s, MB/s, GB/s)

Disk I/O

  • get_disk_read_rate() — Disk read rate (bytes/sec)
  • get_disk_write_rate() — Disk write rate (bytes/sec)
  • get_disk_total_rate() — Combined disk I/O rate
  • format_disk_rate() — Human-readable formatting

Implementation Details

  • Use sysinfo crate's Networks and Disks APIs
  • Calculate rates by measuring delta between snapshots
  • Store rates in atomic variables for thread-safe access
  • Add helper structs NetworkSnapshot and DiskSnapshot

Related

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