-
Notifications
You must be signed in to change notification settings - Fork 320
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
Bug Fix: SystemCPUfreq fails when any core is offline #497
Bug Fix: SystemCPUfreq fails when any core is offline #497
Conversation
I have read the readme and steps for contribution and have tried my best to follow it. This my first open source contribution so please guide me if I have missed something. |
Tests are failing because each directory under .../cpu[0-9] has a file named online in Linux except for cpu0. This contains int spicifying if the core is online or not. Please help me in configuring that file using fixtures. Please review @pgier |
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.
This looks good to me in general. I'm just wondering if there is a way to just check /sys/devices/system/cpu/offline
which should be empty most of the time (no CPUs offline)?
Also to fix the tests, looks like you'll have to add the relevant online
files to the test data.
system_cpu_test.go:103: stat testdata/fixtures/sys/devices/system/cpu/cpu1/online: no such file or directory
You also need to sign off your commit, see the failing DCO check above |
99d5b49
to
00bca37
Compare
Signed off my commit. |
Here is the lint error:
You probably didn't run |
I'm exploring the idea of checking for offline cpu's in Sharing the approach here: |
00bca37
to
34b5f83
Compare
@pgier, I have updated the code according to the approach mentioned earlier. |
Signed-off-by: taherk <[email protected]>
34b5f83
to
c66afb8
Compare
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.
Thanks!
@taherkk I think it is causing #530. Can u please confirm |
SystemCpufreq function does not check if a core is online before collecting metrics. In the case when a core is offline it fails and does not collect a couple of metrics.
Refer prometheus/node_exporter#2577 for more details