Documentation ¶
Index ¶
- Constants
- func Reverse(t ThrottlePods) []podinfo.PodContext
- type ActionExecutor
- type AvoidanceExecutor
- type EvictExecutor
- type EvictPods
- type ExecuteContext
- type Executor
- type Gaps
- type ReleaseResource
- type ScheduleExecutor
- type ThrottleExecutor
- type ThrottlePods
- type Watermark
- type WatermarkMetric
- type Watermarks
- func (e Watermarks) DivideMetricsByEvictQuantified() (quantified []WatermarkMetric, notQuantified []WatermarkMetric)
- func (e Watermarks) DivideMetricsByThrottleQuantified() (MetricsThrottleQuantified []WatermarkMetric, ...)
- func (e Watermarks) GetHighestPriorityEvictableMetric() (highestPrioriyMetric WatermarkMetric)
- func (e Watermarks) GetHighestPriorityThrottleAbleMetric() (highestPrioriyMetric WatermarkMetric)
Constants ¶
const ( MaxUpQuota = 60 * 1000 // 60CU CpuQuotaCoefficient = 1000.0 MaxRatio = 100.0 )
const ( CpuUsage = WatermarkMetric(types.MetricNameCpuTotalUsage) CpuUsagePercent = WatermarkMetric(types.MetricNameCpuTotalUtilization) MemUsage = WatermarkMetric(types.MetricNameMemoryTotalUsage) MemUsagePercent = WatermarkMetric(types.MetricNameMemoryTotalUtilization) )
Be consistent with metrics in collector/types/types.go
const (
DefaultCoolDownSeconds = 300
)
Variables ¶
This section is empty.
Functions ¶
func Reverse ¶ added in v0.6.0
func Reverse(t ThrottlePods) []podinfo.PodContext
Types ¶
type ActionExecutor ¶ added in v0.2.0
type ActionExecutor struct {
// contains filtered or unexported fields
}
func NewActionExecutor ¶ added in v0.2.0
func NewActionExecutor(client clientset.Interface, nodeName string, podInformer coreinformers.PodInformer, nodeInformer coreinformers.NodeInformer, noticeCh <-chan AvoidanceExecutor, runtimeEndpoint string, stateMap map[string][]common.TimeSeries, executeExcess string) *ActionExecutor
NewActionExecutor create enforcer manager
func (*ActionExecutor) Name ¶ added in v0.2.0
func (a *ActionExecutor) Name() string
func (*ActionExecutor) Run ¶ added in v0.2.0
func (a *ActionExecutor) Run(stop <-chan struct{})
type AvoidanceExecutor ¶
type AvoidanceExecutor struct { ScheduleExecutor ScheduleExecutor ThrottleExecutor ThrottleExecutor EvictExecutor EvictExecutor StateMap map[string][]common.TimeSeries }
type EvictExecutor ¶
type EvictExecutor struct { EvictPods EvictPods // All metrics(not only can be quantified metrics) metioned in triggerd NodeQOS and their corresponding watermarks EvictWatermark Watermarks }
func (*EvictExecutor) Avoid ¶
func (e *EvictExecutor) Avoid(ctx *ExecuteContext) error
func (*EvictExecutor) Restore ¶
func (e *EvictExecutor) Restore(ctx *ExecuteContext) error
type EvictPods ¶
type EvictPods []podinfo.PodContext
type ExecuteContext ¶
type ExecuteContext struct { NodeName string Client clientset.Interface PodLister corelisters.PodLister NodeLister corelisters.NodeLister RuntimeClient pb.RuntimeServiceClient RuntimeConn *grpc.ClientConn // Gap for metrics Evictable/ThrottleAble // Key is the metric name, value is (actual used)-(the lowest watermark for NodeQOSEnsurancePolicies which use throttleDown action) ToBeThrottleDown Gaps // Key is the metric name, value is (actual used)-(the lowest watermark for NodeQOSEnsurancePolicies which use throttleUp action) ToBeThrottleUp Gaps // key is the metric name, value is (actual used)-(the lowest watermark for NodeQOSEnsurancePolicies which use evict action) ToBeEvict Gaps // contains filtered or unexported fields }
type Executor ¶
type Executor interface { Avoid(ctx *ExecuteContext) error Restore(ctx *ExecuteContext) error }
type Gaps ¶ added in v0.8.0
type Gaps map[WatermarkMetric]float64
Gaps key is metric name, value is the difference between usage and the smallest watermark
func (Gaps) GapsAllRemoved ¶ added in v0.8.0
Whether no gaps in Gaps
func (Gaps) HasUsageMissedMetric ¶ added in v0.8.0
Whether there is a metric that can't get usage in Gaps
func (Gaps) TargetGapsRemoved ¶ added in v0.8.0
func (g Gaps) TargetGapsRemoved(metric WatermarkMetric) bool
For a specified metric in Gaps, whether there still has gap
type ReleaseResource ¶ added in v0.6.0
type ReleaseResource map[WatermarkMetric]float64
func (ReleaseResource) Add ¶ added in v0.6.0
func (r ReleaseResource) Add(new ReleaseResource)
type ScheduleExecutor ¶ added in v0.2.0
type ScheduleExecutor struct {
ToBeDisable, ToBeRestore bool
}
func (*ScheduleExecutor) Avoid ¶ added in v0.2.0
func (b *ScheduleExecutor) Avoid(ctx *ExecuteContext) error
func (*ScheduleExecutor) Restore ¶ added in v0.2.0
func (b *ScheduleExecutor) Restore(ctx *ExecuteContext) error
type ThrottleExecutor ¶
type ThrottleExecutor struct { ThrottleDownPods ThrottlePods ThrottleUpPods ThrottlePods // All metrics(not only metrics that can be quantified) metioned in triggerd NodeQOS and their corresponding watermarks ThrottleDownWatermark Watermarks ThrottleUpWatermark Watermarks }
func (*ThrottleExecutor) Avoid ¶
func (t *ThrottleExecutor) Avoid(ctx *ExecuteContext) error
func (*ThrottleExecutor) Restore ¶
func (t *ThrottleExecutor) Restore(ctx *ExecuteContext) error
type ThrottlePods ¶ added in v0.2.0
type ThrottlePods []podinfo.PodContext
func (ThrottlePods) Find ¶ added in v0.2.0
func (t ThrottlePods) Find(podTypes types.NamespacedName) int
type Watermark ¶ added in v0.8.0
An Watermark is a min-heap of Quantity. The values come from each objectiveEnsurance.metricRule.value
func (*Watermark) PopSmallest ¶ added in v0.8.0
type WatermarkMetric ¶ added in v0.8.0
type WatermarkMetric string
WatermarkMetric defines metrics that can be measured for watermark Should be consistent with metrics in collector/types/types.go
type Watermarks ¶ added in v0.8.0
type Watermarks map[WatermarkMetric]*Watermark
Watermarks 's key is the metric name, value is watermark which get from each objectiveEnsurance.metricRule.value
func (Watermarks) DivideMetricsByEvictQuantified ¶ added in v0.8.0
func (e Watermarks) DivideMetricsByEvictQuantified() (quantified []WatermarkMetric, notQuantified []WatermarkMetric)
DivideMetricsByEvictQuantified divide metrics in watermarks into can be EvictQuantified and can not be EvictQuantified
func (Watermarks) DivideMetricsByThrottleQuantified ¶ added in v0.8.0
func (e Watermarks) DivideMetricsByThrottleQuantified() (MetricsThrottleQuantified []WatermarkMetric, MetricsNotThrottleQuantified []WatermarkMetric)
DivideMetricsByThrottleQuantified divide metrics by whether metrics can be throttleQuantified
func (Watermarks) GetHighestPriorityEvictableMetric ¶ added in v0.8.0
func (e Watermarks) GetHighestPriorityEvictableMetric() (highestPrioriyMetric WatermarkMetric)
GetHighestPriorityEvictableMetric get the highest priority in metrics that can be Evictable
func (Watermarks) GetHighestPriorityThrottleAbleMetric ¶ added in v0.8.0
func (e Watermarks) GetHighestPriorityThrottleAbleMetric() (highestPrioriyMetric WatermarkMetric)
GetHighestPriorityThrottleAbleMetric get the highest priority in metrics from watermarks