netstat

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package netstat implements metrics collection related to TCP and UDP

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendedMetrics

type ExtendedMetrics struct {
	SyncookiesSent   *metrics.Counter
	SyncookiesRecv   *metrics.Counter
	SyncookiesFailed *metrics.Counter
	ListenOverflows  *metrics.Counter
	ListenDrops      *metrics.Counter
}

ExtendedMetrics represents extended statistics about various tcp indicators and is automatically initialized. Caution: reflection is used to read this struct to discover names

type NetStat

type NetStat struct {
	TCPStat         TCPStat
	UDPStat         UDPStat
	ExtendedMetrics ExtendedMetrics
	// contains filtered or unexported fields
}

NetStat is a holder for TCP and UDP statistics.

func New

func New(m *metrics.MetricContext, Step time.Duration) *NetStat

New starts metrics collection every Step and registers with metricscontext

func (*NetStat) Collect

func (s *NetStat) Collect()

Collect populates NetStat by reading /proc/net/snmp and /proc/net/netstat

type TCPStat

type TCPStat struct {
	MaxConn      *metrics.Gauge
	ActiveOpens  *metrics.Counter
	PassiveOpens *metrics.Counter
	AttemptFails *metrics.Counter
	EstabResets  *metrics.Counter
	CurrEstab    *metrics.Gauge
	InSegs       *metrics.Counter
	OutSegs      *metrics.Counter
	RetransSegs  *metrics.Counter
	InErrs       *metrics.Counter
	OutRsts      *metrics.Counter
}

TCPStat represents statistics about various tcp indicators and is automatically initialized. Caution: reflection is used to read this struct to discover names

type UDPStat

type UDPStat struct {
	InDatagrams  *metrics.Counter
	NoPorts      *metrics.Counter
	InErrors     *metrics.Counter
	OutDatagrams *metrics.Counter
	RcvbufErrors *metrics.Counter
	SndbufErrors *metrics.Counter
}

UDPStat represents statistics about UDP. Reflection is used to map field names to kernel data.

Jump to

Keyboard shortcuts

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