Merge pull request #255 from lberruti/fix_swap_mem_linux

Fix: wrong swap values on i686 / 4GB ram.
pull/256/head
shirou 9 years ago committed by GitHub
commit f20771d32a

@ -70,8 +70,8 @@ func SwapMemory() (*SwapMemoryStat, error) {
return nil, err return nil, err
} }
ret := &SwapMemoryStat{ ret := &SwapMemoryStat{
Total: uint64(sysinfo.Totalswap), Total: uint64(sysinfo.Totalswap) * uint64(sysinfo.Unit),
Free: uint64(sysinfo.Freeswap), Free: uint64(sysinfo.Freeswap) * uint64(sysinfo.Unit),
} }
ret.Used = ret.Total - ret.Free ret.Used = ret.Total - ret.Free
//check Infinity //check Infinity

Loading…
Cancel
Save