# Functions
ChunkedBody returns a functional option which makes the attacker send the body of each request with the chunked transfer encoding.
Client returns a functional option that allows you to bring your own http.Client.
Connections returns a functional option which sets the number of maximum idle open connections per target host.
DecoderFor automatically detects the encoding of the first few bytes in the given io.Reader and then returns the corresponding Decoder or nil in case of failing to detect a supported encoding.
H2C returns a functional option which enables H2C support on requests performed by an Attacker.
HTTP2 returns a functional option which enables or disables HTTP/2 support on requests performed by an Attacker.
KeepAlive returns a functional option which toggles KeepAlive connections on the dialer and transport.
LocalAddr returns a functional option which sets the local address an Attacker will use with its requests.
MaxBody returns a functional option which limits the max number of bytes read from response bodies.
MaxConnections returns a functional option which sets the number of maximum connections per target host.
MaxWorkers returns a functional option which sets the maximum number of workers an Attacker can use to hit its targets.
NewAttacker returns a new Attacker with default options which are overridden by the optionally provided opts.
NewCSVDecoder returns a Decoder that decodes CSV encoded Results.
NewCSVEncoder returns an Encoder that dumps the given *Result as a CSV record.
NewDecoder returns a new gob Decoder for the given io.Reader.
NewEncoder returns a new Result encoder closure for the given io.Writer.
NewHDRHistogramPlotReporter returns a Reporter that writes out latency metrics in a format plottable by http://hdrhistogram.github.io/HdrHistogram/plotFiles.html.
NewHistogramReporter returns a Reporter that writes out a Histogram as aligned, formatted text.
NewHTTPTargeter returns a new Targeter that decodes one Target from the given io.Reader on every invocation.
NewJSONDecoder returns a Decoder that decodes JSON encoded Results.
NewJSONEncoder returns an Encoder that dumps the given *Results as a JSON object.
NewJSONReporter returns a Reporter that writes out Metrics as JSON.
NewJSONTargetEncoder returns a TargetEncoder that encods Targets in the JSON format.
NewJSONTargeter returns a new targeter that decodes one Target from the given io.Reader on every invocation.
NewRoundRobinDecoder returns a new Decoder that round robins across the given Decoders on every invocation or decoding error.
NewStaticTargeter returns a Targeter which round-robins over the passed Targets.
NewTextReporter returns a Reporter that writes out Metrics as aligned, formatted text.
Proxy returns a functional option which sets the `Proxy` field on the http.Client's Transport.
ProxyHeader returns a functional option that allows you to add your own Proxy CONNECT headers.
ReadAllTargets eagerly reads all Targets out of the provided Targeter.
Redirects returns a functional option which sets the maximum number of redirects an Attacker will follow.
Timeout returns a functional option which sets the maximum amount of time an Attacker will wait for a request to be responded to and completely read.
TLSConfig returns a functional option which sets the *tls.Config for a Attacker to use with its requests.
UnixSocket changes the dialer for the attacker to use the specified unix socket file.
Workers returns a functional option which sets the initial number of workers an Attacker uses to hit its targets.
# Constants
DefaultConnections is the default amount of max open idle connections per target host.
DefaultMaxBody is the default max number of bytes to be read from response bodies.
DefaultMaxConnections is the default amount of connections per target host.
DefaultMaxWorkers is the default maximum number of workers used to carry an attack.
DefaultRedirects is the default number of times an Attacker follows redirects.
DefaultTimeout is the default amount of time an Attacker waits for a request before it times out.
DefaultWorkers is the default initial number of workers used to carry an attack.
HTTPTargetFormat is the human readable identifier for the HTTP target format.
JSONTargetFormat is the human readable identifier for the JSON target format.
MeanDown is a SinePacer Offset that causes the attack to start at the Mean attack rate and decrease towards the trough.
MeanUp is a SinePacer Offset that causes the attack to start at the Mean attack rate and increase towards the peak.
NoFollow is the value when redirects are not followed but marked successful.
Peak is a SinePacer Offset that causes the attack to start at the peak (maximum) attack rate and decrease towards the Mean.
Trough is a SinePacer Offset that causes the attack to start at the trough (minimum) attack rate and increase towards the Mean.
# Variables
DefaultLocalAddr is the default local IP address an Attacker uses.
DefaultTLSConfig is the default tls.Config an Attacker uses.
ErrNilTarget is returned when the passed Target pointer is nil.
ErrNoMethod is returned by JSONTargeter when a parsed Target has no method.
ErrNoTargets is returned when not enough Targets are available.
ErrNoURL is returned by JSONTargeter when a parsed Target has no URL.
TargetFormats contains the canonical list of the valid target format identifiers.
# Structs
Attacker is an attack executor which wraps an http.Client.
ByteMetrics holds computed byte flow metrics.
A ConstantPacer defines a constant rate of hits for the target.
Histogram is a bucketed latency Histogram.
LatencyMetrics holds computed request latency metrics.
LinearPacer paces an attack by starting at a given request rate and increasing linearly with the given slope.
Metrics holds metrics computed out of a slice of Results which are used in some of the Reporters.
Result contains the results of a single Target hit.
SinePacer is a Pacer that describes attack request rates with the equation: R = MA sin(O+(2𝛑/P)t) Where: R = Instantaneous attack rate at elapsed time t, hits per nanosecond M = Mean attack rate over period P, sp.Mean, hits per nanosecond A = Amplitude of sine wave, sp.Amp, hits per nanosecond O = Offset of sine wave, sp.StartAt, radians P = Period of sine wave, sp.Period, nanoseconds t = Elapsed time since attack start, nanoseconds
Many thanks to http://ascii.co.uk/art/sine and "sps" for the ascii here :-)
Mean -| ,-'''-.
Target is an HTTP request blueprint.
# Type aliases
Buckets represents an Histogram's latency buckets.
A Decoder decodes a Result and returns an error in case of failure.
A DecoderFactory constructs a new Decoder from a given io.Reader.
An Encoder encodes a Result and returns an error in case of failure.
A PacerFunc is a function adapter type that implements the Pacer interface.
Rate is a type alias for ConstantPacer for backwards-compatibility.
A Reporter function writes out reports to the given io.Writer or returns an error in case of failure.
Results is a slice of Result type elements.
A TargetEncoder encodes a Target in a format that can be read by a Targeter.
A Targeter decodes a Target or returns an error in case of failure.