v.io: v.io/x/ref/runtime/internal/rpc/stress Index | Files | Directories

package stress

import "v.io/x/ref/runtime/internal/rpc/stress"

nolint:golint

Index

Package Files

stress.vdl.go

Variables

var StressDesc rpc.InterfaceDesc = descStress

StressDesc describes the Stress interface.

type StressClientMethods Uses

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 Uses

type StressClientStub interface {
    StressClientMethods
}

StressClientStub embeds StressClientMethods and is a placeholder for additional management operations.

func StressClient Uses

func StressClient(name string) StressClientStub

StressClient returns a client stub for Stress.

type StressServerMethods Uses

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 Uses

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

StressServerStub adds universal methods to StressServerStubMethods.

func StressServer Uses

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 Uses

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 Uses

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 Uses

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 Uses

type StressSumStreamServerCall interface {
    rpc.ServerCall
    StressSumStreamServerStream
}

StressSumStreamServerCall represents the context passed to Stress.SumStream.

type StressSumStreamServerCallStub Uses

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 Uses

func (s *StressSumStreamServerCallStub) Init(call rpc.StreamServerCall)

Init initializes StressSumStreamServerCallStub from rpc.StreamServerCall.

func (*StressSumStreamServerCallStub) RecvStream Uses

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 Uses

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

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

type StressSumStreamServerStream Uses

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 Uses

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

func (SumArg) VDLIsZero Uses

func (x SumArg) VDLIsZero() bool

func (*SumArg) VDLRead Uses

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

func (SumArg) VDLReflect Uses

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

func (SumArg) VDLWrite Uses

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

type SumStats Uses

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

func (SumStats) VDLIsZero Uses

func (x SumStats) VDLIsZero() bool

func (*SumStats) VDLRead Uses

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

func (SumStats) VDLReflect Uses

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

func (SumStats) VDLWrite Uses

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

Directories

PathSynopsis
internal
mtstressUsage: mtstress [flags] <command>
stressCommand stress is a tool to stress/load test RPC by issuing randomly generated requests.
stressdCommand stressd runs the stress-test server.

Package stress imports 6 packages (graph) and is imported by 10 packages. Updated 2020-10-24. Refresh now. Tools for package owners.