amdgpu temp

This commit is contained in:
Robin Appelman 2021-04-01 17:13:34 +02:00
commit 56ccc821fb
2 changed files with 14 additions and 10 deletions

View file

@ -102,12 +102,14 @@ pub fn get_metrics() -> Result<String> {
}
}
for (label, temp) in temperatures {
writeln!(
&mut result,
"temperature{{host=\"{}\", sensor=\"{}\"}} {:.1}",
hostname, label, temp
)
.ok();
if temp != 0.0 {
writeln!(
&mut result,
"temperature{{host=\"{}\", sensor=\"{}\"}} {:.1}",
hostname, label, temp
)
.ok();
}
}
Ok(result)
}