Skip to content

Commit 6bdbf65

Browse files
committed
[process]: Introduce DiskReadBytes on process which shows Disk IO only.
1 parent 0e9c0ad commit 6bdbf65

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

process/process.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,18 @@ type RlimitStat struct {
103103
}
104104

105105
type IOCountersStat struct {
106-
ReadCount uint64 `json:"readCount"`
106+
// ReadCount is a number of read I/O operations such as syscalls.
107+
ReadCount uint64 `json:"readCount"`
108+
// WriteCount is a number of read I/O operations such as syscalls.
107109
WriteCount uint64 `json:"writeCount"`
108-
ReadBytes uint64 `json:"readBytes"`
110+
// ReadBytes is a number of all I/O read in bytes. This includes disk I/O on Linux and Windows.
111+
ReadBytes uint64 `json:"readBytes"`
112+
// WriteBytes is a number of all I/O write in bytes. This includes disk I/O on Linux and Windows.
109113
WriteBytes uint64 `json:"writeBytes"`
114+
// DiskReadBytes is a number of disk I/O write in bytes. Currently only Linux has this value.
115+
DiskReadBytes uint64 `json:"diskReadBytes"`
116+
// DiskWriteBytes is a number of disk I/O read in bytes. Currently only Linux has this value.
117+
DiskWriteBytes uint64 `json:"diskWriteBytes"`
110118
}
111119

112120
type NumCtxSwitchesStat struct {

process/process_linux.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,12 @@ func (p *Process) fillFromIOWithContext(ctx context.Context) (*IOCountersStat, e
727727
case "syscw":
728728
ret.WriteCount = t
729729
case "read_bytes":
730-
ret.ReadBytes = t
730+
ret.DiskReadBytes = t
731731
case "write_bytes":
732+
ret.DiskWriteBytes = t
733+
case "rchar":
734+
ret.ReadBytes = t
735+
case "wchar":
732736
ret.WriteBytes = t
733737
}
734738
}

0 commit comments

Comments
 (0)