mirror of
https://github.com/cjbassi/gotop.git
synced 2025-05-03 22:17:15 +08:00
Add more logging for Disk widget
This commit is contained in:
parent
a3c934e86b
commit
cfcb489862
@ -96,7 +96,7 @@ func (self *Disk) update() {
|
|||||||
for _, Part := range self.Partitions {
|
for _, Part := range self.Partitions {
|
||||||
usage, err := psDisk.Usage(Part.Mount)
|
usage, err := psDisk.Usage(Part.Mount)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("failed to get partition usage statistics from gopsutil: %v. Part.Mount: %v", err, Part.Mount)
|
log.Printf("failed to get partition usage statistics from gopsutil: %v. Part: %v", err, Part)
|
||||||
}
|
}
|
||||||
Part.UsedPercent = int(usage.UsedPercent)
|
Part.UsedPercent = int(usage.UsedPercent)
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ func (self *Disk) update() {
|
|||||||
|
|
||||||
ret, err := psDisk.IOCounters("/dev/" + Part.Device)
|
ret, err := psDisk.IOCounters("/dev/" + Part.Device)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("failed to get partition read/write info from gopsutil: %v. Part.Device: %v", err, Part.Device)
|
log.Printf("failed to get partition read/write info from gopsutil: %v. Part: %v", err, Part)
|
||||||
}
|
}
|
||||||
data := ret[Part.Device]
|
data := ret[Part.Device]
|
||||||
curRead, curWrite := data.ReadBytes, data.WriteBytes
|
curRead, curWrite := data.ReadBytes, data.WriteBytes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user