locust

package
v0.0.0-...-d5bad45 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRequireMinOneDistributedPod spec requires 1 or more DistributedPods
	ErrRequireMinOneDistributedPod = errors.New("LoadTest must specify 1 or more DistributedPods")
	// ErrRequireTestFile the TestFile filed is required to not be an empty string
	ErrRequireTestFile = errors.New("LoadTest TestFile is required")
)

Functions

This section is empty.

Types

type Backend

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

Backend is the Locust implementation of backend interface

func (*Backend) GetEnvConfig

func (b *Backend) GetEnvConfig() interface{}

GetEnvConfig must return config struct pointer

func (*Backend) SetDefaults

func (b *Backend) SetDefaults()

SetDefaults must set default values

func (*Backend) SetKubeClientSet

func (b *Backend) SetKubeClientSet(kubeClientSet kubernetes.Interface)

SetKubeClientSet receives a copy of kubeClientSet

func (*Backend) SetLogger

func (b *Backend) SetLogger(logger *zap.Logger)

SetLogger receives a copy of logger

func (*Backend) SetPodAnnotations

func (b *Backend) SetPodAnnotations(podAnnotations map[string]string)

SetPodAnnotations receives a copy of pod annotations

func (*Backend) SetPodNodeSelector

func (b *Backend) SetPodNodeSelector(nodeselector map[string]string)

SetPodNodeSelector receives a copy of pod node selectors

func (*Backend) SetPodTolerations

func (b *Backend) SetPodTolerations(tolerations []coreV1.Toleration)

SetPodTolerations receives a copy of pod tolerations

func (*Backend) Sync

func (b *Backend) Sync(ctx context.Context, loadTest loadTestV1.LoadTest, reportURL string) error

Sync check if Backend kubernetes resources have been create, if they have not been create them

func (*Backend) SyncStatus

func (b *Backend) SyncStatus(ctx context.Context, loadTest loadTestV1.LoadTest, loadTestStatus *loadTestV1.LoadTestStatus) error

SyncStatus check the Backend resources and calculate the current status of the LoadTest from them

func (*Backend) TransformLoadTestSpec

func (b *Backend) TransformLoadTestSpec(spec *loadTestV1.LoadTestSpec) error

TransformLoadTestSpec use given spec to validate and return a new one or error

func (*Backend) Type

Type returns backend type name

type Config

type Config struct {
	Image                string `envconfig:"LOCUST_IMAGE"`
	ImageName            string `envconfig:"LOCUST_IMAGE_NAME" default:"locustio/locust"`
	ImageTag             string `envconfig:"LOCUST_IMAGE_TAG" default:"latest"`
	MasterCPULimits      string `envconfig:"LOCUST_MASTER_CPU_LIMITS"`
	MasterCPURequests    string `envconfig:"LOCUST_MASTER_CPU_REQUESTS"`
	MasterMemoryLimits   string `envconfig:"LOCUST_MASTER_MEMORY_LIMITS"`
	MasterMemoryRequests string `envconfig:"LOCUST_MASTER_MEMORY_REQUESTS"`
	WorkerCPULimits      string `envconfig:"LOCUST_WORKER_CPU_LIMITS"`
	WorkerCPURequests    string `envconfig:"LOCUST_WORKER_CPU_REQUESTS"`
	WorkerMemoryLimits   string `envconfig:"LOCUST_WORKER_MEMORY_LIMITS"`
	WorkerMemoryRequests string `envconfig:"LOCUST_WORKER_MEMORY_REQUESTS"`
}

Config specific to Locust backend

Jump to

Keyboard shortcuts

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