Documentation
¶
Overview ¶
Package fgrpc is a generated protocol buffer package.
It is generated from these files:
ping.proto
It has these top-level messages:
PingMessage
Index ¶
- Constants
- func Dial(o *GRPCRunnerOptions) (*grpc.ClientConn, error)
- func PingClientCall(serverAddr string, n int, payload string, delay time.Duration, ...) (float64, error)
- func PingServer(port, healthServiceName string, maxConcurrentStreams uint32, ...) net.Addr
- func PingServerTCP(port, healthServiceName string, maxConcurrentStreams uint32, ...) int
- func RegisterPingServerServer(s *grpc.Server, srv PingServerServer)
- type DynamicGrpcCall
- type GRPCRunnerOptions
- type GRPCRunnerResults
- type HealthResultMap
- type PingMessage
- func (*PingMessage) Descriptor() ([]byte, []int)
- func (m *PingMessage) GetDelayNanos() int64
- func (m *PingMessage) GetPayload() string
- func (m *PingMessage) GetSeq() int64
- func (m *PingMessage) GetTs() int64
- func (*PingMessage) ProtoMessage()
- func (m *PingMessage) Reset()
- func (m *PingMessage) String() string
- type PingServerClient
- type PingServerServer
Constants ¶
const ( // DefaultHealthServiceName is the default health service name used by fortio. DefaultHealthServiceName = "ping" // Error indicates that something went wrong with healthcheck in grpc. Error = "ERROR" )
Variables ¶
This section is empty.
Functions ¶
func Dial ¶ added in v0.7.0
func Dial(o *GRPCRunnerOptions) (*grpc.ClientConn, error)
Dial dials gRPC using insecure or TLS transport security when serverAddr has prefixHTTPS or cert is provided. If override is set to a non-empty string, it will override the virtual host name of authority in requests.
func PingClientCall ¶ added in v0.8.0
func PingClientCall(serverAddr string, n int, payload string, delay time.Duration, tlsOpts *fhttp.TLSOptions, md metadata.MD, ) (float64, error)
PingClientCall calls the ping service (presumably running as PingServer on the destination). returns the average round trip in seconds.
func PingServer ¶ added in v0.8.0
func PingServer(port, healthServiceName string, maxConcurrentStreams uint32, tlsOptions *fhttp.TLSOptions) net.Addr
PingServer starts a gRPC ping (and health) echo server. returns the port being bound (useful when passing "0" as the port to get a dynamic server). Pass the healthServiceName to use for the gRPC service name health check (or pass DefaultHealthServiceName) to be marked as SERVING. Pass maxConcurrentStreams > 0 to set that option.
func PingServerTCP ¶ added in v1.1.0
func PingServerTCP(port, healthServiceName string, maxConcurrentStreams uint32, tlsOptions *fhttp.TLSOptions) int
PingServerTCP is PingServer() assuming TCP instead of possible Unix domain socket port, returns the numeric port.
func RegisterPingServerServer ¶
func RegisterPingServerServer(s *grpc.Server, srv PingServerServer)
Types ¶
type DynamicGrpcCall ¶ added in v1.71.0
type DynamicGrpcCall struct {
MethodPath string // e.g. "/Service/Method"
RequestMsg *dynamic.Message // dynamic protobuf for request
// contains filtered or unexported fields
}
DynamicGrpcCall represents a prepared dynamic gRPC call with all necessary components.
type GRPCRunnerOptions ¶
type GRPCRunnerOptions struct {
periodic.RunnerOptions
fhttp.TLSOptions
Destination string
Service string // Service to be checked when using gRPC health check
Profiler string // file to save profiles to. defaults to no profiling
Payload string // Payload to be sent for gRPC ping service
Streams int // number of streams. total go routines and data streams will be streams*numthreads.
Delay time.Duration // Delay to be sent when using gRPC ping service
CertOverride string // Override the cert virtual host of authority for testing
AllowInitialErrors bool // whether initial errors don't cause an abort
UsePing bool // use our own Ping proto for gRPC load instead of standard health check one.
Metadata metadata.MD // input metadata that will be added to the request
GrpcCompression bool // enable gRPC compression
GrpcMethod string // gRPC method to call (Service/Method)
// contains filtered or unexported fields
}
GRPCRunnerOptions includes the base RunnerOptions plus gRPC specific options.
type GRPCRunnerResults ¶
type GRPCRunnerResults struct {
periodic.RunnerResults
RetCodes HealthResultMap
Destination string
Streams int
Ping bool
Metadata metadata.MD
// contains filtered or unexported fields
}
GRPCRunnerResults is the aggregated result of an GRPCRunner. Also is the internal type used per thread/goroutine.
func RunGRPCTest ¶
func RunGRPCTest(o *GRPCRunnerOptions) (*GRPCRunnerResults, error)
RunGRPCTest runs an HTTP test and returns the aggregated stats.
type HealthResultMap ¶ added in v0.8.0
HealthResultMap short cut for the map of results to count.
func GrpcHealthCheck ¶ added in v0.8.0
func GrpcHealthCheck(serverAddr, svcname string, n int, tlsOpts *fhttp.TLSOptions, md metadata.MD) (*HealthResultMap, error)
GrpcHealthCheck makes a gRPC client call to the standard gRPC health check service.
type PingMessage ¶
type PingMessage struct {
Seq int64 `protobuf:"varint,1,opt,name=seq" json:"seq,omitempty"`
Ts int64 `protobuf:"varint,2,opt,name=ts" json:"ts,omitempty"`
Payload string `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"`
DelayNanos int64 `protobuf:"varint,4,opt,name=delayNanos" json:"delayNanos,omitempty"`
}
func (*PingMessage) Descriptor ¶
func (*PingMessage) Descriptor() ([]byte, []int)
func (*PingMessage) GetDelayNanos ¶ added in v0.9.0
func (m *PingMessage) GetDelayNanos() int64
func (*PingMessage) GetPayload ¶
func (m *PingMessage) GetPayload() string
func (*PingMessage) GetSeq ¶
func (m *PingMessage) GetSeq() int64
func (*PingMessage) GetTs ¶
func (m *PingMessage) GetTs() int64
func (*PingMessage) ProtoMessage ¶
func (*PingMessage) ProtoMessage()
func (*PingMessage) Reset ¶
func (m *PingMessage) Reset()
func (*PingMessage) String ¶
func (m *PingMessage) String() string
type PingServerClient ¶
type PingServerClient interface {
Ping(ctx context.Context, in *PingMessage, opts ...grpc.CallOption) (*PingMessage, error)
}
func NewPingServerClient ¶
func NewPingServerClient(cc *grpc.ClientConn) PingServerClient
type PingServerServer ¶
type PingServerServer interface {
Ping(context.Context, *PingMessage) (*PingMessage, error)
}