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 ¶
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.
Click to show internal directories.
Click to hide internal directories.