metrics

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

Collector gathers host-level system metrics.

func NewCollector

func NewCollector(dockerDataRoot string, skipDisk bool) *Collector

NewCollector creates a new metrics collector. dockerDataRoot is the path to the Docker data directory (used for disk metrics). skipDisk disables disk metric collection when true.

func (*Collector) Collect

func (c *Collector) Collect() (*HostMetrics, error)

Collect gathers all host metrics and returns them.

type HostMetrics

type HostMetrics struct {
	CPUUsage       float64 `json:"cpuUsage"`
	CPUCores       int     `json:"cpuCores"`
	MemoryTotal    uint64  `json:"memoryTotal"`
	MemoryUsed     uint64  `json:"memoryUsed"`
	MemoryFree     uint64  `json:"memoryFree"`
	DiskTotal      uint64  `json:"diskTotal"`
	DiskUsed       uint64  `json:"diskUsed"`
	DiskFree       uint64  `json:"diskFree"`
	NetworkRxBytes uint64  `json:"networkRxBytes"`
	NetworkTxBytes uint64  `json:"networkTxBytes"`
	Uptime         uint64  `json:"uptime"`
}

HostMetrics contains system-level resource metrics.

Jump to

Keyboard shortcuts

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