Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultRedirects is the default number of times an Attacker follows // redirects. DefaultRedirects = 10 // DefaultTimeout is the default amount of time an Attacker waits for a request // before it times out. DefaultTimeout = 30 * time.Second // DefaultConnections is the default amount of max open idle connections per // target host. DefaultConnections = 10000 // DefaultMaxConnections is the default amount of connections per target // host. DefaultMaxConnections = 0 // DefaultWorkers is the default initial number of workers used to carry an attack. DefaultWorkers = 10 // DefaultMaxWorkers is the default maximum number of workers used to carry an attack. DefaultMaxWorkers = math.MaxUint64 // DefaultMaxBody is the default max number of bytes to be read from response bodies. // Defaults to no limit. DefaultMaxBody = int64(-1) // NoFollow is the value when redirects are not followed but marked successful NoFollow = -1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attacker ¶
type Attacker struct { RequestFunc func(interface{}) (ResponseData, error) RequestData []interface{} Targeter Targeter // contains filtered or unexported fields }
TODO stolen straight outta Vegeta. Probably need to clean up some vestigial fields ... e.g. redirects?
func NewAttacker ¶
func NewAttacker() *Attacker
func (*Attacker) AddRequestData ¶
func (a *Attacker) AddRequestData(thing interface{})
func (*Attacker) Attack ¶
Attack reads its Targets from the passed Targeter and attacks them at the rate specified by the Pacer. When the duration is zero the attack runs until Stop is called. Results are sent to the returned channel as soon as they arrive and will have their Attack field set to the given name.
type ResponseData ¶
type Targeter ¶
type Targeter func(*interface{}) error
Targeting, or how to get the RequestData into the RequestFunc for the attack.
func NewStaticTargeter ¶
func NewStaticTargeter(tgts ...interface{}) Targeter
type YMetrics ¶
type YMetrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
Define your own set of success codes
func NewMetricsWithDefaults ¶
func NewMetricsWithDefaults() *YMetrics
Default is 0 = success, everything else is failure.
Click to show internal directories.
Click to hide internal directories.