stats

package
v0.0.0-...-9815127 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoadAverages

func GetLoadAverages() (loadAverages *load.AvgStat, err error)

func GetMemoryUsage

func GetMemoryUsage() (memory *mem.VirtualMemoryStat, err error)

func GetSwapUsage

func GetSwapUsage() (swap *mem.SwapMemoryStat, err error)

Types

type DiskUsageData

type DiskUsageData struct {
	DeviceName        string  `json:"device"`
	MountPoint        string  `json:"mount_point"`
	FileSystemType    string  `json:"fs_type"`
	FileSystemOptions string  `json:"fs_options"`
	Total             uint64  `json:"total"`
	Free              uint64  `json:"free"`
	Used              uint64  `json:"used"`
	UsedPercent       float64 `json:"used_percent"`
	FreePercent       float64 `json:"free_percent"`
}

func GetDiskUsage

func GetDiskUsage() (disks []DiskUsageData, err error)

type HostInformation

type HostInformation struct {
	Information  *host.InfoStat         `json:"information"`
	Temperatures []host.TemperatureStat `json:"temperatures"`
	Users        []host.UserStat        `json:"users"`
}

func GetHostInformation

func GetHostInformation() (hostInformation HostInformation, err error)

type NetworkData

type NetworkData struct {
	TcpConnections   []net.ConnectionStat    `json:"tcp_connections,omitempty"`
	UdpConnections   []net.ConnectionStat    `json:"udp_connections,omitempty"`
	FilterCounters   []net.FilterStat        `json:"filter_counters,omitempty"`
	IoCounters       []net.IOCountersStat    `json:"io_counters,omitempty"`
	Interfaces       net.InterfaceStatList   `json:"interfaces,omitempty"`
	ProtocolCounters []net.ProtoCountersStat `json:"protocol_counters,omitempty"`
}

func GetNetworkData

func GetNetworkData(filterData, interfaceData, iostatData, protocolData bool) (networkData NetworkData, err error)

type PercentStat

type PercentStat struct {
	CPU       string  `json:"cpu"`
	User      float64 `json:"user"`
	System    float64 `json:"system"`
	Idle      float64 `json:"idle"`
	Nice      float64 `json:"nice"`
	Iowait    float64 `json:"iowait"`
	Irq       float64 `json:"irq"`
	Softirq   float64 `json:"softirq"`
	Steal     float64 `json:"steal"`
	Guest     float64 `json:"guest"`
	GuestNice float64 `json:"guestNice"`
}

func GetCpuPercent

func GetCpuPercent(perCpu bool) ([]PercentStat, error)

type Process

type Process struct {
	Command         string                      `json:"command"`
	CommandArgs     []string                    `json:"command_args"`
	ContextSwitches *process.NumCtxSwitchesStat `json:"context_switches"`
	CPUAffinity     []int32                     `json:"cpu_affinity"`
	CPUPercent      float64                     `json:"cpu"`
	CreationTime    int64                       `json:"creation_time"`
	CWD             string                      `json:"cwd"`
	Environment     []string                    `json:"environment"`
	GroupIDs        []int32                     `json:"groups_ids"`
	MemoryPercent   float32                     `json:"memory_percent"`
	Name            string                      `json:"name"`
	Nice            int32                       `json:"nice_level"`
	OpenFiles       int32                       `json:"open_file_count"`
	ParentPID       int32                       `json:"ppid"`
	PID             int32                       `json:"pid"`
	Terminal        string                      `json:"terminal"`
	ThreadCount     int32                       `json:"thread_count"`
	UserIDs         []int32                     `json:"user_ids"`
	Username        string                      `json:"username"`
}

func GetProcessList

func GetProcessList() (processes []Process, err error)

Jump to

Keyboard shortcuts

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