Skip to content

Commit

Permalink
fix: 修复 linux distio loop 设备采集问题 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiandongx authored Dec 22, 2023
1 parent 33f8eef commit 61dc8e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions disk/disk_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,6 @@ func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOC
return ret, err
}
d := IOCountersStat{
Major: major,
Minor: minor,
ReadBytes: rbytes * sectorSize,
WriteBytes: wbytes * sectorSize,
ReadCount: reads,
Expand All @@ -489,7 +487,10 @@ func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOC
if d == empty {
continue
}

d.Name = name
d.Major = major
d.Minor = minor

// Names passed in can be full paths (/dev/sda) or just device names (sda).
// Since `name` here is already a basename, re-add the /dev path.
Expand Down

0 comments on commit 61dc8e0

Please sign in to comment.