pub struct MemoryMetrics {Show 14 fields
pub ram_used_bytes: u64,
pub ram_total_bytes: u64,
pub ram_available_bytes: u64,
pub ram_cached_bytes: u64,
pub ram_buffers_bytes: u64,
pub swap_used_bytes: u64,
pub swap_total_bytes: u64,
pub gpu_vram: Vec<GpuVramMetrics>,
pub pressure_level: PressureLevel,
pub safe_parallel_jobs: u32,
pub ram_read_bandwidth_gbps: Option<f64>,
pub ram_write_bandwidth_gbps: Option<f64>,
pub ram_history: VecDeque<f64>,
pub swap_history: VecDeque<f64>,
}Expand description
Comprehensive memory metrics for system and GPU
Fields§
§ram_used_bytes: u64RAM used in bytes
ram_total_bytes: u64RAM total in bytes
ram_available_bytes: u64RAM available in bytes (accounts for cache/buffers)
ram_cached_bytes: u64RAM cached in bytes
ram_buffers_bytes: u64RAM buffers in bytes
swap_used_bytes: u64Swap used in bytes
swap_total_bytes: u64Swap total in bytes
gpu_vram: Vec<GpuVramMetrics>GPU VRAM metrics for each device
pressure_level: PressureLevelCurrent pressure level
safe_parallel_jobs: u32Safe number of parallel jobs (based on 3GB/job heuristic)
ram_read_bandwidth_gbps: Option<f64>RAM read bandwidth in GB/s
ram_write_bandwidth_gbps: Option<f64>RAM write bandwidth in GB/s
ram_history: VecDeque<f64>RAM usage history (percentage, 0.0-100.0)
swap_history: VecDeque<f64>Swap usage history (percentage, 0.0-100.0)
Implementations§
Source§impl MemoryMetrics
impl MemoryMetrics
Sourcepub const MAX_HISTORY_POINTS: usize = 60
pub const MAX_HISTORY_POINTS: usize = 60
Maximum history points (60 seconds at 1Hz)
Sourcepub fn ram_usage_percent(&self) -> f64
pub fn ram_usage_percent(&self) -> f64
Get RAM usage percentage (0.0-100.0)
Sourcepub fn ram_available_percent(&self) -> f64
pub fn ram_available_percent(&self) -> f64
Get RAM available percentage (0.0-100.0)
Sourcepub fn swap_usage_percent(&self) -> f64
pub fn swap_usage_percent(&self) -> f64
Get swap usage percentage (0.0-100.0)
Sourcepub fn ram_used_gb(&self) -> f64
pub fn ram_used_gb(&self) -> f64
Get RAM used in GB
Sourcepub fn ram_total_gb(&self) -> f64
pub fn ram_total_gb(&self) -> f64
Get RAM total in GB
Sourcepub fn swap_used_gb(&self) -> f64
pub fn swap_used_gb(&self) -> f64
Get swap used in GB
Sourcepub fn swap_total_gb(&self) -> f64
pub fn swap_total_gb(&self) -> f64
Get swap total in GB
Sourcepub fn total_vram_used_bytes(&self) -> u64
pub fn total_vram_used_bytes(&self) -> u64
Get total GPU VRAM used across all devices
Sourcepub fn total_vram_total_bytes(&self) -> u64
pub fn total_vram_total_bytes(&self) -> u64
Get total GPU VRAM capacity across all devices
Trait Implementations§
Source§impl Clone for MemoryMetrics
impl Clone for MemoryMetrics
Source§fn clone(&self) -> MemoryMetrics
fn clone(&self) -> MemoryMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more