Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidFormat indicates a malformed key/value pair on a line. ErrInvalidFormat = errors.New("error invalid key/value format") )
Functions ¶
func GetPressure ¶
GetPressure takes the path of a *.pressure file and returns a map of the pressure (IO contention) stats for the cgroup on CPU controllers, the only key will be "some" on IO controllers, the keys will be "some" and "full" See https://github.com/torvalds/linux/blob/master/Documentation/accounting/psi.rst
func ParseCgroupParamKeyValue ¶
ParseCgroupParamKeyValue parses a cgroup param and returns the key name and value.
func ParseUint ¶
ParseUint reads a single uint value. It will trip any whitespace before attempting to parse string. If the value is negative it will return 0.
func ParseUintFromFile ¶
ParseUintFromFile reads a single uint value from a file.
Types ¶
type CPUUsage ¶
type CPUUsage struct { NS uint64 `json:"ns" struct:"ns"` Pct opt.Float `json:"pct,omitempty" struct:"pct,omitempty"` Norm opt.PctOpt `json:"norm,omitempty" struct:"norm,omitempty"` }
CPUUsage wraps the CPU usage time values for the CPU controller metrics
type Pressure ¶
type Pressure struct { Ten opt.Pct `json:"10,omitempty" struct:"10,omitempty"` Sixty opt.Pct `json:"60,omitempty" struct:"60,omitempty"` ThreeHundred opt.Pct `json:"300,omitempty" struct:"300,omitempty"` Total opt.Uint `json:"total,omitempty" struct:"total,omitempty"` }
Pressure contains load metrics for a controller, Broken apart into 10, 60, and 300 second samples, as well as a total time in US