ratelimiter

package
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultProviderRPS is the recommended default average requeues per
	// second tolerated by a Crossplane provider.
	DefaultProviderRPS = 1
)

Variables

This section is empty.

Functions

func NewDefaultManagedRateLimiter

func NewDefaultManagedRateLimiter(provider ratelimiter.RateLimiter) ratelimiter.RateLimiter

NewDefaultManagedRateLimiter returns a rate limiter that takes the maximum delay between the passed provider and a per-item exponential backoff limiter. The exponential backoff limiter has a base delay of 1s and a maximum of 60s.

func NewDefaultProviderRateLimiter

func NewDefaultProviderRateLimiter(rps int) *workqueue.BucketRateLimiter

NewDefaultProviderRateLimiter returns a token bucket rate limiter meant for limiting the number of average total requeues per second for all controllers registered with a controller manager. The bucket size is a linear function of the requeues per second.

func NewGlobal

func NewGlobal(rps int) *workqueue.BucketRateLimiter

NewGlobal returns a token bucket rate limiter meant for limiting the number of average total requeues per second for all controllers registered with a controller manager. The bucket size (i.e. allowed burst) is rps * 10.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL