Skip to content

fix: avoid duplicate disk IO aggregation#13333

Merged
wanghe-fit2cloud merged 1 commit into
dev-v2from
fix/disk-io-duplicate-aggregation
Jul 22, 2026
Merged

fix: avoid duplicate disk IO aggregation#13333
wanghe-fit2cloud merged 1 commit into
dev-v2from
fix/disk-io-duplicate-aggregation

Conversation

@ssongliu

Copy link
Copy Markdown
Member

Refs #13331

Copilot AI review requested due to automatic review settings July 22, 2026 07:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes incorrect “all disks” aggregation in monitoring by avoiding double-counting disk partition I/O that is already included in the parent block device’s counters.

Changes:

  • Replace naive “sum everything” disk I/O aggregation with a helper that excludes partition devices when computing the "all" total.
  • Reuse the same aggregation logic in both the monitor collector and dashboard “current info” endpoint.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
agent/app/service/monitor.go Replaces in-loop "all" accumulation with sumDiskIOCounters, and adds partition detection via sysfs.
agent/app/service/dashboard.go Uses sumDiskIOCounters for ioOption == "all" to avoid double-counting partitions in current I/O metrics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread agent/app/service/monitor.go Outdated
Comment on lines +700 to +706
func isBlockDevicePartition(name string) bool {
hostSys := os.Getenv("HOST_SYS")
if hostSys == "" {
hostSys = "/sys"
}
_, err := os.Stat(filepath.Join(hostSys, "class", "block", filepath.Base(name), "partition"))
return err == nil
Copilot AI review requested due to automatic review settings July 22, 2026 10:54
@ssongliu
ssongliu force-pushed the fix/disk-io-duplicate-aggregation branch from 7fba9ca to 90025f9 Compare July 22, 2026 10:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@wanghe-fit2cloud
wanghe-fit2cloud merged commit d330f60 into dev-v2 Jul 22, 2026
4 checks passed
@wanghe-fit2cloud
wanghe-fit2cloud deleted the fix/disk-io-duplicate-aggregation branch July 22, 2026 14:23
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.

3 participants