Documentation
¶
Overview ¶
Package adaptive implements bounded, request-driven feedback control.
Index ¶
- type Adjustment
- type Config
- type Controller
- func (c *Controller) Begin(priority admission.Priority, now time.Time) (admission.Decision, uint64)
- func (c *Controller) BeginBudget(priority admission.Priority, now time.Time, bucket, buckets, ceiling int) (admission.Decision, uint64)
- func (c *Controller) BeginCohort(priority admission.Priority, now time.Time, bucket, buckets int) (admission.Decision, uint64)
- func (c *Controller) End(priority admission.Priority, generation uint64, now time.Time, ...) *Adjustment
- func (c *Controller) Snapshot() Evaluation
- type Evaluation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adjustment ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func (*Controller) Begin ¶
Begin coordinates the admission decision and measurement generation. There is no capacity wait. Total/background saturation can justify cautious growth.
func (*Controller) BeginBudget ¶ added in v0.6.0
func (*Controller) BeginCohort ¶ added in v0.4.0
func (*Controller) End ¶
func (c *Controller) End(priority admission.Priority, generation uint64, now time.Time, elapsed, target time.Duration, failed, canceled bool) *Adjustment
End always releases admitted work, including canceled/stale-generation work. Only current, noncanceled completions contribute feedback. Timings are divided by each handler's configured latency budget before aggregation.
func (*Controller) Snapshot ¶ added in v0.2.0
func (c *Controller) Snapshot() Evaluation
Snapshot does not evaluate or reset the controller. A zero timestamp means no complete window has met both the interval and sample requirements yet.
type Evaluation ¶ added in v0.2.0
type Evaluation struct {
ControlRatio, ControlFailureFraction float64
ControlPriority string
Profile string
SmoothedControlRatio float64
SparseWindow, ExternalLimit bool
PressureStreak, HealthyStreak, PendingSamples int
WindowStartedAt time.Time
WindowInterval time.Duration
EvaluatedAt time.Time
Samples int
P90Ratio, FailureFraction float64
PreviousLimit, Limit int
Saturated bool
Decision, Reason string
}
Evaluation describes the last completed feedback window, including hold decisions.