Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoCFSLimit = errors.New("no CPU CFS limit")
ErrNoCFSLimit indicates no CPU CFS limit is set
Functions ¶
func ParseUintList ¶
ParseUintList parses CPU list strings like "0-2,4,6-8"
Types ¶
type CPU ¶
type CPU interface {
// Get CPU usage rate, returned value is 1000 times the actual usage rate (e.g., 50.5% returns 505)
Usage() (u uint64, e error)
// Get CPU information
Info() Info
}
CPU defines CPU statistics interface
type CgroupCPU ¶
type CgroupCPU struct {
// contains filtered or unexported fields
}
CgroupCPU implements CPU monitoring based on cgroup
func NewCgroupCPU ¶
NewCgroupCPU creates a cgroup-based CPU monitoring instance
type Info ¶
type Info struct {
Frequency uint64 // CPU frequency (Hz)
Quota float64 // CPU quota (if limited)
Cores int // Logical core count
}
Info CPU information structure
Click to show internal directories.
Click to hide internal directories.