components

package
v0.0.41101 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ComponentNamePrefix defines the worker role for performance sensitive workflows
	// TODO: change it back to longer name once https://bugzilla.redhat.com/show_bug.cgi?id=1787907 fixed
	// ComponentNamePrefix = "worker-performance"
	ComponentNamePrefix = "performance"
	// MachineConfigRoleLabelKey is the label key to use as label and in MachineConfigSelector of MCP which targets the performance profile
	MachineConfigRoleLabelKey = "machineconfiguration.openshift.io/role"
	// NodeRoleLabelPrefix is the prefix for the role label of a node
	NodeRoleLabelPrefix = "node-role.kubernetes.io/"
)
View Source
const (
	// NamespaceNodeTuningOperator defines the tuned profiles namespace
	NamespaceNodeTuningOperator = "openshift-cluster-node-tuning-operator"
	// ProfileNamePerformance defines the performance tuned profile name
	ProfileNamePerformance = "openshift-node-performance"
)
View Source
const (
	// HugepagesSize2M contains the size of 2M hugepages
	HugepagesSize2M = "2M"
	// HugepagesSize1G contains the size of 1G hugepages
	HugepagesSize1G = "1G"
)
View Source
const (
	// AssetsDir defines the directory with assets under the operator image
	AssetsDir = "/assets"
)

Variables

This section is empty.

Functions

func CPUListToHexMask

func CPUListToHexMask(cpulist string) (hexMask string, err error)

CPUListToHexMask converts a list of cpus into a cpu mask represented in hexdecimal

func CPUListToMaskList

func CPUListToMaskList(cpulist string) (hexMask string, err error)

CPUListToMaskList converts a list of cpus into a cpu mask represented in a list of hexadecimal mask devided by a delimiter ","

func CPUMaskToCPUSet

func CPUMaskToCPUSet(cpuMask string) (cpuset.CPUSet, error)

CPUMaskToCPUSet parses a CPUSet received in a Mask Format, see: https://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS

func GetComponentName

func GetComponentName(profileName string, prefix string) string

GetComponentName returns the component name for the specific performance profile

func GetFirstKeyAndValue

func GetFirstKeyAndValue(m map[string]string) (string, string)

GetFirstKeyAndValue return the first key / value pair of a map

func SplitLabelKey

func SplitLabelKey(s string) (domain, role string, err error)

SplitLabelKey returns the given label key splitted up in domain and role

Types

type CPULists

type CPULists struct {
	// contains filtered or unexported fields
}

CPULists allows easy checks between reserved and isolated cpu set definitons

func NewCPULists

func NewCPULists(reservedList, isolatedList string) (*CPULists, error)

NewCPULists parse text representations of reserved and isolated cpusets definiton and returns a CPULists object

func (*CPULists) CountIsolated

func (c *CPULists) CountIsolated() int

CountIsolated returns how many isolated cpus where specified

func (*CPULists) Intersect

func (c *CPULists) Intersect() []int

Intersect returns cpu ids found in both the provided cpuLists, if any

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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