load

package
v0.0.0-...-e486170 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateResult

type AggregateResult struct {
	NumCalls           int64
	TotalBytesReceived int64
	TotalLatency       time.Duration
	MaxLatency         time.Duration
	MinLatency         time.Duration
}

AggregateResult provides the aggregate result data for a set of fetches.

type ResultWithValidity

type ResultWithValidity struct {
	Successes AggregateResult
	Failures  AggregateResult
}

ResultWithValidity provides separate results for sucessful and failed fetches.

type StressResult

type StressResult struct {
	ResultsByUrl map[string]*ResultWithValidity
}

StressResult returns the results of a stress test.

func (*StressResult) String

func (r *StressResult) String() string

String pretty-prints the key StressResult data per URL as a table.

func (*StressResult) Summary

func (r *StressResult) Summary() ResultWithValidity

Summary provides the summary results over all URLs.

func (*StressResult) SummaryString

func (r *StressResult) SummaryString() string

SummaryString provides aggregate statistics as a string.

type Tester

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

Tester tests some URLs, performing basic validation as it goes.

func NewTester

func NewTester(maxConcurrency int) *Tester

NewTester constructs a new tester object.

func (*Tester) Init

func (t *Tester) Init(urls []string) error

Init prepares this tester to stress test the given URLs.

func (*Tester) Stress

func (t *Tester) Stress(ctx context.Context, concurrency int) (*StressResult, error)

Stress tests the urls in this tester by sending concurrent requests until the given context is canceled.

Jump to

Keyboard shortcuts

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