loader

package
v0.0.0-...-095f3d7 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 3

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, err error)

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
	NumRequests int
	NumErrs     int
	ErrMap      map[string]int
	Histogram   *histo.Histogram
}

RequesterStats used for collecting aggregate statistics

Jump to

Keyboard shortcuts

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