Documentation ¶
Overview ¶
Package grpcext allows gRPC requests collecting stats info.
Index ¶
- Variables
- func DebugStat(logger logrus.FieldLogger, stat grpcstats.RPCStats, httpDebugOption string)
- func DefaultOptions(getState func() *lib.State) []grpc.DialOption
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) Invoke(ctx context.Context, req InvokeRequest, opts ...grpc.CallOption) (*InvokeResponse, error)
- func (c *Conn) NewStream(ctx context.Context, req StreamRequest, opts ...grpc.CallOption) (*Stream, error)
- func (c *Conn) Reflect(ctx context.Context) (*descriptorpb.FileDescriptorSet, error)
- type InvokeRequest
- type InvokeResponse
- type Stream
- type StreamRequest
Constants ¶
This section is empty.
Variables ¶
var ErrCanceled = errors.New("canceled by client (k6)")
ErrCanceled canceled by client (k6)
Functions ¶
func DebugStat ¶
func DebugStat(logger logrus.FieldLogger, stat grpcstats.RPCStats, httpDebugOption string)
DebugStat prints debugging information based on RPCStats.
func DefaultOptions ¶
func DefaultOptions(getState func() *lib.State) []grpc.DialOption
DefaultOptions generates an option set with common options for requests from a VU.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a gRPC client connection.
func (*Conn) Invoke ¶
func (c *Conn) Invoke( ctx context.Context, req InvokeRequest, opts ...grpc.CallOption, ) (*InvokeResponse, error)
Invoke executes a unary gRPC request.
func (*Conn) NewStream ¶ added in v0.49.0
func (c *Conn) NewStream( ctx context.Context, req StreamRequest, opts ...grpc.CallOption, ) (*Stream, error)
NewStream creates a new gRPC stream.
func (*Conn) Reflect ¶
func (c *Conn) Reflect(ctx context.Context) (*descriptorpb.FileDescriptorSet, error)
Reflect returns using the reflection the FileDescriptorSet describing the service.
type InvokeRequest ¶ added in v0.51.0
type InvokeRequest struct { Method string MethodDescriptor protoreflect.MethodDescriptor Timeout time.Duration TagsAndMeta *metrics.TagsAndMeta DiscardResponseMessage bool Message []byte Metadata metadata.MD }
InvokeRequest represents a unary gRPC request.
type InvokeResponse ¶ added in v0.51.0
type InvokeResponse struct { Message interface{} Error interface{} Headers map[string][]string Trailers map[string][]string Status codes.Code }
InvokeResponse represents a gRPC response.
type Stream ¶ added in v0.49.0
type Stream struct {
// contains filtered or unexported fields
}
Stream is the wrapper around the grpc.ClientStream with some handy methods.
func (*Stream) ReceiveConverted ¶ added in v0.49.0
ReceiveConverted receives a converted message from the stream if the stream has been closed successfully, it returns io.EOF if the stream has been cancelled, it returns ErrCanceled
type StreamRequest ¶ added in v0.49.0
type StreamRequest struct { Method string MethodDescriptor protoreflect.MethodDescriptor Timeout time.Duration DiscardResponseMessage bool TagsAndMeta *metrics.TagsAndMeta Metadata metadata.MD }
StreamRequest represents a gRPC stream request.