Documentation ¶
Index ¶
Constants ¶
View Source
const (
USER_AGENT = "go-wrk"
)
Variables ¶
View Source
var Id int64
Functions ¶
func DoRequest ¶
func DoRequest(httpClient *http.Client, header map[string]string, method, host, loadUrl, reqBody string, script *ScriptContext) (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 Config ¶
type Config struct { Duration int `json:"duration"` //seconds Goroutines int `json:"goroutines"` Timeoutms int `json:"timeoutms"` AllowRedirects bool `json:"redir"` DisableCompression bool `json:"no_comp"` DisableKeepAlive bool `json:"no_keepalive"` SkipVerify bool `json:"skip_verify"` ClientCert string `json:"client_cert"` ClientKey string `json:"client_key"` CaCert string `json:"ca_cert"` Http2 bool `json:"http2"` RequestConfig Id int64 `json:"id"` }
type RequestConfig ¶
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
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func NewRunner ¶
func NewRunner(cfg Config, statsAggregater chan *RequesterStats) *Runner
func (*Runner) RunSingleSession ¶
func (runner *Runner) RunSingleSession(script *ScriptContext)
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
type ScriptContext ¶
type ScriptContext struct { Config Config // contains filtered or unexported fields }
func LoadScript ¶
func LoadScript(cfg Config, fn string) (*ScriptContext, error)
Click to show internal directories.
Click to hide internal directories.