-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Adjust hardware collection (windows.plugin) #21433
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
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.
2 issues found across 4 files
Prompt for AI agents (all 2 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="src/collectors/windows.plugin/GetPowerSupply.c">
<violation number="1" location="src/collectors/windows.plugin/GetPowerSupply.c:43">
P1: Capacity calculation has inverted operands. This computes `FullChargedCapacity / Capacity` instead of `Capacity / FullChargedCapacity`, producing incorrect percentages (e.g., 50% battery shows as 200%).</violation>
</file>
<file name="src/collectors/windows.plugin/GetSensors.c">
<violation number="1" location="src/collectors/windows.plugin/GetSensors.c:577">
P2: Return value of `netdata_clsid_to_char` is not checked. If conversion fails, an empty string will be used as the dictionary key, potentially causing multiple sensors to collide on the same key.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
stelfrag
approved these changes
Dec 11, 2025
Merged
stelfrag
pushed a commit
to stelfrag/netdata
that referenced
this pull request
Dec 11, 2025
(cherry picked from commit 9b023c3)
Ferroin
pushed a commit
that referenced
this pull request
Dec 15, 2025
(cherry picked from commit 9b023c3)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is the first PR addressing potential issues with the Windows plugin on some operating systems.
Test Plan
Additional Information
For users: How does this change affect me?
Summary by cubic
Stabilizes Windows hardware collection by fixing CPU temp chart setup, safer sensor GUID handling, battery enumeration/capacity reporting, and service status error handling. Improves stability, prevents memory issues, and corrects a user-facing label.
Written for commit 3af3a6a. Summary will update automatically on new commits.