apiserverk8s.io/apiserver/pkg/util/flowcontrol/request Index | Files

package request

import "k8s.io/apiserver/pkg/util/flowcontrol/request"

Index

Types

type StorageObjectCountTracker

type StorageObjectCountTracker interface {
	// OnCount is invoked to update the current number of total
	// objects for the given resource
	OnCount(string, int64)

	// Get returns the total number of objects for the given resource.
	// If the given resource is not being tracked Get will return zero.
	// For now, we do not differentiate between zero object count and
	// a given resoure not being present.
	Get(string) int64
}

StorageObjectCountTracker is an interface that is used to keep track of of the total number of objects for each resource. {group}.{resource} is used as the key name to update and retrieve the total number of objects for a given resource.

func NewStorageObjectCountTracker

func NewStorageObjectCountTracker() StorageObjectCountTracker

NewStorageObjectCountTracker returns an instance of StorageObjectCountTracker interface that can be used to keep track of the total number of objects for each resource.

type Width

type Width struct {
	// Seats represents the number of seats associated with this request
	Seats uint
}

func DefaultWidthEstimator

func DefaultWidthEstimator(_ *http.Request) Width

DefaultWidthEstimator returns returns '1' as the "width" of the given request.

TODO: when we plumb in actual "width" handling for different

type of request(s) this function will iterate through a chain
of widthEstimator instance(s).

type WidthEstimatorFunc

type WidthEstimatorFunc func(*http.Request) Width

WidthEstimatorFunc returns the estimated "width" of a given request. This function will be used by the Priority & Fairness filter to estimate the "width" of incoming requests.

func (WidthEstimatorFunc) EstimateWidth

func (e WidthEstimatorFunc) EstimateWidth(r *http.Request) Width

Source Files

object_count_tracker.go width.go

Version
v0.22.0-beta.1
Published
Jul 8, 2021
Platform
js/wasm
Imports
2 packages
Last checked
1 minute ago

Tools for package owners.