[−][src]Function sys_metrics::cpu::get_loadavg
pub fn get_loadavg() -> Result<LoadAvg, Error>
Returns the LoadAvg over the last 1, 5 and 15 minutes.
In Linux, the LoadAvg is technically believed to be a running average of processes in it’s (kernel) execution queue tagged as running or uninterruptible.
Exemples
use sys_metrics::LoadAvg; use sys_metrics::cpu::get_loadavg; let loadavg: LoadAvg = match get_loadavg() { Ok(val) => val, Err(x) => panic!(x), }; // Should print your system load avg println!("{:?}", loadavg);