//! Memory usage sampling

/// Sample memory usage (percent, used bytes, and total bytes)
pub fn sample_memory_usage() -> (f64, u64, u64) {
    let mut system = sysinfo::System::new_all();
    system.refresh_memory();
    let used = system.used_memory();
    let total = system.total_memory();
    let percent = if total > 0 {
        (used as f64 / total as f64) * 100.0
    } else {
        0.0
    };
    (percent, used, total)
}
