balloons

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
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
)
View Source
const (
	CPUTopologyLevelUndefined = cfgapi.CPUTopologyLevelUndefined
	CPUTopologyLevelSystem    = cfgapi.CPUTopologyLevelSystem
	CPUTopologyLevelPackage   = cfgapi.CPUTopologyLevelPackage
	CPUTopologyLevelDie       = cfgapi.CPUTopologyLevelDie
	CPUTopologyLevelNuma      = cfgapi.CPUTopologyLevelNuma
	CPUTopologyLevelCore      = cfgapi.CPUTopologyLevelCore
	CPUTopologyLevelThread    = cfgapi.CPUTopologyLevelThread
)

Variables

View Source
var (
	CPUTopologyLevelCount = cfgapi.CPUTopologyLevelCount
)
View Source
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.

View Source
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 New added in v0.3.0

func New() policy.Backend

New creates a new uninitialized balloons policy instance.

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
	// SharedIdleCpus is the set of idle CPUs that workloads in a
	// 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 (bln Balloon) AvailMilliCpus() int

func (Balloon) ContainerCount

func (bln Balloon) ContainerCount() int

ContainerCount returns the number of containers in a balloon.

func (Balloon) ContainerIDs

func (bln Balloon) ContainerIDs() []string

ContainerIDs returns IDs of containers assigned in a balloon. (Using cache.Container.GetID()'s)

func (Balloon) MaxAvailMilliCpus

func (bln Balloon) MaxAvailMilliCpus(freeCpus cpuset.CPUSet) int

func (Balloon) PrettyName

func (bln Balloon) PrettyName() string

PrettyName returns a unique name for a balloon.

func (Balloon) String

func (bln Balloon) String() string

String is a stringer 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
	SharedIdleCpus        cpuset.CPUSet
	SharedIdleCpusCount   int
	CpusAllowed           cpuset.CPUSet
	CpusAllowedCount      int
	Mems                  string
	ContainerNames        string
	ContainerReqMilliCpus int
}

BalloonMetrics define metrics of a balloon instance.

type BalloonsOptions

type BalloonsOptions = cfgapi.Config

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) String

func (fm FillMethod) String() string

String stringifies a FillMethod

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL