Documentation
¶
Index ¶
- Constants
- func CalculateFilterPodsUsed(nodeUsed float64, nodeReserved float64, podMetas []*statesinformer.PodMeta, ...) (float64, float64, float64)
- func CollectAllHostAppMetrics(hostApps []slov1alpha1.HostApplicationSpec, ...) map[string]float64
- func CollectAllHostAppMetricsLast(hostApps []slov1alpha1.HostApplicationSpec, ...) map[string]float64
- func CollectAllPodMetrics(statesInformer statesinformer.StatesInformer, ...) map[string]float64
- func CollectAllPodMetricsLast(statesInformer statesinformer.StatesInformer, ...) map[string]float64
- func CollectContainerResMetricLast(metricCache metriccache.MetricCache, queryMeta metriccache.MetricMeta, ...) (float64, error)
- func CollectContainerThrottledMetric(metricCache metriccache.MetricCache, containerID *string, ...) (metriccache.AggregateResult, error)
- func CollectNodeMetrics(metricCache metriccache.MetricCache, start, end time.Time, ...) (metriccache.AggregateResult, error)
- func CollectPodMetric(metricCache metriccache.MetricCache, queryMeta metriccache.MetricMeta, ...) (metriccache.AggregateResult, error)
- func CollectPodMetricLast(metricCache metriccache.MetricCache, queryMeta metriccache.MetricMeta, ...) (float64, error)
- func CollectorNodeMetricLast(metricCache metriccache.MetricCache, queryMeta metriccache.MetricMeta, ...) (float64, error)
- func GenerateQueryParamsAvg(windowDuration time.Duration) *metriccache.QueryParam
- func GenerateQueryParamsLast(windowDuration time.Duration) *metriccache.QueryParam
- func GetKubeQoSResourceQoSByQoSClass(qosClass corev1.PodQOSClass, strategy *slov1alpha1.ResourceQOSStrategy) *slov1alpha1.ResourceQOS
- func GetNodeResourceReserved(node *corev1.Node) corev1.ResourceList
- func GetPodResourceQoSByQoSClass(pod *corev1.Pod, strategy *slov1alpha1.ResourceQOSStrategy) *slov1alpha1.ResourceQOS
- func KillContainers(pod *corev1.Pod, message string)
- func NonBEHostAppFilter(hostAppSpec *slov1alpha1.HostApplicationSpec) bool
- func NonBEPodFilter(pod *corev1.Pod) bool
- func NoneHostAppHighPriority(_ *slov1alpha1.HostApplicationSpec) bool
- func NonePodHighPriority(_ *corev1.Pod) bool
- func NotBatchOrFreePodFilter(pod *corev1.Pod) bool
- func Query(querier metriccache.Querier, resource metriccache.MetricResource, ...) (metriccache.AggregateResult, error)
Constants ¶
View Source
const ( UpdateCPU = "UpdateCPU" UpdateMemory = "UpdateMemory" UpdateCgroups = "UpdateCgroups" // update cgroups excluding the options already stated above UpdateSystemConfig = "UpdateSystemConfig" UpdateResctrlSchemata = "UpdateResctrlSchemata" // update resctrl l3 cat schemata UpdateResctrlTasks = "UpdateResctrlTasks" // update resctrl tasks EvictPodByNodeMemoryUsage = "EvictPodByNodeMemoryUsage" EvictPodByBECPUSatisfaction = "EvictPodByBECPUSatisfaction" AdjustBEByNodeCPUUsage = "AdjustBEByNodeCPUUsage" EvictPodSuccess = "evictPodSuccess" EvictPodFail = "evictPodFail" )
Variables ¶
This section is empty.
Functions ¶
func CalculateFilterPodsUsed ¶ added in v1.4.0
func CalculateFilterPodsUsed(nodeUsed float64, nodeReserved float64, podMetas []*statesinformer.PodMeta, podUsedMap map[string]float64, hostApps []slov1alpha1.HostApplicationSpec, hostAppMetrics map[string]float64, podFilterFn func(*corev1.Pod) bool, hostAppFilterFn func(*slov1alpha1.HostApplicationSpec) bool) (float64, float64, float64)
CalculateFilterPodsUsed calculates the sum used of filtered pods and hostApps. It returns the sum used of the filtered pods, the sum used of the filtered hostApps and the system used. If hostApps not passed, the hostApps part will be counted into the system used.
e.g. To calculate non-BE used,
- filterPodsUsed := sum(podUsed[i] if f_pod(pod[i]))
- filterHostAppUsed := sum(hostAppUsed[i] if f_hostApp(hostApp[i]))
- systemdUsed := max(nodeReserved, nodeUsed - sum(podUsed[i]) - sum(hostAppUsed[i]))
func CollectAllHostAppMetrics ¶ added in v1.4.0
func CollectAllHostAppMetrics(hostApps []slov1alpha1.HostApplicationSpec, metricCache metriccache.MetricCache, queryParam metriccache.QueryParam, metricResource metriccache.MetricResource) map[string]float64
func CollectAllHostAppMetricsLast ¶ added in v1.4.0
func CollectAllHostAppMetricsLast(hostApps []slov1alpha1.HostApplicationSpec, metricCache metriccache.MetricCache, metricResource metriccache.MetricResource, metricCollectInterval time.Duration) map[string]float64
func CollectAllPodMetrics ¶
func CollectAllPodMetrics(statesInformer statesinformer.StatesInformer, metricCache metriccache.MetricCache, queryParam metriccache.QueryParam, metricResource metriccache.MetricResource) map[string]float64
func CollectAllPodMetricsLast ¶
func CollectAllPodMetricsLast(statesInformer statesinformer.StatesInformer, metricCache metriccache.MetricCache, metricResource metriccache.MetricResource, metricCollectInterval time.Duration) map[string]float64
func CollectContainerResMetricLast ¶
func CollectContainerResMetricLast(metricCache metriccache.MetricCache, queryMeta metriccache.MetricMeta, metricCollectInterval time.Duration) (float64, error)
func CollectContainerThrottledMetric ¶
func CollectContainerThrottledMetric(metricCache metriccache.MetricCache, containerID *string, metricCollectInterval time.Duration) (metriccache.AggregateResult, error)
func CollectNodeMetrics ¶
func CollectNodeMetrics(metricCache metriccache.MetricCache, start, end time.Time, queryMeta metriccache.MetricMeta) (metriccache.AggregateResult, error)
func CollectPodMetric ¶
func CollectPodMetric(metricCache metriccache.MetricCache, queryMeta metriccache.MetricMeta, start, end time.Time) (metriccache.AggregateResult, error)
func CollectPodMetricLast ¶
func CollectPodMetricLast(metricCache metriccache.MetricCache, queryMeta metriccache.MetricMeta, metricCollectInterval time.Duration) (float64, error)
func CollectorNodeMetricLast ¶
func CollectorNodeMetricLast(metricCache metriccache.MetricCache, queryMeta metriccache.MetricMeta, metricCollectInterval time.Duration) (float64, error)
func GenerateQueryParamsAvg ¶
func GenerateQueryParamsAvg(windowDuration time.Duration) *metriccache.QueryParam
func GenerateQueryParamsLast ¶
func GenerateQueryParamsLast(windowDuration time.Duration) *metriccache.QueryParam
func GetKubeQoSResourceQoSByQoSClass ¶
func GetKubeQoSResourceQoSByQoSClass(qosClass corev1.PodQOSClass, strategy *slov1alpha1.ResourceQOSStrategy) *slov1alpha1.ResourceQOS
GetKubeQoSResourceQoSByQoSClass gets pod config by mapping kube qos into koordinator qos. https://koordinator.sh/docs/core-concepts/qos/#koordinator-qos-vs-kubernetes-qos
func GetNodeResourceReserved ¶ added in v1.4.0
func GetNodeResourceReserved(node *corev1.Node) corev1.ResourceList
func GetPodResourceQoSByQoSClass ¶
func GetPodResourceQoSByQoSClass(pod *corev1.Pod, strategy *slov1alpha1.ResourceQOSStrategy) *slov1alpha1.ResourceQOS
func KillContainers ¶
KillContainers kills containers inside the pod
func NonBEHostAppFilter ¶ added in v1.4.0
func NonBEHostAppFilter(hostAppSpec *slov1alpha1.HostApplicationSpec) bool
func NonBEPodFilter ¶ added in v1.4.0
func NoneHostAppHighPriority ¶ added in v1.4.0
func NoneHostAppHighPriority(_ *slov1alpha1.HostApplicationSpec) bool
func NonePodHighPriority ¶ added in v1.4.0
func NotBatchOrFreePodFilter ¶ added in v1.4.0
func Query ¶
func Query(querier metriccache.Querier, resource metriccache.MetricResource, properties map[metriccache.MetricProperty]string) (metriccache.AggregateResult, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.