Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrConnection is returned when the Requester fails to connect to // the requested URL. ErrConnection = errors.New("connection error") // ErrCanceled is returned when the Requester.Run context is canceled. ErrCanceled = errors.New("canceled") )
Functions ¶
This section is empty.
Types ¶
type Benchmark ¶ added in v1.0.0
type Benchmark struct { Records []Record `json:"records"` Length int `json:"length"` Success int `json:"success"` Fail int `json:"fail"` Duration time.Duration `json:"duration"` }
Benchmark represents the collected results of a benchmark test.
type Config ¶
type Config struct { Requests int Concurrency int Interval time.Duration RequestTimeout time.Duration GlobalTimeout time.Duration Silent bool }
Config is the requester config that determines its behavior.
type Record ¶
type Record struct { Time time.Duration `json:"time"` Code int `json:"code"` Bytes int `json:"bytes"` Error string `json:"error,omitempty"` Events []Event `json:"events"` }
Record is the summary of a HTTP response. If Record.Error is not empty string, the HTTP call failed somewhere between sending the request to decoding the response body. In that cas invalidating the entire response, as it is not a remote server error.
Click to show internal directories.
Click to hide internal directories.