grpcecho

package
v0.0.0-...-4567ff4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

README

Minimal implementation for Istio Echo app, gRPC only

The intent is to evaluate the overhead of various gRPC options.

  • 0.8M for a min go program

  • 4.7M for an echo using HTTP.

  • 9M - this server, only plain gRPC

  • 20M - same app, but proxyless gRPC

  • 22M - plus opencensus, prom, zpages, reflection

  • ocgrpc adds ~300k

Documentation

Index

Constants

View Source
const (
	ConnectionTimeout = 2 * time.Second
)
View Source
const ECHO_SERVICE = "/proto.EchoTestService/Echo"

Variables

View Source
var (
	StatusCodeOK              = strconv.Itoa(http.StatusOK)
	StatusUnauthorized        = strconv.Itoa(http.StatusUnauthorized)
	StatusCodeForbidden       = strconv.Itoa(http.StatusForbidden)
	StatusCodeUnavailable     = strconv.Itoa(http.StatusServiceUnavailable)
	StatusCodeBadRequest      = strconv.Itoa(http.StatusBadRequest)
	StatusCodeTooManyRequests = strconv.Itoa(http.StatusTooManyRequests)
)
View Source
var DefaultRequestTimeout = 5 * time.Second

Functions

This section is empty.

Types

type EchoGrpcHandler

type EchoGrpcHandler struct {
	Port         int
	Version      string
	Cluster      string
	IstioVersion string

	Mesh *hbone.HBone
}

func (*EchoGrpcHandler) Echo

func (*EchoGrpcHandler) ForwardEcho

func (*EchoGrpcHandler) ServeHTTP

func (h *EchoGrpcHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

Handle /grpc/ requests, equivalent with forward

type Field

type Field string

Field is a list of fields returned in responses from the Echo server.

const (
	RequestIDField      Field = "X-Request-Id"
	ServiceVersionField Field = "ServiceVersion"
	ServicePortField    Field = "ServicePort"
	StatusCodeField     Field = "StatusCode"
	URLField            Field = "URL"
	HostField           Field = "Host"
	HostnameField       Field = "Hostname"
	MethodField         Field = "Method"
	ResponseHeader      Field = "ResponseHeader"
	ClusterField        Field = "Cluster"
	IstioVersionField   Field = "IstioVersion"
	IPField             Field = "IP" // The Requester’s IP Address.
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL