|
@ -53,7 +53,7 @@ fn collect_system_info_chirho() -> Result<SystemInfoChirho, Box<dyn Error>> { |
|
|
let hostname_chirho = hostname::get()?.into_string().unwrap();
|
|
|
let hostname_chirho = hostname::get()?.into_string().unwrap();
|
|
|
let os_chirho = std::env::consts::OS.to_string();
|
|
|
let os_chirho = std::env::consts::OS.to_string();
|
|
|
|
|
|
|
|
|
#[cfg(target_os = "linux")]
|
|
|
|
|
|
|
|
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
|
|
let (ram_mb_chirho, cpu_cores_chirho, storage_gb_chirho) = collect_linux_info_chirho()?;
|
|
|
let (ram_mb_chirho, cpu_cores_chirho, storage_gb_chirho) = collect_linux_info_chirho()?;
|
|
|
|
|
|
|
|
|
#[cfg(target_os = "windows")]
|
|
|
#[cfg(target_os = "windows")]
|
|
@ -74,7 +74,8 @@ fn collect_system_info_chirho() -> Result<SystemInfoChirho, Box<dyn Error>> { |
|
|
})
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[cfg(target_os = "linux")]
|
|
|
|
|
|
|
|
|
// target linux, freebsd or openbsd
|
|
|
|
|
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
|
|
|
fn collect_linux_info_chirho() -> Result<(u64, u64, u64), Box<dyn Error>> {
|
|
|
fn collect_linux_info_chirho() -> Result<(u64, u64, u64), Box<dyn Error>> {
|
|
|
use sys_info::{mem_info, cpu_num, disk_info};
|
|
|
use sys_info::{mem_info, cpu_num, disk_info};
|
|
|
|
|
|
|
|
|