Make the code testable and more maintainable:
- Encapsulate all the CGO code so it can be tested
- Fix the test file (it wasn't compiling) and improve tests
- Mock the data returned by unix.SysctlRaw so the code can be tested
without actually calling sysctl.
No change in behavior intended
Signed-off-by: Danilo Egea Gondolfo <danilo@FreeBSD.org>
* Add collector for netstats tcp packet counters for FreeBSD.
Signed-off-by: K Rin <rin@sandb0x.tw>
* Update collector/netstat_freebsd.go to keep the naming convention
Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: K Rin <sandb0x.tw0913@gmail.com>
---------
Signed-off-by: K Rin <rin@sandb0x.tw>
Signed-off-by: K Rin <sandb0x.tw0913@gmail.com>
Co-authored-by: Ben Kochie <superq@gmail.com>