Skip to content

Commit

Permalink
chore: deprecate NewTCPx methods
Browse files Browse the repository at this point in the history
Deprecate TCP APIs in favor of `github.com/mdlayher/netlink`.

Refer:
prometheus#622 (review).

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
  • Loading branch information
rexagod committed May 14, 2024
1 parent c5ada8d commit cc9a45b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net_tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,32 @@ type (

// NetTCP returns the IPv4 kernel/networking statistics for TCP datagrams
// read from /proc/net/tcp.
// Deprecated: Use github.com/mdlayher/netlink#Conn with syscall.AF_INET instead.
// Refer: https://github.com/prometheus/node_exporter/pull/2322 for usage details.
func (fs FS) NetTCP() (NetTCP, error) {
return newNetTCP(fs.proc.Path("net/tcp"))
}

// NetTCP6 returns the IPv6 kernel/networking statistics for TCP datagrams
// read from /proc/net/tcp6.
// Deprecated: Use github.com/mdlayher/netlink#Conn with syscall.AF_INET6 instead.
// Refer: https://github.com/prometheus/node_exporter/pull/2322 for usage details.
func (fs FS) NetTCP6() (NetTCP, error) {
return newNetTCP(fs.proc.Path("net/tcp6"))
}

// NetTCPSummary returns already computed statistics like the total queue lengths
// for TCP datagrams read from /proc/net/tcp.
// Deprecated: Use github.com/mdlayher/netlink#Conn with syscall.AF_INET instead.
// Refer: https://github.com/prometheus/node_exporter/pull/2322 for usage details.
func (fs FS) NetTCPSummary() (*NetTCPSummary, error) {
return newNetTCPSummary(fs.proc.Path("net/tcp"))
}

// NetTCP6Summary returns already computed statistics like the total queue lengths
// for TCP datagrams read from /proc/net/tcp6.
// Deprecated: Use github.com/mdlayher/netlink#Conn with syscall.AF_INET6 instead.
// Refer: https://github.com/prometheus/node_exporter/pull/2322 for usage details.
func (fs FS) NetTCP6Summary() (*NetTCPSummary, error) {
return newNetTCPSummary(fs.proc.Path("net/tcp6"))
}
Expand Down

0 comments on commit cc9a45b

Please sign in to comment.