utils

package
v1.8.17 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcAvgProcessingTime

func CalcAvgProcessingTime(processes []*core.Process) float64

func CalcAvgWaitingTime

func CalcAvgWaitingTime(processes []*core.Process) float64

func CalcRetries

func CalcRetries(processes []*core.Process) int

func CalcUtilization

func CalcUtilization(processes []*core.Process) float64

This function assumes that the processes are sorted so that the oldest process is at index 0

func Compress

func Compress(rootDir string, src string, buf io.Writer) error

func CreateTestColonyWithKey

func CreateTestColonyWithKey() (*core.Colony, string, error)

func CreateTestExecutor added in v1.0.1

func CreateTestExecutor(colonyName string) *core.Executor

func CreateTestExecutorWithID added in v1.0.1

func CreateTestExecutorWithID(colonyName string, executorID string) *core.Executor

func CreateTestExecutorWithKey added in v1.0.1

func CreateTestExecutorWithKey(colonyName string) (*core.Executor, string, error)

func CreateTestExecutorWithType added in v1.0.1

func CreateTestExecutorWithType(colonyName string, executorType string) *core.Executor

func CreateTestFile added in v1.5.0

func CreateTestFile(colonyName string) *core.File

func CreateTestFileWithID added in v1.5.0

func CreateTestFileWithID(id string, colonyName string, now time.Time) *core.File

func CreateTestFunctionSpec added in v1.0.1

func CreateTestFunctionSpec(colonyName string) *core.FunctionSpec

func CreateTestFunctionSpecWithEnv added in v1.0.1

func CreateTestFunctionSpecWithEnv(colonyID string, env map[string]string) *core.FunctionSpec

func CreateTestFunctionSpecWithTargets added in v1.0.1

func CreateTestFunctionSpecWithTargets(colonyID string, targetExecutorNames []string) *core.FunctionSpec

func CreateTestFunctionSpecWithType added in v1.0.1

func CreateTestFunctionSpecWithType(colonyID string, executorType string) *core.FunctionSpec

func CreateTestProcess

func CreateTestProcess(colonyName string) *core.Process

func CreateTestProcessWithEnv

func CreateTestProcessWithEnv(colonyID string, env map[string]string) *core.Process

func CreateTestProcessWithTargets

func CreateTestProcessWithTargets(colonyID string, targetExecutorNames []string) *core.Process

func CreateTestProcessWithType

func CreateTestProcessWithType(colonyID string, executorType string) *core.Process

func CreateTestUser added in v1.7.0

func CreateTestUser(colonyID string, name string) *core.User

func CreateTestUserWithKey added in v1.7.0

func CreateTestUserWithKey(colonyID string, name string) (*core.User, string, error)

func Decompress

func Decompress(src io.Reader, dst string) error

func FakeCron

func FakeCron(t *testing.T, colonyID string, initiatorID string, initiatorName string) *core.Cron

func FakeGenerator

func FakeGenerator(t *testing.T, colonyID string, initiatorID string, initiatorName string) *core.Generator

func FakeGeneratorSingleProcess

func FakeGeneratorSingleProcess(t *testing.T, colonyID string, initiatorID string, initiatorName string) *core.Generator

func FakeSingleCron

func FakeSingleCron(t *testing.T, colonyID string, initiatorID string, initiatorName string) *core.Cron

func ProgressBar added in v1.7.7

func ProgressBar(trackers int) progress.Writer

Types

type WorkerPool added in v1.7.7

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

func NewWorkerPool added in v1.7.7

func NewWorkerPool(workers int) *WorkerPool

func (*WorkerPool) Call added in v1.7.7

func (pool *WorkerPool) Call(f func(arg interface{}) error, a interface{}) chan error

func (*WorkerPool) Start added in v1.7.7

func (pool *WorkerPool) Start() *WorkerPool

func (*WorkerPool) Stop added in v1.7.7

func (pool *WorkerPool) Stop()

Jump to

Keyboard shortcuts

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