loader

package
v0.0.0-...-4858cbb Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	USER_AGENT = "go-wrk"
)

Variables

This section is empty.

Functions

func DoRequest

func DoRequest(httpClient *http.Client, header map[string]string, method, host, loadUrl, reqBody string) (respSize int, duration time.Duration)

DoRequest single request implementation. Returns the size of the response and its duration On error - returns -1 on both

Types

type LoadCfg

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

func NewLoadCfg

func NewLoadCfg(duration int,
	goroutines int,
	testUrl string,
	reqBody string,
	method string,
	host string,
	header map[string]string,
	statsAggregator chan *RequesterStats,
	timeoutms int,
	allowRedirects bool,
	disableCompression bool,
	disableKeepAlive bool,
	skipVerify bool,
	clientCert string,
	clientKey string,
	caCert string,
	http2 bool) (rt *LoadCfg)

func (*LoadCfg) RunSingleLoadSession

func (cfg *LoadCfg) RunSingleLoadSession()

Requester a go function for repeatedly making requests and aggregating statistics as long as required When it is done, it sends the results using the statsAggregator channel

func (*LoadCfg) Stop

func (cfg *LoadCfg) Stop()

type RequesterStats

type RequesterStats struct {
	TotRespSize    int64
	TotDuration    time.Duration
	MinRequestTime time.Duration
	MaxRequestTime time.Duration
	NumRequests    int
	NumErrs        int
}

RequesterStats used for colelcting aggregate statistics

Jump to

Keyboard shortcuts

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