cpu

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package cpu tracks the combined usage of all CPUs (not per-CPU).

Index

Constants

View Source
const Name = "cpu"

Name is the ID of the CPU component.

View Source
const SubSystem = "cpu"

SubSystem is the Prometheus subsystem name for CPU metrics.

Variables

This section is empty.

Functions

func HasBlockedTooLong added in v0.4.4

func HasBlockedTooLong(line string) (string, bool)

HasBlockedTooLong returns the task name with PID and true if the line indicates that a task is hung too long.

func HasSoftLockup added in v0.4.4

func HasSoftLockup(line string) (string, bool)

HasSoftLockup returns the task name with PID and true if the line indicates a CPU soft lockup.

func Match added in v0.4.4

func Match(line string) (eventName string, message string)

Match matches CPU-related kernel log lines to event names and messages.

func New

func New(gpudInstance *components.GPUdInstance) (components.Component, error)

New creates the CPU component.

Types

type Cores

type Cores struct {
	Logical int `json:"logical"`
}

Cores reports CPU core counts.

type Usage

type Usage struct {
	// Used CPU in percentage.
	// Parse into float64 to get the actual value.
	UsedPercent string `json:"used_percent"`

	// Load average for the last 1-minute, with the scale of 1.00.
	// Parse into float64 to get the actual value.
	LoadAvg1Min string `json:"load_avg_1min"`
	// Load average for the last 5-minutes, with the scale of 1.00.
	// Parse into float64 to get the actual value.
	LoadAvg5Min string `json:"load_avg_5min"`
	// Load average for the last 15-minutes, with the scale of 1.00.
	// Parse into float64 to get the actual value.
	LoadAvg15Min string `json:"load_avg_15min"`
	// contains filtered or unexported fields
}

Usage reports aggregate CPU utilization and load averages.

Jump to

Keyboard shortcuts

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