Merge pull request #864 from GameXG/master

fix #863 Swap.UsedPercent is inconsistent
pull/869/head
Lomanic 5 years ago committed by GitHub
commit 987c949880
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save