pub struct SysinfoService {
pub cpu: Property<CpuData>,
pub memory: Property<MemoryData>,
pub disks: Property<Vec<DiskData>>,
pub network: Property<Vec<NetworkData>>,
/* private fields */
}Expand description
System information service for monitoring CPU, memory, disk, and network.
Provides reactive properties that update at configurable intervals.
All metrics are polled in the background and exposed via Property<T>
for both snapshot access (.get()) and stream-based watching (.watch()).
Polling intervals can be changed at runtime via set_*_interval() methods.
Fields§
§cpu: Property<CpuData>CPU metrics including usage, frequency, and temperature.
memory: Property<MemoryData>Memory and swap metrics.
disks: Property<Vec<DiskData>>Disk metrics for all mounted filesystems.
network: Property<Vec<NetworkData>>Network metrics for all interfaces.
Implementations§
Source§impl SysinfoService
impl SysinfoService
Sourcepub fn builder() -> SysinfoServiceBuilder
pub fn builder() -> SysinfoServiceBuilder
Returns a builder for configuring the service.
Sourcepub fn set_cpu_interval(&self, interval: Duration)
pub fn set_cpu_interval(&self, interval: Duration)
Updates the CPU polling interval.
Sourcepub fn set_cpu_temp_sensor(&self, sensor: &str)
pub fn set_cpu_temp_sensor(&self, sensor: &str)
Updates the CPU temperature sensor label.
Sourcepub fn set_memory_interval(&self, interval: Duration)
pub fn set_memory_interval(&self, interval: Duration)
Updates the memory polling interval.
Restarts the memory polling task with the new interval.
Sourcepub fn set_disk_interval(&self, interval: Duration)
pub fn set_disk_interval(&self, interval: Duration)
Updates the disk polling interval.
Restarts the disk polling task with the new interval.
Sourcepub fn set_network_interval(&self, interval: Duration)
pub fn set_network_interval(&self, interval: Duration)
Updates the network polling interval.
Restarts the network polling task with the new interval.