summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2023-07-04 15:05:23 -0700
committeriximeow <me@iximeow.net>2023-07-04 15:05:23 -0700
commitc32adfb1956f89f7f778edce9e0367086080b058 (patch)
tree16c51faa2b32f5a716269cb590cac4bc6fb6f0d9 /src
parentca1ac8aec85e356377e554e6ad28142ff2e65c6e (diff)
parse cpu MHz from /proc/cpuinfo correctly
Diffstat (limited to 'src')
-rw-r--r--src/ci_runner.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ci_runner.rs b/src/ci_runner.rs
index 63dc74e..9aaf33d 100644
--- a/src/ci_runner.rs
+++ b/src/ci_runner.rs
@@ -556,7 +556,10 @@ mod host_info {
let cpu_mhzes: Vec<&String> = cpu_lines.iter().filter(|line| line.starts_with("cpu MHz")).collect();
match cpu_mhzes.get(cpu as usize) {
Some(mhz) => {
- let mhz: f64 = cpu_mhzes[cpu as usize].trim().parse().unwrap();
+ let mut line_parts = cpu_mhzes[cpu as usize].split(":");
+ let _ = line_parts.next();
+ let mhz = line_parts.next().unwrap().trim();
+ let mhz: f64 = mhz.parse().unwrap();
Ok((mhz * 1000.0) as u64)
},
None => {