Crates.io | proc_monitor |
lib.rs | proc_monitor |
version | 0.1.2 |
source | src |
created_at | 2022-09-01 13:37:47.954713 |
updated_at | 2022-09-04 07:34:29.410896 |
description | Linux/Macos process monitor. |
homepage | https://github.com/tqlab/proc-rs |
repository | |
max_upload_size | |
id | 656697 |
size | 100,249 |
Get current process infomation for monitor.
use crate::proc_monitor;
let p = proc_monitor::get_info();
println!(
"cpus: {}, pid: {}, mem toal: {}, mem free: {}, cpu: {:.2}, usr: {:.2}, sys: {:.2}, mem: {:.2}, process cpu: {:.2}, process mem: {:.2}",
p.cpu_count,
p.pid,
p.mem_total,
p.mem_free,
p.percent_cpu,
p.percent_cpu_user,
p.percent_cpu_system,
p.percent_mem,
p.percent_cpu_process,
p.percent_mem_process
);