systeminfo

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Poller = period.NewPoller("system_info", getSystemInfo, aggregate)

Functions

This section is empty.

Types

type Aggregated

type Aggregated []map[string]any

func (Aggregated) MarshalJSON

func (result Aggregated) MarshalJSON() ([]byte, error)

type Disk

type Disk struct {
	Path        string  `json:"path"`
	Fstype      string  `json:"fstype"`
	Total       uint64  `json:"total"`
	Free        uint64  `json:"free"`
	Used        uint64  `json:"used"`
	UsedPercent float64 `json:"used_percent"`
}

type DiskIO

type DiskIO struct {
	ReadBytes  uint64  `json:"read_bytes"`
	WriteBytes uint64  `json:"write_bytes"`
	ReadCount  uint64  `json:"read_count"`
	WriteCount uint64  `json:"write_count"`
	ReadSpeed  float64 `json:"read_speed"`
	WriteSpeed float64 `json:"write_speed"`
	Iops       uint64  `json:"iops"`
}

type MemoryUsage

type MemoryUsage struct {
	Total       uint64  `json:"total"`
	Available   uint64  `json:"available"`
	Used        uint64  `json:"used"`
	UsedPercent float64 `json:"used_percent"`
}

type Network

type Network struct {
	BytesSent     uint64  `json:"bytes_sent"`
	BytesRecv     uint64  `json:"bytes_recv"`
	UploadSpeed   float64 `json:"upload_speed"`
	DownloadSpeed float64 `json:"download_speed"`
}

type Sensors

type Sensors []sensors.TemperatureStat

func (*Sensors) UnmarshalJSON

func (s *Sensors) UnmarshalJSON(data []byte) error

type SystemInfo

type SystemInfo struct {
	Timestamp  int64              `json:"timestamp"`
	CPUAverage *float64           `json:"cpu_average"`
	Memory     *MemoryUsage       `json:"memory"`
	Disks      map[string]*Disk   `json:"disks"`    // disk usage by partition
	DisksIO    map[string]*DiskIO `json:"disks_io"` // disk IO by device
	Network    *Network           `json:"network"`
	Sensors    Sensors            `json:"sensors"` // sensor temperature by key
}

func (*SystemInfo) MarshalJSON

func (s *SystemInfo) MarshalJSON() ([]byte, error)

explicitly implement MarshalJSON to avoid reflection

Jump to

Keyboard shortcuts

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