modulepackage
1.0.0
Repository: https://github.com/straightdave/trunks-lib.git
Documentation: pkg.go.dev
# README
trunks-lib
# Functions
Connections returns a functional option which sets the number of maximum idle open connections per target host.
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.
NewAttacker returns a new Attacker with default options which are overridden by the optionally provided opts.
NewBurner creates a new Burner with burner options.
NewCSVEncoder returns an Encoder that dumps the given *Result as a CSV record with six columns.
NewDecoder returns a new Result decoder closure for the given io.Readers.
NewEagerTargeter eagerly reads all Targets out of the provided io.Reader and returns a NewStaticTargeter with them.
NewEncoder returns a new Result encoder closure for the given io.Writer.
NewHistogramReporter returns a Reporter that writes out a Histogram as aligned, formatted text.
NewJSONEncoder returns an Encoder that dumps the given *Results as a JSON object.
NewJSONReporter returns a Reporter that writes out Metrics as JSON.
NewLazyTargeter returns a new Targeter that lazily scans Targets from the provided io.Reader on every invocation.
NewPlotReporter returns a Reporter that writes a self-contained HTML page with an interactive plot of the latencies of Requests, built with http://dygraphs.com/.
NewStaticTargeter returns a Targeter which round-robins over the passed Targets.
NewTextReporter returns a Reporter that writes out Metrics as aligned, formatted text.
NumWorker : Deprecating; use WithNumWorker(uint64).
Redirects returns a functional option which sets the maximum number of redirects an Attacker will follow.
RespondTo ...
Timeout returns a functional option which sets the maximum amount of time an Attacker will wait for a request to be responded to.
TLSConfig returns a functional option which sets the *tls.Config for a Attacker to use with its requests.
WithDumpFile ...
WithLoop : Deprecating; use WithLooping(bool).
WithLooping ...
WithMaxRecvSize ...
WithMaxSendSize ...
WithMetadata ...
WithNumConnPerHost ...
WithNumWorker ...
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.
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.
NoFollow is the value when redirects are not followed but marked successful.
# 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.
ErrNoTargets is returned when not enough Targets are available.
# Structs
Attacker is an attack executor which wraps an http.Client.
Burner is who runs the stress test against Gtargets.
No description provided by the author
Gtarget represents an attack target i.e one gRPC endpoint.
Histogram is a bucketed latency Histogram.
No description provided by the author
No description provided by the author
Result represents the metrics defined out of an http.Response generated by each target hit.
Target is an HTTP request blueprint.
# Type aliases
Buckets represents an Histogram's latency buckets.
BurnOpt ...
A Decoder decodes a Result and returns an error in case of failure.
An Encoder encodes a Result and returns an error in case of failure.
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 Targeter decodes a Target or returns an error in case of failure.