stress

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StressDesc rpc.InterfaceDesc = descStress

StressDesc describes the Stress interface.

Functions

This section is empty.

Types

type StressClientMethods

type StressClientMethods interface {
	// Echo returns the payload that it receives.
	Echo(_ *context.T, Payload []byte, _ ...rpc.CallOpt) ([]byte, error)
	// Do returns the checksum of the payload that it receives.
	Sum(_ *context.T, arg SumArg, _ ...rpc.CallOpt) ([]byte, error)
	// DoStream returns the checksum of the payload that it receives via the stream.
	SumStream(*context.T, ...rpc.CallOpt) (StressSumStreamClientCall, error)
	// GetSumStats returns the stats on the Sum calls that the server received.
	GetSumStats(*context.T, ...rpc.CallOpt) (SumStats, error)
	// Stop stops the server.
	Stop(*context.T, ...rpc.CallOpt) error
}

StressClientMethods is the client interface containing Stress methods.

type StressClientStub

type StressClientStub interface {
	StressClientMethods
	rpc.UniversalServiceMethods
}

StressClientStub adds universal methods to StressClientMethods.

func StressClient

func StressClient(name string) StressClientStub

StressClient returns a client stub for Stress.

type StressServerMethods

type StressServerMethods interface {
	// Echo returns the payload that it receives.
	Echo(_ *context.T, _ rpc.ServerCall, Payload []byte) ([]byte, error)
	// Do returns the checksum of the payload that it receives.
	Sum(_ *context.T, _ rpc.ServerCall, arg SumArg) ([]byte, error)
	// DoStream returns the checksum of the payload that it receives via the stream.
	SumStream(*context.T, StressSumStreamServerCall) error
	// GetSumStats returns the stats on the Sum calls that the server received.
	GetSumStats(*context.T, rpc.ServerCall) (SumStats, error)
	// Stop stops the server.
	Stop(*context.T, rpc.ServerCall) error
}

StressServerMethods is the interface a server writer implements for Stress.

type StressServerStub

type StressServerStub interface {
	StressServerStubMethods
	// Describe the Stress interfaces.
	Describe__() []rpc.InterfaceDesc
}

StressServerStub adds universal methods to StressServerStubMethods.

func StressServer

func StressServer(impl StressServerMethods) StressServerStub

StressServer returns a server stub for Stress. It converts an implementation of StressServerMethods into an object that may be used by rpc.Server.

type StressServerStubMethods

type StressServerStubMethods interface {
	// Echo returns the payload that it receives.
	Echo(_ *context.T, _ rpc.ServerCall, Payload []byte) ([]byte, error)
	// Do returns the checksum of the payload that it receives.
	Sum(_ *context.T, _ rpc.ServerCall, arg SumArg) ([]byte, error)
	// DoStream returns the checksum of the payload that it receives via the stream.
	SumStream(*context.T, *StressSumStreamServerCallStub) error
	// GetSumStats returns the stats on the Sum calls that the server received.
	GetSumStats(*context.T, rpc.ServerCall) (SumStats, error)
	// Stop stops the server.
	Stop(*context.T, rpc.ServerCall) error
}

StressServerStubMethods is the server interface containing Stress methods, as expected by rpc.Server. The only difference between this interface and StressServerMethods is the streaming methods.

type StressSumStreamClientCall

type StressSumStreamClientCall interface {
	StressSumStreamClientStream
	// Finish performs the equivalent of SendStream().Close, then blocks until
	// the server is done, and returns the positional return values for the call.
	//
	// Finish returns immediately if the call has been canceled; depending on the
	// timing the output could either be an error signaling cancelation, or the
	// valid positional return values from the server.
	//
	// Calling Finish is mandatory for releasing stream resources, unless the call
	// has been canceled or any of the other methods return an error.  Finish should
	// be called at most once.
	Finish() error
}

StressSumStreamClientCall represents the call returned from Stress.SumStream.

type StressSumStreamClientStream

type StressSumStreamClientStream interface {
	// RecvStream returns the receiver side of the Stress.SumStream client stream.
	RecvStream() interface {
		// Advance stages an item so that it may be retrieved via Value.  Returns
		// true iff there is an item to retrieve.  Advance must be called before
		// Value is called.  May block if an item is not available.
		Advance() bool
		// Value returns the item that was staged by Advance.  May panic if Advance
		// returned false or was not called.  Never blocks.
		Value() []byte
		// Err returns any error encountered by Advance.  Never blocks.
		Err() error
	}
	// SendStream returns the send side of the Stress.SumStream client stream.
	SendStream() interface {
		// Send places the item onto the output stream.  Returns errors
		// encountered while sending, or if Send is called after Close or
		// the stream has been canceled.  Blocks if there is no buffer
		// space; will unblock when buffer space is available or after
		// the stream has been canceled.
		Send(item SumArg) error
		// Close indicates to the server that no more items will be sent;
		// server Recv calls will receive io.EOF after all sent items.
		// This is an optional call - e.g. a client might call Close if it
		// needs to continue receiving items from the server after it's
		// done sending.  Returns errors encountered while closing, or if
		// Close is called after the stream has been canceled.  Like Send,
		// blocks if there is no buffer space available.
		Close() error
	}
}

