Documentation ¶
Index ¶
Constants ¶
const (
ExternalResourcePrefix = "mixer.io/ext-"
)
Variables ¶
This section is empty.
Functions ¶
func GetPodResourceRequest ¶
func GetPodResourceRequest(pod *v1.Pod) v1.ResourceList
GetPodResourceRequest output pod's extended request resource quantity
func OrderedBy ¶
func OrderedBy(cmp ...cmpFunc) *multiSorter
OrderedBy returns a Sorter that sorts using the cmp functions, in order. Call its Sort method to sort the data.
func SortByPriority ¶
SortByPriority compare pods by Priority
func SortByResource ¶
SortByResource compare pods by resource usage Now just compare with usage quantity, not compare with request
func SortByStartTime ¶
SortByStartTime compare pods by the running duration
Types ¶
type NodeInfo ¶
type NodeInfo struct { // total requested extended resources of all pods on this node RequestedResource v1.ResourceList }
NodeInfo group node level info
func NewNodeInfo ¶
NewNodeInfo new a NodeInfo object. If any pods are given in arguments, their extended resources will be accumulated.
func (*NodeInfo) Less ¶
func (n *NodeInfo) Less(rl v1.ResourceList) bool
the function check if the extended request resource are less than resources given in parameter
func (*NodeInfo) More ¶
func (n *NodeInfo) More(rl v1.ResourceList) (bool, v1.ResourceName)
the function check if the extended request resources are more than resources given in parameter
func (*NodeInfo) ReduceRequestedResource ¶
func (n *NodeInfo) ReduceRequestedResource(resQuan v1.ResourceList)
ReduceRequestedResource take off the resource quantity from node's total request resource quantity
func (*NodeInfo) ResetNodeInfo ¶
ResetNodeInfo clear the NodeInfo object. If any pods are given in arguments, their extended resources will be accumulated.