Documentation ¶
Index ¶
Constants ¶
const ( // PolicyName is the name of this policy. PolicyName = "balloons" // PolicyDescription is a short description of this policy. PolicyDescription = "Flexible pools with per-pool CPU parameters" // NoLimit value denotes no limit being set. NoLimit = 0 )
const ( CPUTopologyLevelUndefined = cfgapi.CPUTopologyLevelUndefined CPUTopologyLevelSystem = cfgapi.CPUTopologyLevelSystem CPUTopologyLevelPackage = cfgapi.CPUTopologyLevelPackage CPUTopologyLevelDie = cfgapi.CPUTopologyLevelDie CPUTopologyLevelNuma = cfgapi.CPUTopologyLevelNuma CPUTopologyLevelCore = cfgapi.CPUTopologyLevelCore CPUTopologyLevelThread = cfgapi.CPUTopologyLevelThread )
Variables ¶
var (
CPUTopologyLevelCount = cfgapi.CPUTopologyLevelCount
)
var WalkSkipChildren error = errors.New("skip children")
WalkSkipChildren error returned from a DepthFirstWalk handler prevents walking deeper in the tree. The caller of the DepthFirstWalk will get no error.
var WalkStop error = errors.New("stop")
WalkStop error returned from a DepthFirstWalk handler stops the walk altogether. The caller of the DepthFirstWalk will get the WalkStop error.
Functions ¶
func NewCpuTree ¶
func NewCpuTree(name string) *cpuTreeNode
NewCpuTree returns a named CPU tree node.
func NewCpuTreeFromSystem ¶
func NewCpuTreeFromSystem() (*cpuTreeNode, error)
NewCpuTreeFromSystem returns the root node of the topology tree constructed from the underlying system.
Types ¶
type Balloon ¶
type Balloon struct { // Def is the definition from which this balloon instance is created. Def *BalloonDef // Instance is the index of this balloon instance, starting from // zero for every balloon definition. Instance int // Cpus is the set of CPUs exclusive to this balloon instance only. Cpus cpuset.CPUSet // Mems is the set of memory nodes with minimal access delay // from CPUs. Mems idset.IDSet // balloon are allowed to use with workloads in other balloons // that shareIdleCpus. SharedIdleCpus cpuset.CPUSet // PodIDs maps pod ID to list of container IDs. // - len(PodIDs) is the number of pods in the balloon. // - len(PodIDs[podID]) is the number of containers of podID // currently assigned to the balloon. PodIDs map[string][]string // Groups is a multiset (group-by-value -> appearance-count) // of evaluated GroupBy expressions on containers in the balloon. Groups map[string]int // contains filtered or unexported fields }
Balloon contains attributes of a balloon instance
func (Balloon) AvailMilliCpus ¶
func (Balloon) ContainerCount ¶
ContainerCount returns the number of containers in a balloon.
func (Balloon) ContainerIDs ¶
ContainerIDs returns IDs of containers assigned in a balloon. (Using cache.Container.GetID()'s)
func (Balloon) PrettyName ¶
PrettyName returns a unique name for a balloon.
type BalloonDef ¶
type BalloonDef = cfgapi.BalloonDef
type BalloonMetrics ¶
type BalloonMetrics struct { // Balloon type metrics DefName string CpuClass string MinCpus int MaxCpus int // Balloon instance metrics PrettyName string Groups string Cpus cpuset.CPUSet CpusCount int Numas []string NumasCount int Dies []string DiesCount int Packages []string PackagesCount int CpusAllowed cpuset.CPUSet CpusAllowedCount int Mems string ContainerNames string ContainerReqMilliCpus int }
BalloonMetrics define metrics of a balloon instance.
type BalloonsOptions ¶
type CPUTopologyLevel ¶
type CPUTopologyLevel = cfgapi.CPUTopologyLevel
type FillMethod ¶
type FillMethod int
FillMethod specifies the order in which balloon instances should be filled.
const ( FillUnspecified FillMethod = iota // FillBalanced: put a container into the balloon with most // free CPU without changing the size of the balloon. FillBalanced // FillBalancedInflate: put a container into the balloon with // most free CPU when the balloon is inflated to the maximum // size. FillBalancedInflate // FillPacked: put a container into a balloon so that it // minimizes the amount of currently unused CPUs in the // balloon. FillPacked // FillPackedInflate: put a container into a balloon so that // it minimizes the amount of unused CPUs if the balloon is // inflated to the maximum size. FillPackedInflate // FillSameGroup: put a container into a balloon with other // containers that share the same evaluated GroupBy expression // result, that is, the same group. FillSameGroup // FillSameNamespace: put a container into a balloon that already // includes another container from the same namespace FillSameNamespace // FillSamePod: put a container into a balloon that already // includes another container from the same pod. FillSamePod // FillNewBalloon: create a new balloon, if possible, and put // a container into it. FillNewBalloon // FillNewBalloonMust: create a new balloon for a container, // but refuse to run the container if the balloon cannot be // created. FillNewBalloonMust )
func (FillMethod) MarshalJSON ¶
func (fm FillMethod) MarshalJSON() ([]byte, error)
MarshalJSON marshals a FillMethod as a quoted json string
func (*FillMethod) UnmarshalJSON ¶
func (fm *FillMethod) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals a FillMethod quoted json string to the enum value
type Metrics ¶
type Metrics struct {
Balloons []*BalloonMetrics
}
Metrics defines the balloons-specific metrics from policy level.