StressSumStreamClientStream is the client stream for Stress.SumStream.

type StressSumStreamServerCall

type StressSumStreamServerCall interface {
	rpc.ServerCall
	StressSumStreamServerStream
}

StressSumStreamServerCall represents the context passed to Stress.SumStream.

type StressSumStreamServerCallStub

type StressSumStreamServerCallStub struct {
	rpc.StreamServerCall
	// contains filtered or unexported fields
}

StressSumStreamServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements StressSumStreamServerCall.

func (*StressSumStreamServerCallStub) Init

Init initializes StressSumStreamServerCallStub from rpc.StreamServerCall.

func (*StressSumStreamServerCallStub) RecvStream

func (s *StressSumStreamServerCallStub) RecvStream() interface {
	Advance() bool
	Value() SumArg
	Err() error
}

RecvStream returns the receiver side of the Stress.SumStream server stream.

func (*StressSumStreamServerCallStub) SendStream

func (s *StressSumStreamServerCallStub) SendStream() interface {
	Send(item []byte) error
}

SendStream returns the send side of the Stress.SumStream server stream.

type StressSumStreamServerStream

type StressSumStreamServerStream interface {
	// RecvStream returns the receiver side of the Stress.SumStream server stream.
	RecvStream() interface {
		// Advance stages an item so that it may be retrieved via Value.  Returns
		// true iff there is an item to retrieve.  Advance must be called before
		// Value is called.  May block if an item is not available.
		Advance() bool
		// Value returns the item that was staged by Advance.  May panic if Advance
		// returned false or was not called.  Never blocks.
		Value() SumArg
		// Err returns any error encountered by Advance.  Never blocks.
		Err() error
	}
	// SendStream returns the send side of the Stress.SumStream server stream.
	SendStream() interface {
		// Send places the item onto the output stream.  Returns errors encountered
		// while sending.  Blocks if there is no buffer space; will unblock when
		// buffer space is available.
		Send(item []byte) error
	}
}

StressSumStreamServerStream is the server stream for Stress.SumStream.

type SumArg

type SumArg struct {
	ABool        bool
	AInt64       int64
	AListOfBytes []byte
}

func (SumArg) VDLIsZero

func (x SumArg) VDLIsZero() bool

func (*SumArg) VDLRead

func (x *SumArg) VDLRead(dec vdl.Decoder) error

func (SumArg) VDLReflect

func (SumArg) VDLReflect(struct {
	Name string `vdl:"v.io/x/ref/runtime/internal/rpc/stress.SumArg"`
})

func (SumArg) VDLWrite

func (x SumArg) VDLWrite(enc vdl.Encoder) error

type SumStats

type SumStats struct {
	SumCount       uint64
	SumStreamCount uint64
	BytesRecv      uint64
	BytesSent      uint64
}

func (SumStats) VDLIsZero

func (x SumStats) VDLIsZero() bool

func (*SumStats) VDLRead

func (x *SumStats) VDLRead(dec vdl.Decoder) error

func (SumStats) VDLReflect

func (SumStats) VDLReflect(struct {
	Name string `vdl:"v.io/x/ref/runtime/internal/rpc/stress.SumStats"`
})

func (SumStats) VDLWrite

func (x SumStats) VDLWrite(enc vdl.Encoder) error

Directories

Path Synopsis
Usage: mtstress [flags] <command> The mtstress commands are: mount Measure latency of the Mount RPC at a fixed request rate resolve Measure latency of the Resolve RPC at a fixed request rate help Display help for commands or topics The global flags are: -duration=10s Duration for sending test traffic and measuring latency -rate=1 Rate, in RPCs per second, to send to the test server -reauthenticate=false If true, establish a new authenticated connection for each RPC, simulating load from a distinct process -alsologtostderr=true log to standard error as well as files -log_backtrace_at=:0 when logging hits line file:N, emit a stack trace -log_dir= if non-empty, write log files to this directory -logtostderr=false log to standard error instead of files -max_stack_buf_size=4292608 max size in bytes of the buffer to use for logging stack traces -metadata=<just specify -metadata to activate> Displays metadata for the program and exits.
Usage: mtstress [flags] <command> The mtstress commands are: mount Measure latency of the Mount RPC at a fixed request rate resolve Measure latency of the Resolve RPC at a fixed request rate help Display help for commands or topics The global flags are: -duration=10s Duration for sending test traffic and measuring latency -rate=1 Rate, in RPCs per second, to send to the test server -reauthenticate=false If true, establish a new authenticated connection for each RPC, simulating load from a distinct process -alsologtostderr=true log to standard error as well as files -log_backtrace_at=:0 when logging hits line file:N, emit a stack trace -log_dir= if non-empty, write log files to this directory -logtostderr=false log to standard error instead of files -max_stack_buf_size=4292608 max size in bytes of the buffer to use for logging stack traces -metadata=<just specify -metadata to activate> Displays metadata for the program and exits.
Command stress is a tool to stress/load test RPC by issuing randomly generated requests.
Command stress is a tool to stress/load test RPC by issuing randomly generated requests.
Command stressd runs the stress-test server.
Command stressd runs the stress-test server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL