Merge pull request #116 from zp/fix-disk-io

Fix disk IO stats
This commit is contained in:
Caleb Bassi 2019-02-21 20:56:52 -08:00 committed by GitHub
commit e5f9b179e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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)
continue
}
data := ret[Part.Device]
data := ret[strings.Replace(Part.Device, "/dev/", "", -1)]
curRead, curWrite := data.ReadBytes, data.WriteBytes
if Part.TotalRead != 0 { // if this isn't the first update
readRecent := curRead - Part.TotalRead