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(registry status.Registry, proto *policylangv1.Scheduler, ...) (*Scheduler, error)
- func (wsFactory *Factory) NewSchedulerMetrics(metricLabels prometheus.Labels) (*SchedulerMetrics, error)
- type Scheduler
- 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) Info() (time.Time, int)
- func (ws *Scheduler) Revert(labels map[string]string, decision *flowcontrolv1.LimiterDecision)
- func (ws *Scheduler) SetEstimatedTokens(tokensByWorkloadIndex map[string]uint64)
- 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( registry status.Registry, proto *policylangv1.Scheduler, component iface.Component, tokenManger scheduler.TokenManager, clock clockwork.Clock, metrics *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 (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.
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.