Documentation ¶
Index ¶
- Constants
- Variables
- type Backend
- func (b *Backend) CreatePodsWithTestdata(ctx context.Context, configMaps []*coreV1.ConfigMap, ...) error
- func (b *Backend) GetEnvConfig() interface{}
- func (b *Backend) NewConfigMap(loadTest loadTestV1.LoadTest) *coreV1.ConfigMap
- func (b *Backend) NewJMeterMasterJob(loadTest loadTestV1.LoadTest, reportURL string, ...) *batchV1.Job
- func (b *Backend) NewJMeterService() *coreV1.Service
- func (b *Backend) NewPVC(loadTest loadTestV1.LoadTest) *coreV1.PersistentVolumeClaim
- func (b *Backend) NewPod(loadTest loadTestV1.LoadTest, i int, configMap *coreV1.ConfigMap, ...) *coreV1.Pod
- func (b *Backend) NewSecret(loadTest loadTestV1.LoadTest) (*coreV1.Secret, error)
- func (b *Backend) NewTestdataConfigMap(loadTest loadTestV1.LoadTest) ([]*coreV1.ConfigMap, error)
- func (b *Backend) SetDefaults()
- func (b *Backend) SetKangalClientSet(kangalClientSet clientSetV.Interface)
- func (b *Backend) SetKubeClientSet(kubeClientSet kubernetes.Interface)
- func (b *Backend) SetLogger(logger *zap.Logger)
- func (b *Backend) SetNamespaceLister(namespacesLister coreListersV1.NamespaceLister)
- func (b *Backend) SetPodAnnotations(podAnnotations map[string]string)
- func (b *Backend) SetPodNodeSelector(nodeselector map[string]string)
- func (b *Backend) SetPodTolerations(tolerations []coreV1.Toleration)
- func (b *Backend) Sync(ctx context.Context, loadTest loadTestV1.LoadTest, reportURL string) error
- func (b *Backend) SyncStatus(ctx context.Context, loadTest loadTestV1.LoadTest, ...) error
- func (b *Backend) TransformLoadTestSpec(spec *loadTestV1.LoadTestSpec) error
- func (*Backend) Type() loadTestV1.LoadTestType
- type Config
Constants ¶
const (
// LoadTestLabel label used for JMeter resources
LoadTestLabel = "loadtest"
)
Variables ¶
var ( // MaxWaitTimeForPods is the time we should wait for worker pods to get to a "Running" state MaxWaitTimeForPods = time.Minute * 10 // LoadTestWorkerLabelSelector is the selector used for selecting jmeter worker resources LoadTestWorkerLabelSelector = fmt.Sprintf("%s=%s", loadTestWorkerPodLabelKey, loadTestWorkerPodLabelValue) // ErrRequireMinOneDistributedPod Backend 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 JMeter implementation of backend interface
func (*Backend) CreatePodsWithTestdata ¶
func (b *Backend) CreatePodsWithTestdata(ctx context.Context, configMaps []*coreV1.ConfigMap, loadTest *loadTestV1.LoadTest, namespace string) error
CreatePodsWithTestdata creates workers Pods
func (*Backend) GetEnvConfig ¶
func (b *Backend) GetEnvConfig() interface{}
GetEnvConfig must return config struct pointer
func (*Backend) NewConfigMap ¶
func (b *Backend) NewConfigMap(loadTest loadTestV1.LoadTest) *coreV1.ConfigMap
NewConfigMap creates a new configMap containing loadtest script
func (*Backend) NewJMeterMasterJob ¶
func (b *Backend) NewJMeterMasterJob(loadTest loadTestV1.LoadTest, reportURL string, podAnnotations map[string]string) *batchV1.Job
NewJMeterMasterJob creates a new job which runs the jmeter master pod
func (*Backend) NewJMeterService ¶
NewJMeterService creates a new services to talk to jmeter worker pods
func (*Backend) NewPVC ¶
func (b *Backend) NewPVC(loadTest loadTestV1.LoadTest) *coreV1.PersistentVolumeClaim
NewPVC creates a new pvc for custom data
func (*Backend) NewPod ¶
func (b *Backend) NewPod(loadTest loadTestV1.LoadTest, i int, configMap *coreV1.ConfigMap, podAnnotations map[string]string) *coreV1.Pod
NewPod creates a new pod which mounts a configmap that contains jmeter testdata
func (*Backend) NewTestdataConfigMap ¶
NewTestdataConfigMap creates a new configMap containing testdata
func (*Backend) SetKangalClientSet ¶
func (b *Backend) SetKangalClientSet(kangalClientSet clientSetV.Interface)
SetKangalClientSet receives a copy of kangalClientSet
func (*Backend) SetKubeClientSet ¶
func (b *Backend) SetKubeClientSet(kubeClientSet kubernetes.Interface)
SetKubeClientSet receives a copy of kubeClientSet
func (*Backend) SetNamespaceLister ¶
func (b *Backend) SetNamespaceLister(namespacesLister coreListersV1.NamespaceLister)
SetNamespaceLister receives a copy of namespaceLister
func (*Backend) SetPodAnnotations ¶
SetPodAnnotations receives a copy of pod annotations
func (*Backend) SetPodNodeSelector ¶
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 ¶
Sync check if JMeter 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 JMeter 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 ¶
func (*Backend) Type() loadTestV1.LoadTestType
Type returns backend type name
type Config ¶
type Config struct { MasterImageName string `envconfig:"JMETER_MASTER_IMAGE_NAME" default:"hellofresh/kangal-jmeter-master"` MasterImageTag string `envconfig:"JMETER_MASTER_IMAGE_TAG" default:"latest"` MasterCPULimits string `envconfig:"JMETER_MASTER_CPU_LIMITS"` MasterCPURequests string `envconfig:"JMETER_MASTER_CPU_REQUESTS"` MasterMemoryLimits string `envconfig:"JMETER_MASTER_MEMORY_LIMITS"` MasterMemoryRequests string `envconfig:"JMETER_MASTER_MEMORY_REQUESTS"` WorkerImageName string `envconfig:"JMETER_WORKER_IMAGE_NAME" default:"hellofresh/kangal-jmeter-worker"` WorkerImageTag string `envconfig:"JMETER_WORKER_IMAGE_TAG" default:"latest"` WorkerCPULimits string `envconfig:"JMETER_WORKER_CPU_LIMITS"` WorkerCPURequests string `envconfig:"JMETER_WORKER_CPU_REQUESTS"` WorkerMemoryLimits string `envconfig:"JMETER_WORKER_MEMORY_LIMITS"` WorkerMemoryRequests string `envconfig:"JMETER_WORKER_MEMORY_REQUESTS"` TestDataDecompressImage string `envconfig:"JMETER_TESTDATA_DECOMPRESS_IMAGE" default:"alpine:latest"` RemoteCustomDataImage string `envconfig:"JMETER_WORKER_REMOTE_CUSTOM_DATA_IMAGE" default:"rclone/rclone:latest"` WaitForResourceTimeout time.Duration `envconfig:"WAIT_FOR_RESOURCE_TIMEOUT" default:"30s"` }
Config specific to JMeter backend