fortio: fortio.org/fortio/fgrpc Index | Files

package fgrpc

import "fortio.org/fortio/fgrpc"

Package fgrpc is a generated protocol buffer package.

It is generated from these files:

ping.proto

It has these top-level messages:

PingMessage

Index

Package Files

grpcrunner.go ping.pb.go pingsrv.go

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"
)

func Dial Uses

func Dial(o *GRPCRunnerOptions) (conn *grpc.ClientConn, err 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 Uses

func PingClientCall(serverAddr, cacert string, n int, payload string, delay time.Duration) (float64, error)

PingClientCall calls the ping service (presumably running as PingServer on the destination). returns the average round trip in seconds.

func PingServer Uses

func PingServer(port, cert, key, healthServiceName string, maxConcurrentStreams uint32) 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 Uses

func PingServerTCP(port, cert, key, healthServiceName string, maxConcurrentStreams uint32) int

PingServerTCP is PingServer() assuming tcp instead of possible unix domain socket port, returns the numeric port.

func RegisterPingServerServer Uses

func RegisterPingServerServer(s *grpc.Server, srv PingServerServer)

type GRPCRunnerOptions Uses

type GRPCRunnerOptions struct {
    periodic.RunnerOptions
    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
    CACert             string        // Path to CA certificate for grpc TLS
    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.
    UnixDomainSocket   string        // unix domain socket path to use for physical connection instead of Destination
}

GRPCRunnerOptions includes the base RunnerOptions plus http specific options.

type GRPCRunnerResults Uses

type GRPCRunnerResults struct {
    periodic.RunnerResults

    RetCodes    HealthResultMap
    Destination string
    Streams     int
    Ping        bool
    // contains filtered or unexported fields
}

GRPCRunnerResults is the aggregated result of an GRPCRunner. Also is the internal type used per thread/goroutine.

func RunGRPCTest Uses

func RunGRPCTest(o *GRPCRunnerOptions) (*GRPCRunnerResults, error)

RunGRPCTest runs an http test and returns the aggregated stats.

func (*GRPCRunnerResults) Run Uses

func (grpcstate *GRPCRunnerResults) Run(t int)

Run exercises GRPC health check or ping at the target QPS. To be set as the Function in RunnerOptions.

type HealthResultMap Uses

type HealthResultMap map[string]int64

HealthResultMap short cut for the map of results to count.

func GrpcHealthCheck Uses

func GrpcHealthCheck(serverAddr, cacert string, svcname string, n int) (*HealthResultMap, error)

GrpcHealthCheck makes a grpc client call to the standard grpc health check service.

type PingMessage Uses

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 Uses

func (*PingMessage) Descriptor() ([]byte, []int)

func (*PingMessage) GetDelayNanos Uses

func (m *PingMessage) GetDelayNanos() int64

func (*PingMessage) GetPayload Uses

func (m *PingMessage) GetPayload() string

func (*PingMessage) GetSeq Uses

func (m *PingMessage) GetSeq() int64

func (*PingMessage) GetTs Uses

func (m *PingMessage) GetTs() int64

func (*PingMessage) ProtoMessage Uses

func (*PingMessage) ProtoMessage()

func (*PingMessage) Reset Uses

func (m *PingMessage) Reset()

func (*PingMessage) String Uses

func (m *PingMessage) String() string

type PingServerClient Uses

type PingServerClient interface {
    Ping(ctx context.Context, in *PingMessage, opts ...grpc.CallOption) (*PingMessage, error)
}

func NewPingServerClient Uses

func NewPingServerClient(cc *grpc.ClientConn) PingServerClient

type PingServerServer Uses

type PingServerServer interface {
    Ping(context.Context, *PingMessage) (*PingMessage, error)
}

Package fgrpc imports 20 packages (graph) and is imported by 4 packages. Updated 2019-05-10. Refresh now. Tools for package owners.