Commit graph

3 commits

Author SHA1 Message Date
Danilo Egea Gondolfo 5068195d94 netstat_freebsd: add support for some IPv4 metrics
Metrics added:
- ip4_transmit_packets_total
- ip4_transmit_raw_packets_total
- ip4_receive_packets_total
- ip4_receive_fragments_total
- ip4_forward_total
- ip4_fast_forward_total
- ip4_delivered_total

Signed-off-by: Danilo Egea Gondolfo <danilo@FreeBSD.org>
2025-05-16 11:53:16 +01:00
Danilo Egea Gondolfo f0dbecf061 netstat_freebsd: refactoring
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>
2025-05-16 11:53:16 +01:00
K Rin 43dfdcea5c
Add collector for netstats tcp packet counters for FreeBSD. (#3177)
* 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>
2025-02-02 11:32:08 +01:00