Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // TCPURLPrefix is the URL prefix for triggering tcp load. TCPURLPrefix = "tcp://" // TCPStatusOK is the map key on success. TCPStatusOK = "OK" )
Functions ¶
func GeneratePayload ¶
Generates a 24 bytes unique payload for each runner thread and message sent.
Types ¶
type RunnerOptions ¶
type RunnerOptions struct { periodic.RunnerOptions TCPOptions // Need to call Init() to initialize }
RunnerOptions includes the base RunnerOptions plus tcp specific options.
type RunnerResults ¶
type RunnerResults struct { periodic.RunnerResults TCPOptions RetCodes TCPResultMap SocketCount int BytesSent int64 BytesReceived int64 // contains filtered or unexported fields }
RunnerResults is the aggregated result of an TCPRunner. Also is the internal type used per thread/goroutine.
func RunTCPTest ¶
func RunTCPTest(o *RunnerOptions) (*RunnerResults, error)
RunTCPTest runs an tcp test and returns the aggregated stats. Some refactoring to avoid copy-pasta between the now 3 runners would be good.
func (*RunnerResults) Run ¶
func (tcpstate *RunnerResults) Run(t int)
Run tests tcp request fetching. Main call being run at the target QPS. To be set as the Function in RunnerOptions.
type TCPClient ¶
type TCPClient struct {
// contains filtered or unexported fields
}
TCPClient is the client used for tcp echo testing.
func NewTCPClient ¶
func NewTCPClient(o *TCPOptions) (*TCPClient, error)
NewTCPClient creates and initialize and returns a client based on the TCPOptions.
type TCPOptions ¶
type TCPOptions struct { Destination string Payload []byte // what to send (and check) UnixDomainSocket string // Path of unix domain socket to use instead of host:port from URL ReqTimeout time.Duration }
TCPOptions are options to the TCPClient.