[process]: Introduce DiskReadBytes on process which shows Disk IO only.

pull/1628/head
shirou 10 months ago
parent 0e9c0ade3c
commit 6bdbf65126

@ -103,10 +103,18 @@ type RlimitStat struct {
}
type IOCountersStat struct {
ReadCount uint64 `json:"readCount"`
// ReadCount is a number of read I/O operations such as syscalls.
ReadCount uint64 `json:"readCount"`
// WriteCount is a number of read I/O operations such as syscalls.
WriteCount uint64 `json:"writeCount"`
ReadBytes uint64 `json:"readBytes"`
// ReadBytes is a number of all I/O read in bytes. This includes disk I/O on Linux and Windows.
ReadBytes uint64 `json:"readBytes"`
// WriteBytes is a number of all I/O write in bytes. This includes disk I/O on Linux and Windows.
WriteBytes uint64 `json:"writeBytes"`
// DiskReadBytes is a number of disk I/O write in bytes. Currently only Linux has this value.
DiskReadBytes uint64 `json:"diskReadBytes"`
// DiskWriteBytes is a number of disk I/O read in bytes. Currently only Linux has this value.
DiskWriteBytes uint64 `json:"diskWriteBytes"`
}
type NumCtxSwitchesStat struct {

@ -727,8 +727,12 @@ func (p *Process) fillFromIOWithContext(ctx context.Context) (*IOCountersStat, e
case "syscw":
ret.WriteCount = t
case "read_bytes":
ret.ReadBytes = t
ret.DiskReadBytes = t
case "write_bytes":
ret.DiskWriteBytes = t
case "rchar":
ret.ReadBytes = t
case "wchar":
ret.WriteBytes = t
}
}

Loading…
Cancel
Save