monitor

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoreStatus added in v0.3.9

type CoreStatus struct {
	Name        string  `json:"name"`
	LoadPercent float64 `json:"load_percent"`
}

type CpuMonitor

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

func NewCpuMonitor

func NewCpuMonitor(cpuTempPath *string) (cm CpuMonitor)

func (*CpuMonitor) ComputeCpuStatus

func (m *CpuMonitor) ComputeCpuStatus() (status CpuStatus, cores []CoreStatus)

type CpuSnapshot

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

type CpuStatus

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

type DiskIni added in v0.3.7

type DiskIni struct {
	Id       string
	Temp     uint64
	Spundown bool
}

type DiskMonitor

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

func NewDiskMonitor

func NewDiskMonitor(disks map[string][]string) (dm DiskMonitor)

func (*DiskMonitor) ComputeDiskUsage

func (monitor *DiskMonitor) ComputeDiskUsage() DiskUsage

type DiskStatus

type DiskStatus struct {
	Name        string  `json:"-"`
	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"`
	Temp        uint64  `json:"temp"`
	Id          string  `json:"disk_id"`
	IsSpinning  bool    `json:"is_spinning"`
}

func AggregateDiskStatuses

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

type DiskUsage added in v0.3.10

type DiskUsage struct {
	Array []DiskStatus
	Cache []DiskStatus
	Party []ParityStatus
	Pools []PoolStatus
}

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
}

type ParityStatus added in v0.3.6

type ParityStatus struct {
	Name       string `json:"name"`
	Temp       uint64 `json:"temp"`
	Id         string `json:"disk_id"`
	IsSpinning bool   `json:"is_spinning"`
}

type Pool added in v0.3.10

type Pool struct {
	Name   string   `yaml:"name"`
	Mounts []string `yaml:"mounts"`
}

type PoolStatus added in v0.3.10

type PoolStatus struct {
	Name  string       `json:"name"`
	Total DiskStatus   `json:"total"`
	Disks []DiskStatus `json:"disks"`
}

type ZfsDataset added in v0.3.0

type ZfsDataset struct {
	Name       string
	Used       string
	Avail      string
	Refer      string
	Mountpoint string
}

Jump to

Keyboard shortcuts

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