Skip to content

fix(cpu): correct Windows CPU usage on multi-group hosts - #1505

Merged
kongfei605 merged 2 commits into
flashcatcloud:mainfrom
kongfei605:chore/gopsutil-upgrade
Oct 26, 2026
Merged

kongfei605 merged 2 commits into
flashcatcloud:mainfrom
kongfei605:chore/gopsutil-upgrade

Conversation

@kongfei605

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI balanced review requested due to automatic review settings October 26, 2026 05:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

Copilot AI balanced review requested due to automatic review settings October 26, 2026 05:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The dependency-driven behavior still needs validation on a Windows host with multiple processor groups before human approval.

No open issues 🎉

Review effort: Balanced

@kongfei605
kongfei605 merged commit 8152dfc into flashcatcloud:main Oct 26, 2026
3 checks passed
@kongfei605
kongfei605 deleted the chore/gopsutil-upgrade branch October 26, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants