Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrActivatorOverload = errors.New("activator overload")
Functions ¶
This section is empty.
Types ¶
type InfiniteBreaker ¶ added in v0.9.0
type InfiniteBreaker struct {
// contains filtered or unexported fields
}
InfiniteBreaker is basically a short circuit. InfiniteBreaker provides us capability to send unlimited number of requests to the downstream system. This is to be used only when the container concurrency is unset (i.e. infinity). The InfiniteBreaker will, though, block the requests when downstream capacity is 0. TODO(greghaynes) When the old throttler is removed this struct can be private.
func NewInfiniteBreaker ¶ added in v0.9.0
func NewInfiniteBreaker(logger *zap.SugaredLogger) *InfiniteBreaker
NewInfiniteBreaker creates an InfiniteBreaker
func (*InfiniteBreaker) Capacity ¶ added in v0.9.0
func (ib *InfiniteBreaker) Capacity() int
Capacity returns the current capacity of the breaker
func (*InfiniteBreaker) Maybe ¶ added in v0.9.0
func (ib *InfiniteBreaker) Maybe(ctx context.Context, thunk func()) error
Maybe executes thunk when capacity is available
func (*InfiniteBreaker) UpdateConcurrency ¶ added in v0.9.0
func (ib *InfiniteBreaker) UpdateConcurrency(cc int) error
UpdateConcurrency sets the concurrency of the breaker
type RevisionBackendsManager ¶
type RevisionBackendsManager struct {
// contains filtered or unexported fields
}
RevisionBackendsManager listens to revision endpoints and keeps track of healthy l4 dests which can be used to reach a revision
func NewRevisionBackendsManager ¶
func NewRevisionBackendsManager(ctx context.Context, tr http.RoundTripper, logger *zap.SugaredLogger) *RevisionBackendsManager
NewRevisionBackendsManager returns a new RevisionBackendsManager with default probe time out.
func NewRevisionBackendsManagerWithProbeFrequency ¶
func NewRevisionBackendsManagerWithProbeFrequency(ctx context.Context, tr http.RoundTripper, logger *zap.SugaredLogger, probeFreq time.Duration) *RevisionBackendsManager
NewRevisionBackendsManagerWithProbeFrequency creates a fully spec'd RevisionBackendsManager.
func (*RevisionBackendsManager) UpdateCh ¶ added in v0.9.0
func (rbm *RevisionBackendsManager) UpdateCh() <-chan RevisionDestsUpdate
Returns channel where dests updates are sent to
type RevisionDestsUpdate ¶
type RevisionDestsUpdate struct { Rev types.NamespacedName ClusterIPDest string Dests sets.String }
RevisionDestsUpdate contains the state of healthy l4 dests for talking to a revision and is the primary output from the RevisionBackendsManager system. If a healthy ClusterIP is found then ClusterIPDest will be set to non empty string and Dests will be nil. Otherwise Dests will be set to a slice of healthy l4 dests for reaching the revision.
type Throttler ¶ added in v0.9.0
type Throttler struct {
// contains filtered or unexported fields
}
Throttler load balances requests to revisions based on capacity. When `Run` is called it listens for updates to revision backends and decides when and when and where to forward a request.
func NewThrottler ¶ added in v0.9.0
func NewThrottler(breakerParams queue.BreakerParams, revisionInformer servinginformers.RevisionInformer, endpointsInformer corev1informers.EndpointsInformer, logger *zap.SugaredLogger) *Throttler
NewThrottler creates a new Throttler
func (*Throttler) Run ¶ added in v0.9.0
func (t *Throttler) Run(updateCh <-chan RevisionDestsUpdate)
Run starts the throttler and blocks until updateCh is closed.