Repository navigation
fix(cpu): correct Windows CPU usage on multi-group hosts - #1505
Merged
kongfei605 merged 2 commits intoOct 26, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The central multi-group Windows behavior still needs runtime validation on representative hardware before final human approval.
No open issues 🎉
What changed in this PR
This PR updates the CPU collector and its dependencies to correct Windows CPU usage accounting on hosts with multiple processor groups while preserving Linux behavior.
Changes:
- Upgrades gopsutil to v4.26.7 and related indirect dependencies.
- Excludes interrupt time from the Windows total because it is already included in system time.
- Adds synthetic accounting tests, Linux fixture coverage, and live Linux/Windows checks.
| File | Description |
|---|---|
inputs/cpu/cpu.go |
Prevents double-counting Windows interrupt time. |
inputs/cpu/cpu_windows_test.go |
Compares Windows metrics with legacy counters on single-group hosts. |
inputs/cpu/cpu_test.go |
Tests interrupt accounting and live CPU metrics. |
inputs/cpu/cpu_linux_test.go |
Verifies Linux accounting using controlled /proc/stat fixtures. |
go.sum |
Adds checksums for upgraded dependencies. |
go.mod |
Updates gopsutil and related indirect dependencies. |
Review effort: Balanced
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
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.
No description provided.