Fix disk IO stats

This commit is contained in:
zp 2019-02-21 15:55:46 -06:00
parent 0ed7e58984
commit 7978b4ed5f

View File

@ -116,7 +116,7 @@ func (self *Disk) update() {
log.Printf("failed to get partition read/write info from gopsutil: %v. Part: %v", err, Part) log.Printf("failed to get partition read/write info from gopsutil: %v. Part: %v", err, Part)
continue continue
} }
data := ret[Part.Device] data := ret[strings.Replace(Part.Device, "/dev/", "", -1)]
curRead, curWrite := data.ReadBytes, data.WriteBytes curRead, curWrite := data.ReadBytes, data.WriteBytes
if Part.TotalRead != 0 { // if this isn't the first update if Part.TotalRead != 0 { // if this isn't the first update
readRecent := curRead - Part.TotalRead readRecent := curRead - Part.TotalRead