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, url string, md metadata.MD, req Request, ...) (*Response, 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 Request
- type Response
- 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, url string, md metadata.MD, req Request, opts ...grpc.CallOption, ) (*Response, 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 Request ¶
type Request struct { MethodDescriptor protoreflect.MethodDescriptor TagsAndMeta *metrics.TagsAndMeta Message []byte }
Request represents a gRPC request.
type Response ¶
type Response struct { Message interface{} Error interface{} Headers map[string][]string Trailers map[string][]string Status codes.Code }
Response 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 TagsAndMeta *metrics.TagsAndMeta Metadata metadata.MD }
StreamRequest represents a gRPC stream request.