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

Signed-off-by: David O'Rourke <david.orourke@gmail.com>
This commit is contained in:
David O'Rourke 2019-05-14 23:42:36 +01:00 committed by Ben Kochie
parent f10c665d33
commit 814ef064c0
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -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"
}