Documentation
¶
Index ¶
- Variables
- func Init()
- func ParseCPU(cpuAllowance string, cpuPriority string) (int64, int64, int64, error)
- func Supports(resource Resource) bool
- func TaskSchedulerTrigger(srcType string, srcName string, srcStatus string)
- func Warnings() []cluster.Warning
- type CGroup
- func (cg *CGroup) GetBlkioWeight() (int64, error)
- func (cg *CGroup) GetCPUAcctUsage() (int64, error)
- func (cg *CGroup) GetCPUAcctUsageAll() (map[int64]CPUStats, error)
- func (cg *CGroup) GetCPUCfsLimit() (int64, int64, error)
- func (cg *CGroup) GetCpuset() (string, error)
- func (cg *CGroup) GetEffectiveCPUs() (int, error)
- func (cg *CGroup) GetEffectiveCpuset() (string, error)
- func (cg *CGroup) GetEffectiveMemoryLimit() (int64, error)
- func (cg *CGroup) GetIOStats() (map[string]*IOStats, error)
- func (cg *CGroup) GetMemoryLimit() (int64, error)
- func (cg *CGroup) GetMemoryMaxUsage() (int64, error)
- func (cg *CGroup) GetMemorySoftLimit() (int64, error)
- func (cg *CGroup) GetMemoryStats() (map[string]uint64, error)
- func (cg *CGroup) GetMemorySwapLimit() (int64, error)
- func (cg *CGroup) GetMemorySwapMaxUsage() (int64, error)
- func (cg *CGroup) GetMemorySwapUsage() (int64, error)
- func (cg *CGroup) GetMemoryUsage() (int64, error)
- func (cg *CGroup) GetOOMKills() (int64, error)
- func (cg *CGroup) GetProcessesUsage() (int64, error)
- func (cg *CGroup) SetBlkioLimit(dev string, oType string, uType string, limit int64) error
- func (cg *CGroup) SetBlkioWeight(limit int64) error
- func (cg *CGroup) SetCPUCfsLimit(limitPeriod int64, limitQuota int64) error
- func (cg *CGroup) SetCPUShare(limit int64) error
- func (cg *CGroup) SetCpuset(limit string) error
- func (cg *CGroup) SetHugepagesLimit(pageType string, limit int64) error
- func (cg *CGroup) SetMaxProcesses(limit int64) error
- func (cg *CGroup) SetMemoryLimit(limit int64) error
- func (cg *CGroup) SetMemorySoftLimit(limit int64) error
- func (cg *CGroup) SetMemorySwapLimit(limit int64) error
- func (cg *CGroup) SetMemorySwappiness(limit int64) error
- type CPUStats
- type IOStats
- type ReadWriter
- type Resource
Constants ¶
This section is empty.
Variables ¶
var DeviceSchedRebalance = make(chan []string, 2)
DeviceSchedRebalance channel for scheduling a CPU rebalance.
var ErrControllerMissing = errors.New("Cgroup controller is missing")
ErrControllerMissing indicates that the requested controller isn't setup on the system.
var ErrUnknownVersion = errors.New("Unknown cgroup version")
ErrUnknownVersion indicates that a version other than those supported was detected during init.
Functions ¶
func TaskSchedulerTrigger ¶
TaskSchedulerTrigger triggers a CPU rebalance.
Types ¶
type CGroup ¶
type CGroup struct {
// contains filtered or unexported fields
}
CGroup represents the main cgroup abstraction.
func New ¶
func New(rw ReadWriter) (*CGroup, error)
New setups a new CGroup abstraction using the provided read/writer.
func NewFileReadWriter ¶
NewFileReadWriter returns a CGroup instance using the filesystem as its backend.
func (*CGroup) GetBlkioWeight ¶
GetBlkioWeight returns the currently allowed range of weights.
func (*CGroup) GetCPUAcctUsage ¶
GetCPUAcctUsage returns the total CPU time in ns used by processes.
func (*CGroup) GetCPUAcctUsageAll ¶
GetCPUAcctUsageAll returns the user and system CPU times of each CPU thread in ns used by processes.
func (*CGroup) GetCPUCfsLimit ¶
GetCPUCfsLimit gets the quota and duration in ms for each scheduling period.
func (*CGroup) GetEffectiveCPUs ¶
GetEffectiveCPUs returns the total number of effective CPUs.
func (*CGroup) GetEffectiveCpuset ¶
GetEffectiveCpuset returns the current set of CPUs for the cgroup.
func (*CGroup) GetEffectiveMemoryLimit ¶
GetEffectiveMemoryLimit return the effective hard limit for memory. Returns the cgroup memory limit, or if the cgroup memory limit couldn't be determined or is larger than the total system memory, then the total system memory is returned.
func (*CGroup) GetIOStats ¶
GetIOStats returns disk stats.
func (*CGroup) GetMemoryLimit ¶
GetMemoryLimit return the hard limit for memory.
func (*CGroup) GetMemoryMaxUsage ¶
GetMemoryMaxUsage returns the record high for memory usage.
func (*CGroup) GetMemorySoftLimit ¶
GetMemorySoftLimit returns the soft limit for memory.
func (*CGroup) GetMemoryStats ¶
GetMemoryStats returns memory stats.
func (*CGroup) GetMemorySwapLimit ¶
GetMemorySwapLimit returns the hard limit on swap usage.
func (*CGroup) GetMemorySwapMaxUsage ¶
GetMemorySwapMaxUsage returns the record high for swap usage.
func (*CGroup) GetMemorySwapUsage ¶
GetMemorySwapUsage return current usage of swap.
func (*CGroup) GetMemoryUsage ¶
GetMemoryUsage returns the current use of memory.
func (*CGroup) GetOOMKills ¶
GetOOMKills returns the number of oom kills.
func (*CGroup) GetProcessesUsage ¶
GetProcessesUsage returns the current number of pids.
func (*CGroup) SetBlkioLimit ¶
SetBlkioLimit sets the specified read or write limit for a device.
func (*CGroup) SetBlkioWeight ¶
SetBlkioWeight sets the currently allowed range of weights.
func (*CGroup) SetCPUCfsLimit ¶
SetCPUCfsLimit sets the quota and duration in ms for each scheduling period.
func (*CGroup) SetCPUShare ¶
SetCPUShare sets the weight of each group in the same hierarchy.
func (*CGroup) SetHugepagesLimit ¶
SetHugepagesLimit applies a limit to the number of processes.
func (*CGroup) SetMaxProcesses ¶
SetMaxProcesses applies a limit to the number of processes.
func (*CGroup) SetMemoryLimit ¶
SetMemoryLimit sets the hard limit for memory.
func (*CGroup) SetMemorySoftLimit ¶
SetMemorySoftLimit set the soft limit for memory.
func (*CGroup) SetMemorySwapLimit ¶
SetMemorySwapLimit sets the hard limit for swap.
func (*CGroup) SetMemorySwappiness ¶
SetMemorySwappiness sets swappiness paramet of vmscan.
type IOStats ¶
type IOStats struct {
ReadBytes uint64
ReadsCompleted uint64
WrittenBytes uint64
WritesCompleted uint64
}
IOStats represent IO stats.
type ReadWriter ¶
type ReadWriter interface {
Get(controller string, key string) (string, error)
Set(controller string, key string, value string) error
}
The ReadWriter interface is used to read/write cgroup data.