Skip to content

fix(monitoring): stop double-counting partition I/O in disk stats - #5399

Closed
breken-ai wants to merge 1 commit into
Dokploy:canaryfrom
breken-ai:fix-5385-disk-stats-double-count
Closed

breken-ai wants to merge 1 commit into
Dokploy:canaryfrom
breken-ai:fix-5385-disk-stats-double-count

Conversation

@breken-ai

@breken-ai breken-ai commented Sep 9, 2026 •

Copy link
Copy Markdown

Fixes #5385.

Confirmed - /proc/diskstats reports partition I/O in both the partition row and the parent disk row, and getHostSystemStats was summing both, so Block I/O reads ~2x real. This adds a shouldIncludeDiskStat filter: virtual devices stay excluded, and a partition row is skipped when its parent disk is present (handles sdX1/vdX1 and nvme0n1p1/mmcblk0p1 naming without dropping whole disks like nvme0n1 that end in a digit). Tests cover sd/nvme/mmc naming, virtual devices, and the no-parent edge case.

Verification: new vitest suite red against unpatched utils (5/5 fail), 5/5 green with the fix.

Built by breken, your AI support engineer - breken.ai - this one's on us.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with no actionable correctness, security, or test-integration issues identified.

Summary

  • Adds partition-parent detection for conventional, NVMe, MMC, and MD naming forms.
  • Preserves whole disks whose names end in digits and partition-like rows whose parent is absent.
  • Adds focused regression coverage for filtering behavior.

/proc/diskstats reports partition I/O in both the partition row and the
parent disk row, and getHostSystemStats summed both, so Block I/O read
~2x real. Add a shouldIncludeDiskStat filter: virtual devices stay
excluded, and a partition row is skipped when its parent disk is
present (handles sdX1/vdX1 and nvme0n1p1/mmcblk0p1 naming without
dropping whole disks like nvme0n1 that end in a digit).

Fixes Dokploy#5385
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.

Disk stats in Monitoring counts each byte twice

3 participants