Documentation ¶
Index ¶
- Variables
- type Client
- type Option
- func WithAdvertiseHosts(hosts []string) Option
- func WithExternalProcess() Option
- func WithNoChecking() Option
- func WithNoDurations() Option
- func WithNoLibrary() Option
- func WithNumClients(numClients int) Option
- func WithRequestSize(reqSize int) Option
- func WithServiceName(svcName string) Option
- func WithTimeout(timeout time.Duration) Option
- type Relay
- type Server
Constants ¶
This section is empty.
Variables ¶
var BenchmarkDir = "./"
BenchmarkDir should be set to the benchmark source directory.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Warmup will create connections to all host:ports the client was created with. Warmup() error // RawCall makes an echo call using raw. RawCall(n int) ([]time.Duration, error) // ThriftCall makes an echo call using thrift. ThriftCall(n int) ([]time.Duration, error) // Close closes the benchmark client. Close() }
Client is a benchmark client that can be used to call a benchmark server.
type Option ¶
type Option func(*options)
Option represents a Benchmark option.
func WithAdvertiseHosts ¶
WithAdvertiseHosts sets the hosts to advertise with on startup.
func WithExternalProcess ¶
func WithExternalProcess() Option
WithExternalProcess creates a separate process to host the server/client.
func WithNoChecking ¶
func WithNoChecking() Option
WithNoChecking disables result verification on the client side, which may slow down the client (as it compares all request bytes against the response bytes).
func WithNoDurations ¶
func WithNoDurations() Option
WithNoDurations disables printing of latencies to standard out.
func WithNoLibrary ¶
func WithNoLibrary() Option
WithNoLibrary uses the fast TCP-template based approach for generating TChannel frames rather than the TChannel client library.
func WithNumClients ¶
WithNumClients sets the number of concurrent TChannel clients to use internally under a single benchmark.Client. This is used to generate generate a large amount of traffic, as a single TChannel client will not saturate a CPU since it will spend most of the time blocking and waiting for the remote side to respond.
func WithRequestSize ¶
WithRequestSize sets the request size for each call.
func WithServiceName ¶
WithServiceName sets the service name of the benchmark server.
func WithTimeout ¶
WithTimeout sets the timeout to use for each call.
type Relay ¶
type Relay interface { // HostPort is the host:port that the relay is listening on. HostPort() string // Close clsoes the relay. Close() }
Relay represents a relay for benchmarking.
func NewRealRelay ¶
NewRealRelay creates a TChannel relay.
func NewTCPFrameRelay ¶
func NewTCPFrameRelay(dests []string, modifier func(bool, *tchannel.Frame) *tchannel.Frame) (Relay, error)
NewTCPFrameRelay relays frames from one connection to another. It reads and writes frames using the TChannel frame functions.
func NewTCPRawRelay ¶
NewTCPRawRelay creates a relay that just pipes data from one connection to another directly.
type Server ¶
type Server interface { // HostPort returns the HostPort that the server is listening on. HostPort() string // Close closes the benchmark server. Close() // RawCalls returns the number of raw calls the server has received. RawCalls() int // ThriftCalls returns the number of Thrift calls the server has received. ThriftCalls() int }
Server is a benchmark server that can receive requests.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
benchclient is used to make requests to a specific server.
|
benchclient is used to make requests to a specific server. |
benchserver is used to receive requests for benchmarks.
|
benchserver is used to receive requests for benchmarks. |