monitor

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CpuMonitor

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

func NewCpuMonitor

func NewCpuMonitor() (cm CpuMonitor)

func (*CpuMonitor) ComputeCpuStatus

func (m *CpuMonitor) ComputeCpuStatus() (status CpuStatus)

type CpuSnapshot

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

type CpuStatus

type CpuStatus struct {
	LoadPercent float64 `json:"load_percent"`
}

type DiskMonitor

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

func NewDiskMonitor

func NewDiskMonitor(cache []string, array []string) (dm DiskMonitor)

func (*DiskMonitor) ComputeDiskUsage

func (monitor *DiskMonitor) ComputeDiskUsage() ([]DiskStatus, []DiskStatus)

type DiskStatus

type DiskStatus struct {
	Path        string  `json:"mount"`
	Total       uint64  `json:"total"`
	Used        uint64  `json:"used"`
	Free        uint64  `json:"free"`
	UsedPercent float64 `json:"used_percent"`
	FreePercent float64 `json:"free_percent"`
}

func AggregateDiskStatuses

func AggregateDiskStatuses(disks []DiskStatus) (status DiskStatus)

type MemoryMonitor added in v0.2.2

type MemoryMonitor struct{}

func NewMemoryMonitor added in v0.2.2

func NewMemoryMonitor() (mm MemoryMonitor)

func (*MemoryMonitor) ComputeMemoryUsage added in v0.2.2

func (monitor *MemoryMonitor) ComputeMemoryUsage() (status MemoryStatus)

type MemoryStatus added in v0.2.2

type MemoryStatus struct {
	Total       uint64  `json:"total"`
	Used        uint64  `json:"used"`
	Free        uint64  `json:"free"`
	UsedPercent float64 `json:"used_percent"`
	FreePercent float64 `json:"free_percent"`
}

type NetworkMonitor

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

func NewNetworkMonitor

func NewNetworkMonitor(inames []string) (monitor NetworkMonitor)

func (*NetworkMonitor) ComputeNetworkRate

func (monitor *NetworkMonitor) ComputeNetworkRate() []NetworkRate

type NetworkRate

type NetworkRate struct {
	Iname  string  `json:"interface"`
	RxMiBs float64 `json:"rx_MiBs"`
	TxMiBs float64 `json:"tx_MiBs"`
	RxMbps float64 `json:"rx_Mbps"`
	TxMbps float64 `json:"tx_Mbps"`
}

func AggregateNetworkRates

func AggregateNetworkRates(networks []NetworkRate) (status NetworkRate)

type NetworkSnapshot

type NetworkSnapshot struct {
	Iname string
	Rx    uint64
	Tx    uint64
	RxTs  time.Time
	TxTs  time.Time
}

Jump to

Keyboard shortcuts

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