collector

package
v0.0.0-...-6159ff7 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
)

Variables

This section is empty.

Functions

func TrafficGetInfo

func TrafficGetInfo() ([]NetworkProtocol, []TrafficInfo, []TCPStates, []ListeningSocket)

Types

type CPUUsage

type CPUUsage struct {
	UserMode   float64
	SystemMode float64
	Idle       float64
}

func CpuStat

func CpuStat() (CPUUsage, error)

type Collector

type Collector struct {
	LoadAverage     LoadAverage
	CPUUsage        CPUUsage
	DiskUsage       []DiskUsage
	FileSystemUsage []FileSystemUsage
	NetworkProtocol []NetworkProtocol
	TrafficInfo     []TrafficInfo
	TCPStates       []TCPStates
	ListeningSocket []ListeningSocket
}

func Collect

func Collect() *Collector

type DiskParams

type DiskParams struct {
	// contains filtered or unexported fields
}

type DiskUsage

type DiskUsage struct {
	Name     string
	TPS      float64
	KBPerSec float64
}

func DiskStat

func DiskStat() ([]DiskUsage, error)

type FileSystemUsage

type FileSystemUsage struct {
	FileSystem   string
	UsedMB       float64
	UsedPercent  float64
	UsedInode    float64
	InodePercent float64
}

func FsStat

func FsStat() []FileSystemUsage

type ListeningSocket

type ListeningSocket struct {
	Command  string
	PID      int
	User     string
	Protocol string
	Port     int
}

type LoadAverage

type LoadAverage struct {
	OneMinute      float64
	FiveMinutes    float64
	FifteenMinutes float64
}

func LoadAvg

func LoadAvg() (LoadAverage, error)

type NetworkProtocol

type NetworkProtocol struct {
	Protocol string
	Bytes    int64
	Percent  float64
}

type TCPStates

type TCPStates struct {
	State string
	Count int
}

type TrafficInfo

type TrafficInfo struct {
	SourceIP   string
	SourcePort int
	DestIP     string
	DestPort   int
	Protocol   string
	Bytes      int
	State      string
	BPS        float64
}

Jump to

Keyboard shortcuts

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