meminfo: Fix the size mismatch in the swapTotal check mib for BSD. (#1345)

Signed-off-by: David O'Rourke <david.orourke@gmail.com>
pull/1346/head
David O'Rourke 6 years ago committed by Ben Kochie
parent f10c665d33
commit 814ef064c0

@ -7,7 +7,7 @@
* [CHANGE]
* [FEATURE]
* [ENHANCEMENT]
* [BUGFIX]
* [BUGFIX] Fix incorrect sysctl call in BSD meminfo collector, resulting in broken swap metrics on FreeBSD #1345
## 0.18.0 / 2019-05-09

@ -47,7 +47,7 @@ func NewMemoryCollector() (Collector, error) {
mibSwapTotal := "vm.swap_total"
/* swap_total is FreeBSD specific. Fall back to Dfly specific mib if not present. */
_, err = unix.SysctlUint32(mibSwapTotal)
_, err = unix.SysctlUint64(mibSwapTotal)
if err != nil {
mibSwapTotal = "vm.swap_size"
}

Loading…
Cancel
Save