Crates.io | mprober-lib |
lib.rs | mprober-lib |
version | 0.1.15 |
source | src |
created_at | 2020-06-01 20:09:50.274831 |
updated_at | 2023-11-14 02:26:38.386978 |
description | A library aims to quickly collect Linux system information including hostname, kernel version, uptime, RTC time, load average, CPU, memory, network interfaces, block devices and processes. |
homepage | https://magiclen.org/m-prober-lib |
repository | https://github.com/magiclen/m-prober-lib |
max_upload_size | |
id | 248801 |
size | 69,722 |
This crate aims to quickly collect Linux system information including hostname, kernel version, uptime, RTC time, load average, CPU, memory, network interfaces, block devices and processes.
use mprober_lib::*;
println!("{}", hostname::get_hostname().unwrap());
println!("{}", kernel::get_kernel_version().unwrap());
println!("{}", btime::get_btime());
println!("{}", rtc_time::get_rtc_date_time().unwrap());
println!("{:#?}", uptime::get_uptime().unwrap());
println!("{:#?}", load_average::get_load_average().unwrap());
println!("{:#?}", cpu::get_cpus().unwrap());
println!("{:#?}", memory::free().unwrap());
println!("{:#?}", volume::get_volumes().unwrap());
println!("{:#?}", network::get_networks().unwrap());
println!("{:#?}", process::get_processes_with_stat(&process::ProcessFilter::default()).unwrap().into_iter().map(|(process, _)| process).collect::<Vec<process::Process>>());
cargo bench
https://crates.io/crates/mprober