Skip to content

Commit

Permalink
chore: troubleshooting host metrics on redhat8
Browse files Browse the repository at this point in the history
  • Loading branch information
bpetit committed Dec 13, 2023
1 parent 22dd155 commit 453bf5c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/sensors/powercap_rapl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,13 @@ impl RecordReader for Topology {
debug!("Suming socket metrics to get host metric");
for s in &self.sockets {
if let Ok(r) = s.read_record() {
if let Ok(val) = r.value.parse::<i32>() {
total += val;
} else {
trace!("could'nt convert {} to i32", r.value);
match r.value.trim().parse::<i32>() {
Ok(val) => {
total += val;
},
Err(e) => {
debug!("could'nt convert {} to i32: {}", r.value, e);
}
}
}
//for d in &s.domains {
Expand Down

0 comments on commit 453bf5c

Please sign in to comment.