From d0ff8ee2c0b894354771e807b73c62757d67de27 Mon Sep 17 00:00:00 2001 From: henrygd Date: Thu, 30 Oct 2025 14:17:56 -0400 Subject: [PATCH] fix disk i/o values in longer charts (#1355) --- internal/records/records.go | 6 ++++++ internal/site/src/components/routes/system.tsx | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/records/records.go b/internal/records/records.go index 53171bf4..5da41c4e 100644 --- a/internal/records/records.go +++ b/internal/records/records.go @@ -269,6 +269,10 @@ func (rm *RecordManager) AverageSystemStats(db dbx.Builder, records RecordIds) * fs.DiskReadPs += value.DiskReadPs fs.MaxDiskReadPS = max(fs.MaxDiskReadPS, value.MaxDiskReadPS, value.DiskReadPs) fs.MaxDiskWritePS = max(fs.MaxDiskWritePS, value.MaxDiskWritePS, value.DiskWritePs) + fs.DiskReadBytes += value.DiskReadBytes + fs.DiskWriteBytes += value.DiskWriteBytes + fs.MaxDiskReadBytes = max(fs.MaxDiskReadBytes, value.MaxDiskReadBytes, value.DiskReadBytes) + fs.MaxDiskWriteBytes = max(fs.MaxDiskWriteBytes, value.MaxDiskWriteBytes, value.DiskWriteBytes) } } @@ -356,6 +360,8 @@ func (rm *RecordManager) AverageSystemStats(db dbx.Builder, records RecordIds) * fs.DiskUsed = twoDecimals(fs.DiskUsed / count) fs.DiskWritePs = twoDecimals(fs.DiskWritePs / count) fs.DiskReadPs = twoDecimals(fs.DiskReadPs / count) + fs.DiskReadBytes = fs.DiskReadBytes / uint64(count) + fs.DiskWriteBytes = fs.DiskWriteBytes / uint64(count) } } diff --git a/internal/site/src/components/routes/system.tsx b/internal/site/src/components/routes/system.tsx index 9dc23ae9..19e6a541 100644 --- a/internal/site/src/components/routes/system.tsx +++ b/internal/site/src/components/routes/system.tsx @@ -958,9 +958,9 @@ export default memo(function SystemDetail({ id }: { id: string }) { label: t`Write`, dataKey: ({ stats }) => { if (showMax) { - return stats?.efs?.[extraFsName]?.wb ?? (stats?.efs?.[extraFsName]?.wm ?? 0) * 1024 * 1024 + return stats?.efs?.[extraFsName]?.wbm || (stats?.efs?.[extraFsName]?.wm ?? 0) * 1024 * 1024 } - return stats?.efs?.[extraFsName]?.wb ?? (stats?.efs?.[extraFsName]?.w ?? 0) * 1024 * 1024 + return stats?.efs?.[extraFsName]?.wb || (stats?.efs?.[extraFsName]?.w ?? 0) * 1024 * 1024 }, color: 3, opacity: 0.3,