executor

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientSet

type ClientSet struct {
	Plugin  PluginInterface
	NeonVM  NeonVMInterface
	Monitor MonitorInterface
}

type Config

type Config struct {
	// OnNextActions is called each time the ExecutorCore calls (*core.State).NextActions() on the
	// inner state object.
	//
	// In practice, this value is set to a callback that increments a metric.
	OnNextActions func()

	Core core.Config
}

type ExecutorCore

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

func NewExecutorCore

func NewExecutorCore(stateLogger *zap.Logger, vm api.VmInfo, config Config) *ExecutorCore

func (*ExecutorCore) DoSleeper

func (c *ExecutorCore) DoSleeper(ctx context.Context, logger *zap.Logger)

func (*ExecutorCore) StateDump

func (c *ExecutorCore) StateDump() StateDump

StateDump copies and returns the current state inside the executor

func (*ExecutorCore) Updater

func (c *ExecutorCore) Updater() ExecutorCoreUpdater

Updater returns a handle on the object used for making external changes to the ExecutorCore, beyond what's provided by the various client (ish) interfaces

func (*ExecutorCore) WithClients

func (c *ExecutorCore) WithClients(clients ClientSet) ExecutorCoreWithClients

type ExecutorCoreUpdater

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

ExecutorCoreUpdater provides a common interface for external changes to the ExecutorCore

func (ExecutorCoreUpdater) MonitorActive

func (c ExecutorCoreUpdater) MonitorActive(active bool, withLock func())

MonitorActive calls (*core.State).Monitor().Active(...) on the inner core.State and runs withLock while holding the lock.

func (ExecutorCoreUpdater) ResetMonitor

func (c ExecutorCoreUpdater) ResetMonitor(withLock func())

ResetMonitor calls (*core.State).Monitor().Reset() on the inner core.State and runs withLock while holding the lock.

func (ExecutorCoreUpdater) UpdateLFCMetrics added in v0.31.0

func (c ExecutorCoreUpdater) UpdateLFCMetrics(metrics core.LFCMetrics, withLock func())

UpdateLFCMetrics calls (*core.State).UpdateLFCMetrics() on the inner core.State and runs withLock while holding the lock.

func (ExecutorCoreUpdater) UpdateSystemMetrics added in v0.31.0

func (c ExecutorCoreUpdater) UpdateSystemMetrics(metrics core.SystemMetrics, withLock func())

UpdateSystemMetrics calls (*core.State).UpdateSystemMetrics() on the inner core.State and runs withLock while holding the lock.

func (ExecutorCoreUpdater) UpdatedVM

func (c ExecutorCoreUpdater) UpdatedVM(vm api.VmInfo, withLock func())

UpdatedVM calls (*core.State).UpdatedVM() on the inner core.State and runs withLock while holding the lock.

func (ExecutorCoreUpdater) UpscaleRequested

func (c ExecutorCoreUpdater) UpscaleRequested(resources api.MoreResources, withLock func())

UpscaleRequested calls (*core.State).Monitor().UpscaleRequested(...) on the inner core.State and runs withLock while holding the lock.

type ExecutorCoreWithClients

type ExecutorCoreWithClients struct {
	*ExecutorCore
	// contains filtered or unexported fields
}

ExecutorCoreWithClients wraps ExecutorCore with the various

func (*ExecutorCoreWithClients) DoMonitorDownscales

func (c *ExecutorCoreWithClients) DoMonitorDownscales(ctx context.Context, logger *zap.Logger)

func (*ExecutorCoreWithClients) DoMonitorUpscales

func (c *ExecutorCoreWithClients) DoMonitorUpscales(ctx context.Context, logger *zap.Logger)

func (*ExecutorCoreWithClients) DoNeonVMRequests

func (c *ExecutorCoreWithClients) DoNeonVMRequests(ctx context.Context, logger *zap.Logger)

func (*ExecutorCoreWithClients) DoPluginRequests

func (c *ExecutorCoreWithClients) DoPluginRequests(ctx context.Context, logger *zap.Logger)

type GenerationNumber

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

type MonitorHandle

type MonitorHandle interface {
	Generation() GenerationNumber
	Downscale(_ context.Context, _ *zap.Logger, current, target api.Resources) (*api.DownscaleResult, error)
	Upscale(_ context.Context, _ *zap.Logger, current, target api.Resources) error
}

type MonitorInterface

type MonitorInterface interface {
	CurrentGeneration() GenerationNumber
	// GetHandle fetches a stable handle for the current monitor, or nil if there is not one.
	// This method MUST NOT be called unless holding the executor's lock.
	GetHandle() MonitorHandle
}

type NeonVMInterface

type NeonVMInterface interface {
	Request(
		_ context.Context,
		_ *zap.Logger,
		current, target api.Resources,
		targetRevision vmv1.RevisionWithTime,
	) error
}

type PluginInterface

type PluginInterface interface {
	Request(_ context.Context, _ *zap.Logger, lastPermit *api.Resources, target api.Resources, _ *api.Metrics) (*api.PluginResponse, error)
}

type StateDump

type StateDump = core.StateDump

may change in the future

type StoredGenerationNumber

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

func NewStoredGenerationNumber

func NewStoredGenerationNumber() *StoredGenerationNumber

func (*StoredGenerationNumber) Get

Get fetches the current value of the stored GenerationNumber

func (*StoredGenerationNumber) Inc

Inc increments the stored GenerationNumber, returning the new value

Jump to

Keyboard shortcuts

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