Documentation ¶
Index ¶
- func RunLoadtest(configs ...LoadTestConfig)
- type Endpoint
- type EndpointOption
- type EndpointOptions
- type EndpointRandomizer
- type EndpointResult
- type EndpointResults
- type LoadTest
- type LoadTestConfig
- func WithContextModifier(fn func(ctx context.Context) context.Context) LoadTestConfig
- func WithDefaultEndpointTimeout(timeout time.Duration) LoadTestConfig
- func WithDuration(loadTestDuration time.Duration) LoadTestConfig
- func WithEndpoints(endpoints ...Endpoint) LoadTestConfig
- func WithRPMStrategy(strategy RPMStrategy) LoadTestConfig
- func WithRampUpRPM(steps []Step) LoadTestConfig
- func WithRequestsPerMinuteForEndpoints(data map[string]int32) LoadTestConfig
- func WithStaticRPM(rpm int32) LoadTestConfig
- type LoadTestOptions
- type LoadTestResults
- type RPMStrategy
- type RampUpRPMStrategy
- type StaticRPMStrategy
- type Step
- type UI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunLoadtest ¶
func RunLoadtest(configs ...LoadTestConfig)
Types ¶
type Endpoint ¶
type Endpoint interface { // Do performs one request and is executed in a separate goroutine. // The context is used to cancel the request on timeout. Execute(ctx context.Context) error Name() string Options() *EndpointOptions }
func NewEndpoint ¶
type EndpointOption ¶
type EndpointOption func(options *EndpointOptions)
func WithRequestsPerMinute ¶
func WithRequestsPerMinute(requestsPerMinute int32) EndpointOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) EndpointOption
type EndpointOptions ¶
func (*EndpointOptions) Apply ¶
func (options *EndpointOptions) Apply(opts ...EndpointOption)
type EndpointRandomizer ¶
type EndpointRandomizer struct {
// contains filtered or unexported fields
}
func NewEndpointRandomizer ¶
func NewEndpointRandomizer(endpoints []Endpoint, overrides map[string]int32) (*EndpointRandomizer, error)
func (*EndpointRandomizer) PickRandomEndpoint ¶
func (r *EndpointRandomizer) PickRandomEndpoint() Endpoint
type EndpointResult ¶
type EndpointResults ¶
type EndpointResults struct { Name string // contains filtered or unexported fields }
func (*EndpointResults) GetAverageDuration ¶
func (e *EndpointResults) GetAverageDuration() float64
func (*EndpointResults) GetTotalFailedRequests ¶
func (e *EndpointResults) GetTotalFailedRequests() uint64
func (*EndpointResults) GetTotalRequests ¶
func (e *EndpointResults) GetTotalRequests() uint64
type LoadTest ¶
type LoadTest struct { UI *UI Options *LoadTestOptions Results *LoadTestResults // contains filtered or unexported fields }
func (*LoadTest) ListenForAbort ¶
func (loadtest *LoadTest) ListenForAbort()
func (*LoadTest) WaitForLoadTestEnd ¶
func (loadtest *LoadTest) WaitForLoadTestEnd()
type LoadTestConfig ¶
type LoadTestConfig func(options *LoadTestOptions)
func WithContextModifier ¶
func WithContextModifier(fn func(ctx context.Context) context.Context) LoadTestConfig
func WithDefaultEndpointTimeout ¶
func WithDefaultEndpointTimeout(timeout time.Duration) LoadTestConfig
func WithDuration ¶
func WithDuration(loadTestDuration time.Duration) LoadTestConfig
func WithEndpoints ¶
func WithEndpoints(endpoints ...Endpoint) LoadTestConfig
func WithRPMStrategy ¶
func WithRPMStrategy(strategy RPMStrategy) LoadTestConfig
func WithRampUpRPM ¶
func WithRampUpRPM(steps []Step) LoadTestConfig
func WithRequestsPerMinuteForEndpoints ¶
func WithRequestsPerMinuteForEndpoints(data map[string]int32) LoadTestConfig
func WithStaticRPM ¶
func WithStaticRPM(rpm int32) LoadTestConfig
type LoadTestOptions ¶
type LoadTestOptions struct { Endpoints []Endpoint // A config which allows to set the requests per minute for each registered endpoint at a central place // // This overrides any local endpoint setting where a default RPM value was set RequestPerMinutePerEndpoint map[string]int32 DefaultEndpointTimeout time.Duration LoadTestDuration time.Duration RPMStrategy RPMStrategy ContextModifiers []func(ctx context.Context) context.Context }
type LoadTestResults ¶
type LoadTestResults struct {
// contains filtered or unexported fields
}
func NewResults ¶
func NewResults(endpoints []Endpoint) *LoadTestResults
func (*LoadTestResults) Iter ¶
func (results *LoadTestResults) Iter() []*EndpointResults
func (*LoadTestResults) SaveEndpointResult ¶
func (results *LoadTestResults) SaveEndpointResult(Endpoint Endpoint, result EndpointResult)
type RPMStrategy ¶
An RPM strategy defines how many requests per minute will be sent to the target.
The GetRPMForMinute function will be called every minute and the loadtest will be adjusted as such.
func NewRampUpRPMStrategy ¶
func NewRampUpRPMStrategy(steps []Step) RPMStrategy
func NewStaticRPMStrategy ¶
func NewStaticRPMStrategy(rpm int32) RPMStrategy
type RampUpRPMStrategy ¶
type RampUpRPMStrategy struct {
// contains filtered or unexported fields
}
func (*RampUpRPMStrategy) GetRPMForMinute ¶
func (strategy *RampUpRPMStrategy) GetRPMForMinute(minute int32) int32
type StaticRPMStrategy ¶
type StaticRPMStrategy struct {
// contains filtered or unexported fields
}
A static rpm strategy which outputs a constant request number to the target.
func (*StaticRPMStrategy) GetRPMForMinute ¶
func (strategy *StaticRPMStrategy) GetRPMForMinute(minute int32) int32
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
func (*UI) PrintAbortMessage ¶
func (ui *UI) PrintAbortMessage()
func (*UI) PrintStartMessage ¶
func (ui *UI) PrintStartMessage()
func (*UI) ReportDecreaseInRPM ¶
func (*UI) ReportIncreaseInRPM ¶
func (*UI) ReportInitialRPM ¶
func (*UI) ReportResults ¶
func (ui *UI) ReportResults(results *LoadTestResults)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.