network

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Enabled    bool     `config:"enabled"`
	Summary    bool     `config:"summary"`
	Sockets    bool     `config:"sockets"`
	Throughput bool     `config:"throughput"`
	Detail     bool     `config:"details"`
	Interfaces []string `config:"interfaces"`
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config) (*Metric, error)

func (*Metric) Collect

func (m *Metric) Collect() error

type SockStat

type SockStat struct {
	//The count of all sockets in use on the system, in the most liberal definition. See `ss -s` and `ss -a` for more.
	SocketsUsed int
	//Total in use TCP sockets
	TCPInUse int
	//Total 'orphaned' TCP sockets
	TCPOrphan int
	//Sockets in TIME_WAIT
	TCPTW int
	//Total allocated sockets
	TCPAlloc int
	//Socket memory use, in pages
	TCPMem int
	//In use UDP sockets
	UDPInUse int
	//Socket memory use, in pages
	UDPMem int
	//UDP-Lite in use sockets
	UDPLiteInUse int
	//In Use raw sockets
	RawInUse int
	//FRAG sockets in use
	FragInUse int
	//Frag memory, in bytes
	FragMemory int
}

SockStat contains data from /proc/net/sockstat

type SocketStats

type SocketStats struct {
	TcpConns       uint `json:"connections,omitempty"`
	TcpListening   uint `json:"listening,omitempty"`
	TcpClosewait   uint `json:"close_wait,omitempty"`
	TcpEstablished uint `json:"established,omitempty"`
	TcpTimewait    uint `json:"time_wait,omitempty"`
	TcpSynsent     uint `json:"sync_sent,omitempty"`
	TcpSynrecv     uint `json:"sync_recv,omitempty"`
	TcpFinwait1    uint `json:"fin_wait1,omitempty"`
	TcpFinwait2    uint `json:"fin_wait2,omitempty"`
	TcpLastack     uint `json:"last_ack,omitempty"`
	TcpClosing     uint `json:"closing,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL