cpu

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: Apache-2.0 Imports: 20 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.

Variables

This section is empty.

Functions

func HasBlockedTooLong added in v0.4.4

func HasBlockedTooLong(line string) bool

Returns the task name and true if the line indicates that a task is hung too long.

func HasSoftLockup added in v0.4.4

func HasSoftLockup(line string) bool

Returns the task name 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)

func New

func New(ctx context.Context, eventStore eventstore.Store) (components.Component, error)

Types

type Cores

type Cores struct {
	Logical int `json:"logical"`
	// contains filtered or unexported fields
}

type Data added in v0.4.5

type Data struct {
	Info  *Info  `json:"info"`
	Cores *Cores `json:"cores"`
	Usage *Usage `json:"usage"`
	// contains filtered or unexported fields
}

type Info

type Info struct {
	Arch      string `json:"arch"`
	CPU       string `json:"cpu"`
	Family    string `json:"family"`
	Model     string `json:"model"`
	ModelName string `json:"model_name"`
	// contains filtered or unexported fields
}

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
}

Directories

Path Synopsis
Package metrics implements the CPU metrics collection and reporting.
Package metrics implements the CPU metrics collection and reporting.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