Documentation ¶
Index ¶
- func SetGetPodPoolMapFunc(f GetPodPoolMapFunc)
- type CPUPressureEviction
- type CPUPressureForceEviction
- type CPUPressureLoadEviction
- func (p *CPUPressureLoadEviction) GetTopEvictionPods(_ context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
- func (p *CPUPressureLoadEviction) Name() string
- func (p *CPUPressureLoadEviction) Start(ctx context.Context) (err error)
- func (p *CPUPressureLoadEviction) ThresholdMet(_ context.Context, _ *pluginapi.Empty) (*pluginapi.ThresholdMetResponse, error)
- type CPUPressureSuppression
- type CPUPressureThresholdEviction
- type ContainerOwnerPoolInfo
- type Entries
- type GetPodPoolMapFunc
- type MetricInfo
- type MetricRing
- type MetricSnapshot
- type PodPoolMap
- type PoolMetricCollectHandler
- type SubEntries
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetGetPodPoolMapFunc ¶ added in v0.3.0
func SetGetPodPoolMapFunc(f GetPodPoolMapFunc)
SetGetPodPoolMapFunc provides a hook to change the implementation of GetPodPoolMapFunc
Types ¶
type CPUPressureEviction ¶
type CPUPressureForceEviction ¶
type CPUPressureForceEviction interface { CPUPressureEviction GetEvictPods(context.Context, *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error) }
func NewCPUPressureSuppressionEviction ¶
func NewCPUPressureSuppressionEviction(_ metrics.MetricEmitter, _ *metaserver.MetaServer, conf *config.Configuration, state state.ReadonlyState) CPUPressureForceEviction
type CPUPressureLoadEviction ¶
func (*CPUPressureLoadEviction) GetTopEvictionPods ¶
func (p *CPUPressureLoadEviction) GetTopEvictionPods(_ context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
func (*CPUPressureLoadEviction) Name ¶
func (p *CPUPressureLoadEviction) Name() string
func (*CPUPressureLoadEviction) Start ¶
func (p *CPUPressureLoadEviction) Start(ctx context.Context) (err error)
func (*CPUPressureLoadEviction) ThresholdMet ¶
func (p *CPUPressureLoadEviction) ThresholdMet(_ context.Context, _ *pluginapi.Empty) (*pluginapi.ThresholdMetResponse, error)
type CPUPressureSuppression ¶
type CPUPressureSuppression struct {
// contains filtered or unexported fields
}
func (*CPUPressureSuppression) GetEvictPods ¶
func (p *CPUPressureSuppression) GetEvictPods(_ context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
func (*CPUPressureSuppression) Name ¶
func (p *CPUPressureSuppression) Name() string
type CPUPressureThresholdEviction ¶
type CPUPressureThresholdEviction interface { CPUPressureEviction ThresholdMet(context.Context, *pluginapi.Empty) (*pluginapi.ThresholdMetResponse, error) GetTopEvictionPods(context.Context, *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error) }
func NewCPUPressureLoadEviction ¶ added in v0.3.0
func NewCPUPressureLoadEviction(emitter metrics.MetricEmitter, metaServer *metaserver.MetaServer, conf *config.Configuration, state state.ReadonlyState) (CPUPressureThresholdEviction, error)
type ContainerOwnerPoolInfo ¶ added in v0.3.0
type GetPodPoolMapFunc ¶ added in v0.3.0
type GetPodPoolMapFunc func(pod.PodFetcher, state.ReadonlyState) PodPoolMap
GetPodPoolMapFunc returns a map keyed by pod UID, the value is a map keyed by container name and its value is the container info with owner pool.
var DefaultGetPodPoolMapFunc GetPodPoolMapFunc = func(fetcher pod.PodFetcher, readonlyState state.ReadonlyState) PodPoolMap { result := make(PodPoolMap) for podUID, entry := range readonlyState.GetPodEntries() { for containerName, containerEntry := range entry { if entry.IsPoolEntry() { result.PutContainerOwnerPoolInfo(podUID, containerName, podUID, containerEntry.AllocationResult.Size(), true) continue } if containerEntry == nil { continue } else if containerEntry.OwnerPoolName == "" { general.Infof("skip get pool name for pod: %s, "+ "container: %s with owner pool name: %s", podUID, containerName, containerEntry.OwnerPoolName) continue } result.PutContainerOwnerPoolInfo(podUID, containerName, containerEntry.OwnerPoolName, containerEntry.AllocationResult.Size(), false) } } return result }
type MetricInfo ¶
type MetricRing ¶
type MetricRing struct { MaxLen int Queue []*MetricSnapshot CurrentIndex int sync.RWMutex }
func CreateMetricRing ¶
func CreateMetricRing(size int) *MetricRing
func (*MetricRing) Count ¶
func (ring *MetricRing) Count() (softOverCount, hardOverCount int)
func (*MetricRing) Push ¶
func (ring *MetricRing) Push(snapShot *MetricSnapshot)
func (*MetricRing) Sum ¶
func (ring *MetricRing) Sum() float64
type MetricSnapshot ¶
type MetricSnapshot struct { Info MetricInfo Time int64 }
type PodPoolMap ¶ added in v0.3.0
type PodPoolMap map[string]map[string]*ContainerOwnerPoolInfo
PodPoolMap is a map keyed by pod UID, the value is a map keyed by container name and its value is the container info with owner pool.
func (PodPoolMap) PutContainerOwnerPoolInfo ¶ added in v0.3.0
type SubEntries ¶
type SubEntries map[string]*MetricRing
SubEntries is keyed by container name or empty string (for pool)
func (SubEntries) IsPoolEntry ¶
func (se SubEntries) IsPoolEntry() bool
Click to show internal directories.
Click to hide internal directories.