loadtester

package
v0.0.0-...-662d0f3 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const TaskTypeNGrinder = "ngrinder"
View Source
const TaskTypeShell = "cmd"

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(port string, timeout time.Duration, logger *zap.SugaredLogger, taskRunner *TaskRunner, stopCh <-chan struct{})

ListenAndServe starts a web server and waits for SIGTERM

Types

type CmdTask

type CmdTask struct {
	TaskBase
	// contains filtered or unexported fields
}

func (*CmdTask) Hash

func (task *CmdTask) Hash() string

func (*CmdTask) Run

func (task *CmdTask) Run(ctx context.Context) bool

func (*CmdTask) String

func (task *CmdTask) String() string

type NGrinderTask

type NGrinderTask struct {
	TaskBase
	// contains filtered or unexported fields
}

func (*NGrinderTask) CloneAndStartEndpoint

func (task *NGrinderTask) CloneAndStartEndpoint() *url.URL

nGrinder REST endpoints

func (*NGrinderTask) Hash

func (task *NGrinderTask) Hash() string

func (*NGrinderTask) PollStatus

func (task *NGrinderTask) PollStatus(ctx context.Context) bool

polling execution status of the new test and check if finished

func (*NGrinderTask) Run

func (task *NGrinderTask) Run(ctx context.Context) bool

initiate a clone_and_start request and get new test id from response

func (*NGrinderTask) StatusEndpoint

func (task *NGrinderTask) StatusEndpoint() *url.URL

func (*NGrinderTask) StopEndpoint

func (task *NGrinderTask) StopEndpoint() *url.URL

func (*NGrinderTask) String

func (task *NGrinderTask) String() string

type Task

type Task interface {
	Hash() string
	Run(ctx context.Context) bool
	String() string
	Canary() string
}

Modeling a loadtester task

type TaskBase

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

func (*TaskBase) Canary

func (task *TaskBase) Canary() string

type TaskFactory

type TaskFactory = func(metadata map[string]string, canary string, logger *zap.SugaredLogger) (Task, error)

func GetTaskFactory

func GetTaskFactory(typ string) (TaskFactory, bool)

type TaskRunner

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

func NewTaskRunner

func NewTaskRunner(logger *zap.SugaredLogger, timeout time.Duration) *TaskRunner

func (*TaskRunner) Add

func (tr *TaskRunner) Add(task Task)

func (*TaskRunner) GetTotalExecs

func (tr *TaskRunner) GetTotalExecs() uint64

func (*TaskRunner) Start

func (tr *TaskRunner) Start(interval time.Duration, stopCh <-chan struct{})

Jump to

Keyboard shortcuts

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