diff --git a/src/sensors/powercap_rapl.rs b/src/sensors/powercap_rapl.rs index ced3ef9a..12f7dcfe 100644 --- a/src/sensors/powercap_rapl.rs +++ b/src/sensors/powercap_rapl.rs @@ -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::() { - total += val; - } else { - trace!("could'nt convert {} to i32", r.value); + match r.value.trim().parse::() { + Ok(val) => { + total += val; + }, + Err(e) => { + debug!("could'nt convert {} to i32: {}", r.value, e); + } } } //for d in &s.domains {