Documentation ¶
Index ¶
- Constants
- Variables
- func DeterminePoolType(poolName string) string
- type CPUAnnotation
- func (cpuAnnotation CPUAnnotation) ContainerExclusiveCPU(container string) int
- func (cpuAnnotation CPUAnnotation) ContainerExists(name string) bool
- func (cpuAnnotation CPUAnnotation) ContainerPools(cName string) (pools []string)
- func (cpuAnnotation CPUAnnotation) ContainerSharedCPUTime(container string) int
- func (cpuAnnotation CPUAnnotation) ContainerTotalCPURequest(pool string, cName string) int
- func (cpuAnnotation CPUAnnotation) Containers() []string
- func (cpuAnnotation CPUAnnotation) Decode(annotation []byte) error
- type Container
- type Pool
- type PoolConfig
- type Process
Constants ¶
const ( //ExclusivePoolID is the constant prefix in the name of the CPU pool. It is used to signal that a CPU pool is of exclusive type ExclusivePoolID = "exclusive" //DefaultPoolID is the constant prefix in the name of the CPU pool. It is used to signal that a CPU pool is of default type DefaultPoolID = "default" )SharedPoolID = "shared"
Variables ¶
var (
//PoolConfigDir defines the pool configuration file location
PoolConfigDir = "/etc/cpu-pooler"
)
Functions ¶
func DeterminePoolType ¶ added in v0.3.0
DeterminePoolType takes the name of CPU pool as defined in the CPU-Pooler ConfigMap, and returns the type of CPU pool it represents. Type of the pool is determined based on the constant prefixes used in the name of the pool. A type can be shared, exclusive, or default.
Types ¶
type CPUAnnotation ¶
CPUAnnotation defines the pod cpu annotation structure
func NewCPUAnnotation ¶ added in v0.3.1
func NewCPUAnnotation() CPUAnnotation
NewCPUAnnotation returns a new CPUAnnotation
func (CPUAnnotation) ContainerExclusiveCPU ¶
func (cpuAnnotation CPUAnnotation) ContainerExclusiveCPU(container string) int
ContainerExclusiveCPU returns sum of cpu time requested from exclusive pool by a container
func (CPUAnnotation) ContainerExists ¶ added in v0.3.1
func (cpuAnnotation CPUAnnotation) ContainerExists(name string) bool
ContainerExists tells if container exist in annotation
func (CPUAnnotation) ContainerPools ¶
func (cpuAnnotation CPUAnnotation) ContainerPools(cName string) (pools []string)
ContainerPools returns all pools configured for container
func (CPUAnnotation) ContainerSharedCPUTime ¶
func (cpuAnnotation CPUAnnotation) ContainerSharedCPUTime(container string) int
ContainerSharedCPUTime returns sum of cpu time requested from shared pool by a container
func (CPUAnnotation) ContainerTotalCPURequest ¶
func (cpuAnnotation CPUAnnotation) ContainerTotalCPURequest(pool string, cName string) int
ContainerTotalCPURequest returns CPU requests of container from pool
func (CPUAnnotation) Containers ¶
func (cpuAnnotation CPUAnnotation) Containers() []string
Containers returns container name string in annotation
func (CPUAnnotation) Decode ¶
func (cpuAnnotation CPUAnnotation) Decode(annotation []byte) error
Decode unmarshals json annotation to CPUAnnotation
type PoolConfig ¶
PoolConfig defines pool configuration for a node
func DeterminePoolConfig ¶
func DeterminePoolConfig() (PoolConfig, string, error)
DeterminePoolConfig first interrogates the label set of the Node this process runs on. It uses this information to select the specific PoolConfig file corresponding to the Node. Returns the selected PoolConfig file, the name of the file, or an error if it was impossible to determine which config file is applicable.
func ReadPoolConfigFile ¶
func ReadPoolConfigFile(name string) (PoolConfig, error)
ReadPoolConfigFile reads a pool configuration file
func (PoolConfig) SelectPool ¶
func (poolConf PoolConfig) SelectPool(prefix string) Pool
SelectPool returns the exact CPUSet belonging to either the exclusive, shared, or default pool of one PoolConfig object An empty CPUSet is returned in case the configuration does not contain the requested type