Documentation ¶
Index ¶
- Variables
- func GetBlkioDir() string
- func GetCPUSetMemoryMigrate(cgroupPath string) (bool, error)
- func GetGlobalNumaStats() (map[int]GlobalNumaStats, error)
- func ResetBlkioParameters(cgroupsDir string, blockIO OciBlockIOParameters) error
- func SetBlkioParameters(cgroupsDir string, blockIO OciBlockIOParameters) error
- type BlkioDeviceBytes
- type BlkioThrottleBytes
- type CPUAcctUsage
- type CgroupID
- type GlobalNumaStats
- type HugetlbUsage
- type MemoryUsage
- type NumaLine
- type NumaStat
- type OciBlockIOParameters
- type OciDeviceParameters
- type OciDeviceRate
- type OciDeviceRates
- type OciDeviceWeight
- type OciDeviceWeights
Constants ¶
This section is empty.
Variables ¶
var ( // V2path is the mount point for the cgroup V2 pseudofilesystem. V2path string )
Functions ¶
func GetBlkioDir ¶
func GetBlkioDir() string
GetBlkioDir returns the cgroups blkio controller directory.
func GetCPUSetMemoryMigrate ¶
GetCPUSetMemoryMigrate returns boolean indicating whether memory migration is enabled.
func GetGlobalNumaStats ¶
func GetGlobalNumaStats() (map[int]GlobalNumaStats, error)
GetGlobalNumaStats returns the global (non-cgroup) NUMA statistics per node.
func ResetBlkioParameters ¶
func ResetBlkioParameters(cgroupsDir string, blockIO OciBlockIOParameters) error
ResetBlkioParameters adds new, changes existing and removes missing blockIO parameters in cgroupsDir
func SetBlkioParameters ¶
func SetBlkioParameters(cgroupsDir string, blockIO OciBlockIOParameters) error
SetBlkioParameters writes OCI BlockIO parameters to files in cgroups blkio contoller directory.
Types ¶
type BlkioDeviceBytes ¶
BlkioDeviceBytes contains a single operations line of blkio.throttle.io_service_bytes_recursive file
type BlkioThrottleBytes ¶
type BlkioThrottleBytes struct { DeviceBytes []*BlkioDeviceBytes TotalBytes int64 }
BlkioThrottleBytes has parsed contents of blkio.throttle.io_service_bytes_recursive file
func GetBlkioThrottleBytes ¶
func GetBlkioThrottleBytes(cgroupPath string) (BlkioThrottleBytes, error)
GetBlkioThrottleBytes returns amount of bytes transferred to/from the disk.
type CPUAcctUsage ¶
CPUAcctUsage has a parsed line of cpuacct.usage_all file
func GetCPUAcctStats ¶
func GetCPUAcctStats(cgroupPath string) ([]CPUAcctUsage, error)
GetCPUAcctStats retrieves CPU account statistics for a given cgroup.
type CgroupID ¶
CgroupID implements mapping kernel cgroup IDs to cgroupfs paths with transparent caching.
func NewCgroupID ¶
NewCgroupID creates a new CgroupID map/cache.
type GlobalNumaStats ¶
type GlobalNumaStats struct { NumaHit int64 NumaMiss int64 NumaForeign int64 InterleaveHit int64 LocalNode int64 OtherNode int64 }
GlobalNumaStats has the statistics from one global NUMA nodestats file.
type HugetlbUsage ¶
HugetlbUsage has parsed contents of huge pages usage in bytes.
func GetHugetlbUsage ¶
func GetHugetlbUsage(cgroupPath string) ([]HugetlbUsage, error)
GetHugetlbUsage retrieves huge pages statistics for a given cgroup.
type MemoryUsage ¶
MemoryUsage has parsed contents of memory usage in bytes.
func GetMemoryUsage ¶
func GetMemoryUsage(cgroupPath string) (MemoryUsage, error)
GetMemoryUsage retrieves cgroup memory usage.
type NumaStat ¶
type NumaStat struct { Total NumaLine File NumaLine Anon NumaLine Unevictable NumaLine HierarchicalTotal NumaLine HierarchicalFile NumaLine HierarchicalAnon NumaLine HierarchicalUnevictable NumaLine }
NumaStat has parsed contets of a NUMA statistics file.
func GetNumaStats ¶
GetNumaStats returns parsed cgroup NUMA statistics.
type OciBlockIOParameters ¶
type OciBlockIOParameters struct { Weight int64 WeightDevice OciDeviceWeights ThrottleReadBpsDevice OciDeviceRates ThrottleWriteBpsDevice OciDeviceRates ThrottleReadIOPSDevice OciDeviceRates ThrottleWriteIOPSDevice OciDeviceRates }
OciBlockIOParameters contains OCI standard configuration of cgroups blkio parameters.
Effects of Weight and Rate values in SetBlkioParameters(): Value | Effect -------+-------------------------------------------------------------------
-1 | Do not write to cgroups, value is missing 0 | Write to cgroups, will remove the setting as specified in cgroups blkio interface other | Write to cgroups, sets the value
func GetBlkioParameters ¶
func GetBlkioParameters(cgroupsDir string) (OciBlockIOParameters, error)
GetBlkioParameters returns OCI BlockIO parameters from files in cgroups blkio controller directory.
func NewOciBlockIOParameters ¶
func NewOciBlockIOParameters() OciBlockIOParameters
NewOciBlockIOParameters creates new OciBlockIOParameters instance.
type OciDeviceParameters ¶
OciDeviceParameters interface provides functions common to OciDeviceWeights and OciDeviceRates
type OciDeviceRate ¶
OciDeviceRate contains values for - blkio.throttle.read_bps_device - blkio.throttle.write_bps_device - blkio.throttle.read_iops_device - blkio.throttle.write_iops_device
func NewOciDeviceRate ¶
func NewOciDeviceRate() OciDeviceRate
NewOciDeviceRate creates new OciDeviceRate instance.
type OciDeviceRates ¶
type OciDeviceRates []OciDeviceRate
OciDeviceRates contains throttling rates for devices
func (*OciDeviceRates) Append ¶
func (r *OciDeviceRates) Append(maj, min, val int64)
Append appends (major, minor, value) to OciDeviceRates slice.
func (*OciDeviceRates) Update ¶
func (r *OciDeviceRates) Update(maj, min, val int64)
Update updates device rate in OciDeviceRates slice, or appends it if not found.
type OciDeviceWeight ¶
OciDeviceWeight contains values for - blkio.[io-scheduler].weight
func NewOciDeviceWeight ¶
func NewOciDeviceWeight() OciDeviceWeight
NewOciDeviceWeight creates new OciDeviceWeight instance.
type OciDeviceWeights ¶
type OciDeviceWeights []OciDeviceWeight
OciDeviceWeights contains weights for devices
func (*OciDeviceWeights) Append ¶
func (w *OciDeviceWeights) Append(maj, min, val int64)
Append appends (major, minor, value) to OciDeviceWeights slice.
func (*OciDeviceWeights) Update ¶
func (w *OciDeviceWeights) Update(maj, min, val int64)
Update updates device weight in OciDeviceWeights slice, or appends it if not found.