提交 acf3fef0 编写于 作者: M Marc Magnin

added weightedIO field to disk IOCountersStat (last field of /etc/mtab)

上级 53322384
......@@ -43,6 +43,7 @@ type IOCountersStat struct {
WriteTime uint64 `json:"writeTime"`
IopsInProgress uint64 `json:"iopsInProgress"`
IoTime uint64 `json:"ioTime"`
WeightedIO uint64 `json:"weightedIO"`
Name string `json:"name"`
SerialNumber string `json:"serialNumber"`
}
......
......@@ -328,6 +328,10 @@ func IOCounters() (map[string]IOCountersStat, error) {
if err != nil {
return ret, err
}
weightedIO, err := strconv.ParseUint((fields[13]), 10, 64)
if err != nil {
return ret, err
}
d := IOCountersStat{
ReadBytes: rbytes * SectorSize,
WriteBytes: wbytes * SectorSize,
......@@ -339,6 +343,7 @@ func IOCounters() (map[string]IOCountersStat, error) {
WriteTime: wtime,
IopsInProgress: iopsInProgress,
IoTime: iotime,
WeightedIO: weightedIO,
}
if d == empty {
continue
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册