consumerd

package
v0.0.0-...-211e212 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2021 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoUsageLimits

func AutoUsageLimits() run.ResizerManager

func FixedUsageLimits

func FixedUsageLimits(limit int64) run.ResizerManager

func NewConsumerdServer

func NewConsumerdServer(
	ctx context.Context,
	opts ...ConsumerdServerOption,
) *consumerdServer

Types

type ConsumerdServerOption

type ConsumerdServerOption func(*ConsumerdServerOptions)

func WithMonitorClient

func WithMonitorClient(
	client types.MonitorClient,
) ConsumerdServerOption

Note this accepts an MonitorClient even though consumerd runs outside the cluster.

func WithQueueOptions

func WithQueueOptions(opts ...SplitQueueOption) ConsumerdServerOption

func WithSchedulerClient

func WithSchedulerClient(
	client types.SchedulerClient,
) ConsumerdServerOption

func WithToolchainRunners

func WithToolchainRunners(args ...run.StoreAddFunc) ConsumerdServerOption

type ConsumerdServerOptions

type ConsumerdServerOptions struct {
	// contains filtered or unexported fields
}

func (*ConsumerdServerOptions) Apply

type Entries

type Entries []Entry

func (Entries) Deltas

func (e Entries) Deltas() (entries Entries)

func (Entries) EWMA

func (e Entries) EWMA(halfLife time.Duration) (entries Entries)

func (Entries) Filter

func (e Entries) Filter(include func(Entry) bool) (entries Entries)

func (Entries) LinearRegression

func (e Entries) LinearRegression() (alpha, beta float64)

func (Entries) TimeRange

func (e Entries) TimeRange(begin, end time.Time) Entries

TimeRange returns a sub-slice of all entries where the timestamps of the returned entries are in the range [begin, end). If begin or end are the zero timestamp, they will be set to the timestamp of the first or last entry, respectively.

func (Entries) ToXYs

func (e Entries) ToXYs() (xys plotter.XYs)

type Entry

type Entry struct {
	X    time.Time
	Y    float64
	Kind EntryKind
}

type EntryKind

type EntryKind int
const (
	Invalid EntryKind = iota
	CompletedTasksLocal
	CompletedTasksRemote
	RunningTasks
	QueuedTasks
	DelegatedTasks
)

type NoRemoteUsageManager

type NoRemoteUsageManager struct{}

func (NoRemoteUsageManager) Manage

type SplitQueue

type SplitQueue struct {
	*util.PauseController
	// contains filtered or unexported fields
}

func NewSplitQueue

func NewSplitQueue(
	ctx context.Context,
	monClient types.MonitorClient,
	opts ...SplitQueueOption,
) *SplitQueue

func (*SplitQueue) CompleteDelegatedTasksCompleted

func (sq *SplitQueue) CompleteDelegatedTasksCompleted(m *metrics.DelegatedTasksCompleted)

func (*SplitQueue) CompleteLocalTasksCompleted

func (sq *SplitQueue) CompleteLocalTasksCompleted(m *metrics.LocalTasksCompleted)

func (*SplitQueue) CompleteTaskStatus

func (sq *SplitQueue) CompleteTaskStatus(m *metrics.TaskStatus)

func (*SplitQueue) CompleteUsageLimits

func (sq *SplitQueue) CompleteUsageLimits(m *metrics.UsageLimits)

func (*SplitQueue) Exec

func (sq *SplitQueue) Exec(task run.Task) error

func (*SplitQueue) Telemetry

func (sq *SplitQueue) Telemetry() *Telemetry

type SplitQueueOption

type SplitQueueOption func(*SplitQueueOptions)

func WithBufferSize

func WithBufferSize(sz int) SplitQueueOption

func WithLocalUsageManager

func WithLocalUsageManager(rm run.ResizerManager) SplitQueueOption

func WithRemoteUsageManager

func WithRemoteUsageManager(rm run.ResizerManager) SplitQueueOption

func WithTelemetryConfig

func WithTelemetryConfig(cfg TelemetryConfig) SplitQueueOption

type SplitQueueOptions

type SplitQueueOptions struct {
	// contains filtered or unexported fields
}

func (*SplitQueueOptions) Apply

func (o *SplitQueueOptions) Apply(opts ...SplitQueueOption)

type SplitTask

type SplitTask struct {
	Local       run.PackagedRequest
	Remote      run.PackagedRequest
	Exclusivity SplitTaskLocation
	// contains filtered or unexported fields
}

func (*SplitTask) Err

func (*SplitTask) Err() error

func (*SplitTask) Run

func (*SplitTask) Run()

func (*SplitTask) Wait

func (st *SplitTask) Wait() (interface{}, error)

func (*SplitTask) Which

func (st *SplitTask) Which() SplitTaskLocation

type SplitTaskLocation

type SplitTaskLocation int
const (
	Unknown SplitTaskLocation = iota
	Local
	Remote
)

type Telemetry

type Telemetry struct {
	// contains filtered or unexported fields
}

Telemetry stores sampled data from the consumerd split queue. Consumerd telemetry is of particular importance due to the performance impact of balancing local and remote tasks. It is important to be able to log and visualize the state of the consumerd queue to ensure it is performing correctly and to help identify slowdowns, contention, etc. Operations on the Telemetry object are thread-safe.

func (*Telemetry) Clear

func (t *Telemetry) Clear()

func (*Telemetry) Entries

func (t *Telemetry) Entries() (entries Entries)

Entries returns a slice of all the entries currently in the history buffer.

func (*Telemetry) RecordEntry

func (t *Telemetry) RecordEntry(i Entry)

func (*Telemetry) StartRecording

func (t *Telemetry) StartRecording()

func (*Telemetry) StopRecording

func (t *Telemetry) StopRecording()

type TelemetryConfig

type TelemetryConfig struct {
	Enabled        bool
	RecordInterval time.Duration
	HistoryLen     int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL