Documentation ¶
Index ¶
- Variables
- func Module() fx.Option
- func SanitizeSchedulerProto(proto *policylangv1.Scheduler) (*policylangv1.Scheduler, error)
- type Factory
- func (wsFactory *Factory) GetLatencyObserver(labels map[string]string) prometheus.Observer
- func (wsFactory *Factory) GetRequestCounter(labels map[string]string) prometheus.Counter
- func (wsFactory *Factory) NewScheduler(clk clockwork.Clock, registry status.Registry, proto *policylangv1.Scheduler, ...) (*Scheduler, error)
- func (wsFactory *Factory) NewSchedulerMetrics(metricLabels prometheus.Labels) (*SchedulerMetrics, error)
- type Scheduler
- func (s *Scheduler) Decide(ctx context.Context, labels labels.Labels) *flowcontrolv1.LimiterDecision
- func (s *Scheduler) GetEstimatedTokens(workloadIndex string) (float64, bool)
- func (s *Scheduler) GetLatencyObserver(labels map[string]string) prometheus.Observer
- func (s *Scheduler) GetRampMode() bool
- func (s *Scheduler) GetRequestCounter(labels map[string]string) prometheus.Counter
- func (s *Scheduler) Info() (time.Time, int)
- func (s *Scheduler) Revert(ctx context.Context, labels labels.Labels, ...)
- func (s *Scheduler) SetEstimatedTokens(tokensByWorkloadIndex map[string]float64)
- type SchedulerMetrics
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 ¶
func SanitizeSchedulerProto ¶ added in v2.2.0
func SanitizeSchedulerProto(proto *policylangv1.Scheduler) (*policylangv1.Scheduler, error)
SanitizeSchedulerProto sanitizes the scheduler proto.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory is a factory for creating load schedulers.
func (*Factory) GetLatencyObserver ¶ added in v2.2.0
func (wsFactory *Factory) GetLatencyObserver(labels map[string]string) prometheus.Observer
GetLatencyObserver returns a latency observer for a given workload.
func (*Factory) GetRequestCounter ¶ added in v2.2.0
func (wsFactory *Factory) GetRequestCounter(labels map[string]string) prometheus.Counter
GetRequestCounter returns a request counter for a given workload.
func (*Factory) NewScheduler ¶
func (wsFactory *Factory) NewScheduler( clk clockwork.Clock, registry status.Registry, proto *policylangv1.Scheduler, component iface.Component, tokenManger scheduler.TokenManager, schedulerMetrics *SchedulerMetrics, ) (*Scheduler, error)
NewScheduler returns fx options for the load scheduler fx app.
func (*Factory) NewSchedulerMetrics ¶ added in v2.2.0
func (wsFactory *Factory) NewSchedulerMetrics(metricLabels prometheus.Labels) (*SchedulerMetrics, error)
NewSchedulerMetrics creates a new SchedulerMetrics instance.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler implements load scheduler on the flowcontrol side.
func (*Scheduler) Decide ¶
func (s *Scheduler) Decide(ctx context.Context, labels labels.Labels) *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 (s *Scheduler) GetLatencyObserver(labels map[string]string) prometheus.Observer
GetLatencyObserver returns histogram for specific workload.
func (*Scheduler) GetRampMode ¶ added in v2.17.0
GetRampMode is always false for Schedulers.
func (*Scheduler) GetRequestCounter ¶
func (s *Scheduler) GetRequestCounter(labels map[string]string) prometheus.Counter
GetRequestCounter returns request counter for specific workload.
func (*Scheduler) Revert ¶
func (s *Scheduler) Revert(ctx context.Context, labels labels.Labels, decision *flowcontrolv1.LimiterDecision)
Revert reverts the decision made by the limiter.
func (*Scheduler) SetEstimatedTokens ¶
SetEstimatedTokens sets estimated tokens for specific workload.
type SchedulerMetrics ¶ added in v2.2.0
type SchedulerMetrics struct {
// contains filtered or unexported fields
}
SchedulerMetrics is a struct that holds all metrics for Scheduler.
func (*SchedulerMetrics) Delete ¶ added in v2.2.0
func (metrics *SchedulerMetrics) Delete() error
Delete removes all metrics from metric vectors.