Documentation ¶
Index ¶
Constants ¶
View Source
const HeartbeatFrequencySeconds = 5
HeartbeatFrequencySeconds dictates the frequency of expected heartbeats from executors
View Source
const MaxMissedHeartbeats = 3
MaxMissedHeartbeats dictates the maximum number of heartbeats missed before we declare the executor dead
Variables ¶
This section is empty.
Functions ¶
func AddExecutor ¶
AddExecutor adds an Executor to the list of Executors to track.
func RecordHeartbeat ¶
func RecordHeartbeat(id string)
RecordHeartbeat records a heartbeat for an executor by its id.
func Schedule ¶
func Schedule(ctx context.Context, calc LoadCalculator, source types.RequestSource)
Types ¶
type Executor ¶
Executor represents a running client process that hosts worker threads. Each Executor can support up to #Workers simultaneously running Jobs.
func EligibleExecutors ¶
func EligibleExecutors() []*Executor
EligibleExecutors returns an array of Executors that are currently alive and ready to receive work
func GetExecutor ¶
GetExecutor returns an Executor by its id, if it exists. nil is returned otherwise.
type ExponentialFunctionLoadCalculator ¶
type ExponentialFunctionLoadCalculator struct {
// contains filtered or unexported fields
}
func (*ExponentialFunctionLoadCalculator) Next ¶
func (e *ExponentialFunctionLoadCalculator) Next() int
type LoadCalculator ¶
type LoadCalculator interface {
Next() int
}
func NewExponentialLoadCalculator ¶
func NewExponentialLoadCalculator(minRps int, maxRps int) LoadCalculator
func NewLogarithmicLoadCalculator ¶
func NewLogarithmicLoadCalculator(minRps int, maxRps int) LoadCalculator
func NewStepFunctionLoadCalculator ¶
func NewStepFunctionLoadCalculator(minRps int, maxRps int, stepSize int) LoadCalculator
type StepFunctionLoadCalculator ¶
type StepFunctionLoadCalculator struct {
// contains filtered or unexported fields
}
func (*StepFunctionLoadCalculator) Next ¶
func (s *StepFunctionLoadCalculator) Next() int
Click to show internal directories.
Click to hide internal directories.