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 {
|
if tot == 0 {
|
||||||
usedPercent = 0
|
usedPercent = 0
|
||||||
} else {
|
} else {
|
||||||
usedPercent = float64(used) / float64(tot)
|
usedPercent = float64(used) / float64(tot) * 100
|
||||||
}
|
}
|
||||||
ret := &SwapMemoryStat{
|
ret := &SwapMemoryStat{
|
||||||
Total: tot,
|
Total: tot,
|
||||||
|
|
Loading…
Reference in New Issue