mirror of
https://github.com/kunkunsh/kunkun-ext-neohtop.git
synced 2025-04-11 17:29:45 +00:00
add: mem free, cached
This commit is contained in:
parent
20cba8b518
commit
4a8a79fee9
@ -27,6 +27,8 @@ struct SystemStats {
|
|||||||
cpu_usage: Vec<f32>,
|
cpu_usage: Vec<f32>,
|
||||||
memory_total: u64,
|
memory_total: u64,
|
||||||
memory_used: u64,
|
memory_used: u64,
|
||||||
|
memory_free:u64,
|
||||||
|
memory_cached: u64,
|
||||||
uptime: u64,
|
uptime: u64,
|
||||||
load_avg: [f64; 3],
|
load_avg: [f64; 3],
|
||||||
}
|
}
|
||||||
@ -90,6 +92,8 @@ async fn get_system_stats(state: State<'_, AppState>) -> Result<SystemStats, Str
|
|||||||
cpu_usage: sys.cpus().iter().map(|cpu| cpu.cpu_usage()).collect(),
|
cpu_usage: sys.cpus().iter().map(|cpu| cpu.cpu_usage()).collect(),
|
||||||
memory_total: sys.total_memory(),
|
memory_total: sys.total_memory(),
|
||||||
memory_used: sys.used_memory(),
|
memory_used: sys.used_memory(),
|
||||||
|
memory_free: sys.free_memory(),
|
||||||
|
memory_cached: sys.available_memory(),//TODO:
|
||||||
uptime: sys.uptime(),
|
uptime: sys.uptime(),
|
||||||
load_avg: [load_avg.one, load_avg.five, load_avg.fifteen],
|
load_avg: [load_avg.one, load_avg.five, load_avg.fifteen],
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user