From 8f1899392606aa642c0ed708650860ee6a110bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20W=C3=BCnsche?= Date: Wed, 24 Jan 2024 12:12:48 +0100 Subject: [PATCH] benchmarks: update deps --- betree/haura-benchmarks/Cargo.toml | 16 ++++++------ .../haura-benchmarks/src/bin/sysinfo-log.rs | 9 ++++--- betree/haura-benchmarks/src/lib.rs | 25 ++++++++++--------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/betree/haura-benchmarks/Cargo.toml b/betree/haura-benchmarks/Cargo.toml index 0dec5a54..dd821acd 100644 --- a/betree/haura-benchmarks/Cargo.toml +++ b/betree/haura-benchmarks/Cargo.toml @@ -13,16 +13,14 @@ betree_storage_stack = { path = "..", features = ["experimental-api"]} structopt = "0.3" figment = { version = "0.10", features = [ "json" ] } serde_json = "1" -libmedium = "0.5" -procfs = "0.9" - -parking_lot = "0.11" - +libmedium = "0.7" +procfs = "0.16" rand = "0.8" rand_xoshiro = "0.6" - -zip = "0.5" crossbeam = "0.8" - -jemallocator = { version = "0.3", features = ["background_threads"] } +jemallocator = { version = "0.5", features = ["background_threads"] } log = "0.4" + +# Dependent on versions from haura +parking_lot = "0.11" +zip = "0.5" diff --git a/betree/haura-benchmarks/src/bin/sysinfo-log.rs b/betree/haura-benchmarks/src/bin/sysinfo-log.rs index 2d652098..ab909a74 100644 --- a/betree/haura-benchmarks/src/bin/sysinfo-log.rs +++ b/betree/haura-benchmarks/src/bin/sysinfo-log.rs @@ -8,7 +8,7 @@ use std::{ use libmedium::{ hwmon::Hwmons, - sensors::{Input, Sensor}, + sensors::{temp::TempSensor, Sensor}, }; use serde_json::{Map, Number, Value}; use structopt::StructOpt; @@ -27,7 +27,7 @@ fn gather() -> Map { if let Ok(hwmons) = Hwmons::parse() { let mut hwmons_map = Map::new(); - for (idx, name, hwmon) in hwmons.into_iter() { + for hwmon in hwmons.into_iter() { let mut hwmon_map = Map::new(); for (_name, tempsensor) in hwmon.temps() { if let Ok(temp) = tempsensor.read_input() { @@ -37,7 +37,10 @@ fn gather() -> Map { } } - hwmons_map.insert(format!("{}:{}", idx, name), Value::Object(hwmon_map)); + hwmons_map.insert( + format!("{}:{}", hwmon.index(), hwmon.name()), + Value::Object(hwmon_map), + ); } map.insert(String::from("hwmon"), Value::Object(hwmons_map)); diff --git a/betree/haura-benchmarks/src/lib.rs b/betree/haura-benchmarks/src/lib.rs index a9ec0fdc..4b8e9f24 100644 --- a/betree/haura-benchmarks/src/lib.rs +++ b/betree/haura-benchmarks/src/lib.rs @@ -96,24 +96,25 @@ pub fn log_process_info(path: impl AsRef, interval_ms: u64) -> io::Result< let mut output = BufWriter::new(file); let interval = Duration::from_millis(interval_ms); - let ticks = procfs::ticks_per_second().expect("Couldn't query tick frequency") as f64; - let page_size = procfs::page_size().expect("Couldn't query page size"); + let ticks = procfs::ticks_per_second() as f64; + let page_size = procfs::page_size(); loop { let now = Instant::now(); if let Ok(proc) = Process::myself() { + let stats = proc.stat().map_err(|e| io::Error::other(e))?; let info = serde_json::json!({ - "vsize": proc.stat.vsize, - "rss": proc.stat.rss * page_size, - "utime": proc.stat.utime as f64 / ticks, - "stime": proc.stat.stime as f64 / ticks, - "cutime": proc.stat.cutime as f64 / ticks, - "cstime": proc.stat.cstime as f64 / ticks, - "minflt": proc.stat.minflt, - "cminflt": proc.stat.cminflt, - "majflt": proc.stat.majflt, - "cmajflt": proc.stat.cmajflt + "vsize": stats.vsize, + "rss": stats.rss * page_size, + "utime": stats.utime as f64 / ticks, + "stime": stats.stime as f64 / ticks, + "cutime": stats.cutime as f64 / ticks, + "cstime": stats.cstime as f64 / ticks, + "minflt": stats.minflt, + "cminflt": stats.cminflt, + "majflt": stats.majflt, + "cmajflt": stats.cmajflt }); serde_json::to_writer(