cpu

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// USER is the key for user. Value set to 0
	USER = iota
	// NICE is the key for Nice, Value set to 1
	NICE
	// SYSTEM  is the key for system, Value set to 2
	SYSTEM
	// IDLE is the key for idle, Value set to 3
	IDLE
	// IOWAIT is the key for IO wait, Value set to 4
	IOWAIT
	// IRQ is the key for IRQ, Value set to 5
	IRQ
	// SOFTIRQ is the key for SOFTIRQ, Value set to 6
	SOFTIRQ
	// STEAL is the key for steal, Value set to 7
	STEAL
	// GEUST is the key for guest, Value set to 8
	GEUST
	// GESTNICE is the key for guest nice, Value set to 9
	GESTNICE
)
View Source
const (
	// CPUIdle is the key idle cpu. value set to 0
	CPUIdle = iota
	// CPUNonidle is key for non idle cpu
	CPUNonidle
	// CPUTotal is the key for total cpu value
	CPUTotal
)

Variables

This section is empty.

Functions

func Percent

func Percent(interval time.Duration, percpu bool) ([]float64, error)

Percent is used to return the cpu usage in percentage

Types

type InfoStat

type InfoStat struct {
	Mhz float64
	// contains filtered or unexported fields
}

InfoStat struct

func Info

func Info() ([]InfoStat, error)

Info is used to return the frequency and core info in InfoStat structure

Jump to

Keyboard shortcuts

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