network

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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