-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for #945, cpu temperature is signed. #965
Conversation
Added a type conversion to cpu temperature sysctl. Will still collect/report -1 when the value is -1, this is because it should be up to interpretation whether this is the correct value for the system or not. Some drivers will report -1 for cpu temperature. Other sensors will report "an input into the fan control algorithm", i.e. not the actual temperature, but how much fan it wants. Some people cool their machines with liquid nitrogen. Signed-off-by: Derek Marcotte <554b8425@razorfever.net>
64f1969
to
18b68a5
Compare
LGTM but maybe extend the comment a bit to explain what exactly is going on there? |
Let's re-arrange this a little so it's easier to understand.
|
bd9cd0e
to
5778fd7
Compare
Signed-off-by: Derek Marcotte <554b8425@razorfever.net>
5778fd7
to
38cd211
Compare
Signed-off-by: Derek Marcotte <554b8425@razorfever.net>
38cd211
to
c9c5bb0
Compare
Codespell ftw!
But LGTM beside that one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
collector/cpu_freebsd.go
Outdated
ch <- c.temp.mustNewConstMetric(float64(temp-2732)/10, lcpu) | ||
|
||
// Temp is a signed integer in deci-degrees Kelvin. | ||
// Cast uint32 to int32 and convert to float64 degrees Celcius. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codespell error :-)
./collector/cpu_freebsd.go:143: Celcius ==> Celsius
Signed-off-by: Derek Marcotte <554b8425@razorfever.net>
* Fix for prometheus#945, cpu temperature is signed. Added a type conversion to cpu temperature sysctl. Will still collect/report -1 when the value is -1, this is because it should be up to interpretation whether this is the correct value for the system or not. Some drivers will report -1 for cpu temperature. Other sensors will report "an input into the fan control algorithm", i.e. not the actual temperature, but how much fan it wants. Some people cool their machines with liquid nitrogen. Signed-off-by: Derek Marcotte <554b8425@razorfever.net>
Added a type conversion to cpu temperature sysctl. Will still collect/report -1 when the value is -1, this is because it should be up to interpretation whether this is the correct value for the system or not.
Some drivers will report -1 for cpu temperature. Other sensors will report "an input into the fan control algorithm", i.e. not the actual temperature, but how much fan it wants. Some people cool their machines
with liquid nitrogen.
Closes: #945