Skip to content

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

@moksha-hub

Description

@moksha-hub

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions