summaryrefslogtreecommitdiff
path: root/src/ci_runner.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2023-07-02 16:14:23 -0700
committeriximeow <me@iximeow.net>2023-07-02 16:14:23 -0700
commita876e5dfec331c1b6a921c9dd1b79d9d6917ebbd (patch)
treec75f66a4dd0c5a7d256705cb2278c9ac3ef82ac6 /src/ci_runner.rs
parent13828668b0fc83234b3252d4c1a7e7e7ee1ca51d (diff)
add host identifiers?
Diffstat (limited to 'src/ci_runner.rs')
-rw-r--r--src/ci_runner.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ci_runner.rs b/src/ci_runner.rs
index 11d8566..6356dcb 100644
--- a/src/ci_runner.rs
+++ b/src/ci_runner.rs
@@ -498,11 +498,14 @@ mod host_info {
fn collect_cpu_info() -> CpuInfo {
let cpu_lines: Vec<String> = std::fs::read_to_string("/proc/cpuinfo").unwrap().split("\n").map(|line| line.to_string()).collect();
let model_names: Vec<&String> = cpu_lines.iter().filter(|line| line.starts_with("model name")).collect();
- let model = model_names.first().expect("can get model name").to_string().split(":").last().unwrap().trim().to_string();
+ let model_name = model_names.first().expect("can get model name").to_string().split(":").last().unwrap().trim().to_string();
let cores = model_names.len() as u32;
+ let vendor_id = cpu_lines.iter().find(|line| line.starts_with("vendor_id")).expect("vendor_id line is present").split(":").last().unwrap().trim().to_string();
+ let family = cpu_lines.iter().find(|line| line.starts_with("vendor_id")).expect("vendor_id line is present").split(":").last().unwrap().trim().to_string();
+ let model = cpu_lines.iter().find(|line| line.starts_with("model\t")).expect("vendor_id line is present").split(":").last().unwrap().trim().to_string();
let microcode = cpu_lines.iter().find(|line| line.starts_with("microcode")).expect("microcode line is present").split(":").last().unwrap().trim().to_string();
- CpuInfo { model, microcode, cores }
+ CpuInfo { model_name, microcode, cores, vendor_id, family, model }
}
fn collect_mem_info() -> MemoryInfo {
@@ -536,10 +539,11 @@ mod host_info {
pub fn collect_host_info() -> HostInfo {
let cpu_info = collect_cpu_info();
let memory_info = collect_mem_info();
-// let hostname = hostname();
+ let hostname = hostname();
let env_info = collect_env_info();
HostInfo {
+ hostname,
cpu_info,
memory_info,
env_info,