fix #863 Swap.UsedPercent is inconsistent
This commit is contained in:
parent
a81cf97fce
commit
144c67833a
|
@ -84,7 +84,7 @@ func SwapMemoryWithContext(ctx context.Context) (*SwapMemoryStat, error) {
|
|||
if tot == 0 {
|
||||
usedPercent = 0
|
||||
} else {
|
||||
usedPercent = float64(used) / float64(tot)
|
||||
usedPercent = float64(used) / float64(tot) * 100
|
||||
}
|
||||
ret := &SwapMemoryStat{
|
||||
Total: tot,
|
||||
|
|
Loading…
Reference in New Issue