Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ObjectCountNotFoundErr is returned when the object count for // a given resource is not being tracked. ObjectCountNotFoundErr = errors.New("object count not found for the given resource") // ObjectCountStaleErr is returned when the object count for a // given resource has gone stale due to transient failures. ObjectCountStaleErr = errors.New("object count has gone stale for the given resource") )
Functions ¶
This section is empty.
Types ¶
type StorageObjectCountTracker ¶ added in v0.23.0
type StorageObjectCountTracker interface { // Set is invoked to update the current number of total // objects for the given resource Set(string, int64) // Get returns the total number of objects for the given resource. // The following errors are returned: // - if the count has gone stale for a given resource due to transient // failures ObjectCountStaleErr is returned. // - if the given resource is not being tracked then // ObjectCountNotFoundErr is returned. Get(string) (int64, error) }
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 ¶ added in v0.23.0
func NewStorageObjectCountTracker(stopCh <-chan struct{}) 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 WorkEstimate ¶ added in v0.23.0
type WorkEstimate struct { // Seats represents the number of seats associated with this request Seats uint // AdditionalLatency specifies the additional duration the seats allocated // to this request must be reserved after the given request had finished. // AdditionalLatency should not have any impact on the user experience, the // caller must not experience this additional latency. AdditionalLatency time.Duration }
type WorkEstimatorFunc ¶ added in v0.23.0
type WorkEstimatorFunc func(*http.Request) WorkEstimate
WorkEstimatorFunc returns the estimated work of a given request. This function will be used by the Priority & Fairness filter to estimate the work of of incoming requests.
func NewWorkEstimator ¶ added in v0.23.0
func NewWorkEstimator(countFn objectCountGetterFunc) WorkEstimatorFunc
NewWorkEstimator estimates the work that will be done by a given request, if no WorkEstimatorFunc matches the given request then the default work estimate of 1 seat is allocated to the request.
func (WorkEstimatorFunc) EstimateWork ¶ added in v0.23.0
func (e WorkEstimatorFunc) EstimateWork(r *http.Request) WorkEstimate