Documentation ¶
Index ¶
- Constants
- func GetEffectiveResource(pod *v1.Pod, fn func(container *v1.Container) v1.ResourceList) *framework.Resource
- func GetMuSigma(rs *ResourceStats) (float64, float64)
- func GetResourceData(metrics []watcher.Metric, resourceType string) (avg float64, stDev float64, isValid bool)
- func GetResourceLimits(pod *v1.Pod) *framework.Resource
- func GetResourceRequested(pod *v1.Pod) *framework.Resource
- func SetMaxLimits(requests *framework.Resource, limits *framework.Resource)
- type Collector
- type NodeRequestsAndLimits
- type PodAssignEventHandler
- type ResourceStats
Constants ¶
const ( // MegaFactor : Mega unit multiplier MegaFactor = float64(1. / 1024. / 1024.) )
Variables ¶
This section is empty.
Functions ¶
func GetEffectiveResource ¶ added in v0.26.7
func GetEffectiveResource(pod *v1.Pod, fn func(container *v1.Container) v1.ResourceList) *framework.Resource
GetEffectiveResource : calculate effective resources of a pod (CPU and Memory)
func GetMuSigma ¶ added in v0.24.9
func GetMuSigma(rs *ResourceStats) (float64, float64)
GetMuSigma : get average and standard deviation from statistics
func GetResourceData ¶ added in v0.24.9
func GetResourceData(metrics []watcher.Metric, resourceType string) (avg float64, stDev float64, isValid bool)
GetResourceData : get data from measurements for a given resource type
func GetResourceLimits ¶ added in v0.26.7
GetResourceLimits : calculate the resource limits of a pod (CPU and Memory)
func GetResourceRequested ¶ added in v0.24.9
GetResourceRequested : calculate the resource requests of a pod (CPU and Memory)
Types ¶
type Collector ¶ added in v0.24.9
type Collector struct {
// contains filtered or unexported fields
}
Collector : get data from load watcher, encapsulating the load watcher and its operations
Trimaran plugins have different, potentially conflicting, objectives. Thus, it is recommended not to enable them concurrently. As such, they are currently designed to each have its own Collector. If a need arises in the future to enable multiple Trimaran plugins, a restructuring to have a single Collector, serving the multiple plugins, may be beneficial for performance reasons.
func NewCollector ¶ added in v0.24.9
func NewCollector(logger klog.Logger, trimaranSpec *pluginConfig.TrimaranSpec) (*Collector, error)
NewCollector : create an instance of a data collector
func (*Collector) GetNodeMetrics ¶ added in v0.24.9
func (collector *Collector) GetNodeMetrics(logger klog.Logger, nodeName string) ([]watcher.Metric, *watcher.WatcherMetrics)
GetNodeMetrics : get metrics for a node from watcher
type NodeRequestsAndLimits ¶ added in v0.26.7
type NodeRequestsAndLimits struct { // NodeRequest sum of requests of all pods on node NodeRequest *framework.Resource // NodeLimit sum of limits of all pods on node NodeLimit *framework.Resource // NodeRequestMinusPod is the NodeRequest without the requests of the pending pod NodeRequestMinusPod *framework.Resource // NodeLimitMinusPod is the NodeLimit without the limits of the pending pod NodeLimitMinusPod *framework.Resource // Nodecapacity is the capacity (allocatable) of node Nodecapacity *framework.Resource }
NodeRequestsAndLimits : data ralated to requests and limits of resources on a node
func GetNodeRequestsAndLimits ¶ added in v0.26.7
func GetNodeRequestsAndLimits(logger klog.Logger, podInfosOnNode []*framework.PodInfo, node *v1.Node, pod *v1.Pod, podRequests *framework.Resource, podLimits *framework.Resource) *NodeRequestsAndLimits
GetNodeRequestsAndLimits : total requested and limits of resources on a given node plus a pod
type PodAssignEventHandler ¶
type PodAssignEventHandler struct { // Maintains the node-name to podInfo mapping for pods successfully bound to nodes ScheduledPodsCache map[string][]podInfo sync.RWMutex }
This event handler watches assigned Pod and caches them locally
func New ¶
func New() *PodAssignEventHandler
New returns a new instance of PodAssignEventHandler, after starting a background go routine for cache cleanup
func (*PodAssignEventHandler) AddToHandle ¶ added in v0.24.9
func (p *PodAssignEventHandler) AddToHandle(handle framework.Handle)
AddToHandle : add event handler to framework handle
func (*PodAssignEventHandler) OnAdd ¶
func (p *PodAssignEventHandler) OnAdd(obj interface{}, _ bool)
func (*PodAssignEventHandler) OnDelete ¶
func (p *PodAssignEventHandler) OnDelete(obj interface{})
func (*PodAssignEventHandler) OnUpdate ¶
func (p *PodAssignEventHandler) OnUpdate(oldObj, newObj interface{})
type ResourceStats ¶ added in v0.24.9
type ResourceStats struct { // average used (absolute) UsedAvg float64 // standard deviation used (absolute) UsedStdev float64 // req of pod Req float64 // node capacity Capacity float64 }
ResourceStats : statistics data for a resource
func CreateResourceStats ¶ added in v0.24.9
func CreateResourceStats(logger klog.Logger, metrics []watcher.Metric, node *v1.Node, podRequest *framework.Resource, resourceName v1.ResourceName, watcherType string) (rs *ResourceStats, isValid bool)
CreateResourceStats : get resource statistics data from measurements for a node
Directories ¶
Path | Synopsis |
---|---|
Package loadvariationriskbalancing plugin attempts to balance the risk in load variation across the cluster.
|
Package loadvariationriskbalancing plugin attempts to balance the risk in load variation across the cluster. |