ct_autoscaler

package
v0.0.0-...-fcfcbe3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MIN_CT_INSTANCE_NUM = 1
	MAX_CT_INSTANCE_NUM = 500
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CTAutoscaler

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

The CTAutoscaler is a CT friendly wrapper around autoscaler.Autoscaller It does the following:

  • Automatically brings up all CT GCE instances when a GCE task is registered and no other GCE tasks are running.
  • Automatically brings down all CT GCE instances when there are no registered GCE tasks.

func NewCTAutoscaler

func NewCTAutoscaler(ctx context.Context, local bool, getGCETasksCount func(ctx context.Context) (int, error)) (*CTAutoscaler, error)

NewCTAutoscaler returns a CT Autoscaler instance. getGCETasksCount refers to a function that returns the number of GCE CT tasks (not swarming tasks).

func (*CTAutoscaler) RegisterGCETask

func (c *CTAutoscaler) RegisterGCETask(taskId string)

type ICTAutoscaler

type ICTAutoscaler interface {
	RegisterGCETask(taskId string)
}

Interface useful for mocking.

type MockCTAutoscaler

type MockCTAutoscaler struct {
	RegisterGCETaskTimesCalled int
}

func (*MockCTAutoscaler) RegisterGCETask

func (m *MockCTAutoscaler) RegisterGCETask(taskId string)

Jump to

Keyboard shortcuts

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