Documentation ¶
Index ¶
- Variables
- type StressClientMethods
- type StressClientStub
- type StressServerMethods
- type StressServerStub
- type StressServerStubMethods
- type StressSumStreamClientCall
- type StressSumStreamClientStream
- type StressSumStreamServerCall
- type StressSumStreamServerCallStub
- type StressSumStreamServerStream
- type SumArg
- type SumStats
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (s *StressSumStreamServerCallStub) Init(call rpc.StreamServerCall)
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 ¶
func (SumArg) VDLReflect ¶
type SumStats ¶
func (SumStats) VDLReflect ¶
Directories ¶
Path | Synopsis |
---|---|
Usage:
|
Usage: |
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. |