diff --git a/.gitignore b/.gitignore index 6635cf5..c68c498 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,7 @@ node_modules !.env.example vite.config.js.timestamp-* vite.config.ts.timestamp-* + +## Jetbrains +.idea/ +.run/ \ No newline at end of file diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..a9fe74d Binary files /dev/null and b/bun.lockb differ diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 7a172a4..ef03e39 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -35,6 +35,8 @@ struct SystemStats { cpu_usage: Vec, memory_total: u64, memory_used: u64, + memory_free:u64, + memory_cached: u64, uptime: u64, load_avg: [f64; 3], } @@ -83,11 +85,15 @@ async fn get_processes(state: State<'_, AppState>) -> Result<(Vec, }) .collect(); + let memory_cached = sys.available_memory() - sys.free_memory(); + let load_avg = sys.load_average(); let system_stats = SystemStats { cpu_usage: sys.cpus().iter().map(|cpu| cpu.cpu_usage()).collect(), memory_total: sys.total_memory(), memory_used: sys.used_memory(), + memory_free: sys.available_memory(), + memory_cached,//FIXME: get accurate value uptime: sys.uptime(), load_avg: [load_avg.one, load_avg.five, load_avg.fifteen], };