Documentation ¶
Index ¶
- Variables
- type Factory
- type Scheduler
- func (ws *Scheduler) Close() error
- func (ws *Scheduler) Decide(ctx context.Context, labels map[string]string) *flowcontrolv1.LimiterDecision
- func (ws *Scheduler) GetEstimatedTokens(workloadIndex string) (uint64, bool)
- func (ws *Scheduler) GetLatencyObserver(labels map[string]string) prometheus.Observer
- func (ws *Scheduler) GetRequestCounter(labels map[string]string) prometheus.Counter
- func (ws *Scheduler) Revert(labels map[string]string, decision *flowcontrolv1.LimiterDecision)
- func (ws *Scheduler) SetEstimatedTokens(tokensByWorkloadIndex map[string]uint64)
Constants ¶
This section is empty.
Variables ¶
var MetricLabelKeys = []string{metrics.PolicyNameLabel, metrics.PolicyHashLabel, metrics.ComponentIDLabel}
MetricLabelKeys is an array of Label Keys for WFQ and Token Bucket Metrics.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory is a factory for creating load schedulers.
func NewFactory ¶
func NewFactory( lifecycle fx.Lifecycle, statusRegistry status.Registry, prometheusRegistry *prometheus.Registry, ) (*Factory, error)
NewFactory sets up the load scheduler module in the main fx app.
func (*Factory) NewScheduler ¶
func (wsFactory *Factory) NewScheduler( registry status.Registry, proto *policylangv1.Scheduler, component iface.Component, tokenManger scheduler.TokenManager, clock clockwork.Clock, metricLabels prometheus.Labels, ) (*Scheduler, error)
NewScheduler returns fx options for the load scheduler fx app.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler implements load scheduler on the flowcontrol side.
func (*Scheduler) Decide ¶
func (ws *Scheduler) Decide(ctx context.Context, labels map[string]string, ) *flowcontrolv1.LimiterDecision
Decide processes a single flow by load scheduler in a blocking manner.
Context is used to ensure that requests are not scheduled for longer than its deadline allows.
func (*Scheduler) GetEstimatedTokens ¶
GetEstimatedTokens returns estimated tokens for specific workload.
func (*Scheduler) GetLatencyObserver ¶
func (ws *Scheduler) GetLatencyObserver(labels map[string]string) prometheus.Observer
GetLatencyObserver returns histogram for specific workload.
func (*Scheduler) GetRequestCounter ¶
func (ws *Scheduler) GetRequestCounter(labels map[string]string) prometheus.Counter
GetRequestCounter returns request counter for specific workload.
func (*Scheduler) Revert ¶
func (ws *Scheduler) Revert(labels map[string]string, decision *flowcontrolv1.LimiterDecision)
Revert reverts the decision made by the limiter.
func (*Scheduler) SetEstimatedTokens ¶
SetEstimatedTokens sets estimated tokens for specific workload.