fix #863 Swap.UsedPercent is inconsistent

This commit is contained in:
GameXG 2020-05-03 23:27:10 +08:00 committed by GitHub
parent a81cf97fce
commit 144c67833a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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,