balloons

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	// 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
	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
	// 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
	// FillReservedBalloon: put a container into the reserved
	// balloon.
	FillReservedBalloon
	// FillDefaultBalloon: put a container into the default
	// balloon.
	FillDefaultBalloon
)

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