core

package
v0.0.0-...-8753844 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeCoreLoad

func ComputeCoreLoad(currentStat, previousStat *CoreInfo) float32

Types

type CPU

type CPU struct {
	Freq int // CPU total average frequency

	// CPU Load on each core
	CPU  float32 // total % Load
	CPU0 float32
	CPU1 float32
	CPU2 float32
	CPU3 float32
	// contains filtered or unexported fields
}

func (*CPU) Frequency

func (cpu *CPU) Frequency()

func (*CPU) Load

func (cpu *CPU) Load()

type CPUInfo

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

func ExtractCPUInfo

func ExtractCPUInfo() *CPUInfo

type CoreInfo

type CoreInfo struct {
	CoreId    string
	User      uint64
	Nice      uint64
	System    uint64
	Idle      uint64
	IOWait    uint64
	IRQ       uint64
	SoftIRQ   uint64
	Steal     uint64
	Guest     uint64
	GuestNice uint64
}

type Disk

type Disk struct {
	MountingPoints []MountingPoint
}

func (*Disk) ExtractDiskUsage

func (disk *Disk) ExtractDiskUsage()

type Memory

type Memory struct {
	MemTotal  uint64
	MemFree   uint64
	MemUsage  float32
	SwapTotal uint64
	SwapFree  uint64
	SwapUsage float32

	Buffers uint64
	Cached  uint64
	// contains filtered or unexported fields
}

func (*Memory) Usage

func (memoryInfo *Memory) Usage()

type MountingPoint

type MountingPoint struct {
	FileSystem string
	Size       string
	Used       string
	Avail      string
	PercentUse string
}

type NetworkStatus

type NetworkStatus struct {
	BytesRecv      uint64
	BytesSent      uint64
	TotalBytesRecv uint64
	TotalBytesSent uint64
}

func GetNetworkStatus

func GetNetworkStatus() *NetworkStatus

func (*NetworkStatus) ComputeNetworkStatus

func (networkStatus *NetworkStatus) ComputeNetworkStatus()

type Status

type Status struct {
	CPU         *CPU
	Memory      *Memory
	Temperature *Temperature
	Disk        *Disk
	Network     *NetworkStatus
	// contains filtered or unexported fields
}

func (*Status) Worker

func (status *Status) Worker()

type Temperature

type Temperature struct {
	T float32
}

func (*Temperature) ExtractTemp

func (temperature *Temperature) ExtractTemp()

Jump to

Keyboard shortcuts

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