From 53788aa5dcb46078eb29b05869a7472a5cd886e8 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Sat, 26 Dec 2020 10:11:54 -0800 Subject: [PATCH 01/37] github: update bug template to link to the CVE process (#4131) --- .github/ISSUE_TEMPLATE/bug.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 1c4663918c18..5384f2d93114 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -1,12 +1,17 @@ --- name: Bug Report -about: Create a report to help us improve +about: Report a non-security bug. For suspected security vulnerabilities or crashes, please use "Report a Security Vulnerability", below. labels: 'Type: Bug' --- -Please see the FAQ in our main README.md, then answer the questions below before -submitting your issue. +NOTE: if you are reporting is a potential security vulnerability or a crash, +please follow our CVE process at +https://github.com/grpc/proposal/blob/master/P4-grpc-cve-process.md instead of +filing an issue here. + +Please see the FAQ in our main README.md, then answer the questions below +before submitting your issue. ### What version of gRPC are you using? From f4a20d2f414ffe9ca43416e6980831bde3140404 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Tue, 5 Jan 2021 13:53:57 -0800 Subject: [PATCH 02/37] xds: NACK more invalid RDS responses (#4120) --- xds/internal/client/client_rds_test.go | 64 ++++++++++++++++++++++++++ xds/internal/client/client_xds.go | 12 +++-- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/xds/internal/client/client_rds_test.go b/xds/internal/client/client_rds_test.go index ab4737376e54..481030fee211 100644 --- a/xds/internal/client/client_rds_test.go +++ b/xds/internal/client/client_rds_test.go @@ -707,6 +707,70 @@ func (s) TestRoutesProtoToSlice(t *testing.T) { }}, wantErr: false, }, + { + name: "unrecognized path specifier", + routes: []*v3routepb.Route{ + { + Match: &v3routepb.RouteMatch{ + PathSpecifier: &v3routepb.RouteMatch_ConnectMatcher_{}, + }, + }, + }, + wantErr: true, + }, + { + name: "unrecognized header match specifier", + routes: []*v3routepb.Route{ + { + Match: &v3routepb.RouteMatch{ + PathSpecifier: &v3routepb.RouteMatch_Prefix{Prefix: "/a/"}, + Headers: []*v3routepb.HeaderMatcher{ + { + Name: "th", + HeaderMatchSpecifier: &v3routepb.HeaderMatcher_HiddenEnvoyDeprecatedRegexMatch{}, + }, + }, + }, + }, + }, + wantErr: true, + }, + { + name: "no cluster in weighted clusters action", + routes: []*v3routepb.Route{ + { + Match: &v3routepb.RouteMatch{ + PathSpecifier: &v3routepb.RouteMatch_Prefix{Prefix: "/a/"}, + }, + Action: &v3routepb.Route_Route{ + Route: &v3routepb.RouteAction{ + ClusterSpecifier: &v3routepb.RouteAction_WeightedClusters{ + WeightedClusters: &v3routepb.WeightedCluster{}}}}, + }, + }, + wantErr: true, + }, + { + name: "all 0-weight clusters in weighted clusters action", + routes: []*v3routepb.Route{ + { + Match: &v3routepb.RouteMatch{ + PathSpecifier: &v3routepb.RouteMatch_Prefix{Prefix: "/a/"}, + }, + Action: &v3routepb.Route_Route{ + Route: &v3routepb.RouteAction{ + ClusterSpecifier: &v3routepb.RouteAction_WeightedClusters{ + WeightedClusters: &v3routepb.WeightedCluster{ + Clusters: []*v3routepb.WeightedCluster_ClusterWeight{ + {Name: "B", Weight: &wrapperspb.UInt32Value{Value: 0}}, + {Name: "A", Weight: &wrapperspb.UInt32Value{Value: 0}}, + }, + TotalWeight: &wrapperspb.UInt32Value{Value: 0}, + }}}}, + }, + }, + wantErr: true, + }, } cmpOpts := []cmp.Option{ diff --git a/xds/internal/client/client_xds.go b/xds/internal/client/client_xds.go index f31b6009b6e1..68f65c082412 100644 --- a/xds/internal/client/client_xds.go +++ b/xds/internal/client/client_xds.go @@ -272,8 +272,7 @@ func routesProtoToSlice(routes []*v3routepb.Route, logger *grpclog.PrefixLogger) case *v3routepb.RouteMatch_SafeRegex: route.Regex = &pt.SafeRegex.Regex default: - logger.Warningf("route %+v has an unrecognized path specifier: %+v", r, pt) - continue + return nil, fmt.Errorf("route %+v has an unrecognized path specifier: %+v", r, pt) } if caseSensitive := match.GetCaseSensitive(); caseSensitive != nil { @@ -299,8 +298,7 @@ func routesProtoToSlice(routes []*v3routepb.Route, logger *grpclog.PrefixLogger) case *v3routepb.HeaderMatcher_SuffixMatch: header.SuffixMatch = &ht.SuffixMatch default: - logger.Warningf("route %+v has an unrecognized header matcher: %+v", r, ht) - continue + return nil, fmt.Errorf("route %+v has an unrecognized header matcher: %+v", r, ht) } header.Name = h.GetName() invert := h.GetInvertMatch() @@ -331,12 +329,18 @@ func routesProtoToSlice(routes []*v3routepb.Route, logger *grpclog.PrefixLogger) var totalWeight uint32 for _, c := range wcs.Clusters { w := c.GetWeight().GetValue() + if w == 0 { + continue + } clusters[c.GetName()] = w totalWeight += w } if totalWeight != wcs.GetTotalWeight().GetValue() { return nil, fmt.Errorf("route %+v, action %+v, weights of clusters do not add up to total total weight, got: %v, want %v", r, a, wcs.GetTotalWeight().GetValue(), totalWeight) } + if totalWeight == 0 { + return nil, fmt.Errorf("route %+v, action %+v, has no valid cluster in WeightedCluster action", r, a) + } case *v3routepb.RouteAction_ClusterHeader: continue } From 829919d5722373b6ad9bc3fa539b73d5dbb91257 Mon Sep 17 00:00:00 2001 From: Pradeep Mamillapalli Date: Thu, 7 Jan 2021 13:06:14 -0500 Subject: [PATCH 03/37] xds client: Updated v3 type for http connection manager (#4137) --- xds/internal/client/client_lds_test.go | 8 +++----- xds/internal/version/version.go | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/xds/internal/client/client_lds_test.go b/xds/internal/client/client_lds_test.go index 6c0ec32106ea..09dd2eea4d84 100644 --- a/xds/internal/client/client_lds_test.go +++ b/xds/internal/client/client_lds_test.go @@ -31,6 +31,7 @@ import ( v3httppb "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" v3tlspb "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3" "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes" anypb "github.com/golang/protobuf/ptypes/any" wrapperspb "github.com/golang/protobuf/ptypes/wrappers" "github.com/google/go-cmp/cmp" @@ -87,14 +88,11 @@ func (s) TestUnmarshalListener_ClientSide(t *testing.T) { }, }, } - mcm, _ := proto.Marshal(cm) + mcm, _ := ptypes.MarshalAny(cm) lis := &v3listenerpb.Listener{ Name: v3LDSTarget, ApiListener: &v3listenerpb.ApiListener{ - ApiListener: &anypb.Any{ - TypeUrl: version.V3HTTPConnManagerURL, - Value: mcm, - }, + ApiListener: mcm, }, } mLis, _ := proto.Marshal(lis) diff --git a/xds/internal/version/version.go b/xds/internal/version/version.go index db1929b76b96..dbcb76ffd1f1 100644 --- a/xds/internal/version/version.go +++ b/xds/internal/version/version.go @@ -45,7 +45,7 @@ const ( V3RouteConfigURL = "type.googleapis.com/envoy.config.route.v3.RouteConfiguration" V3ClusterURL = "type.googleapis.com/envoy.config.cluster.v3.Cluster" V3EndpointsURL = "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment" - V3HTTPConnManagerURL = "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v3.HttpConnectionManager" + V3HTTPConnManagerURL = "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager" V3UpstreamTLSContextURL = "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext" V3DownstreamTLSContextURL = "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext" ) From 4f80d77fe446b820dfe8dadd1eb8094f950a0128 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Thu, 7 Jan 2021 13:10:44 -0800 Subject: [PATCH 04/37] github: enable CodeQL checker (#4134) --- .github/workflows/codeql-analysis.yml | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000000..0c3806bdc23d --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,31 @@ +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '24 20 * * 3' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: go + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From ecc9a99b668778a2702fce85b95f9a278f6ace61 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Thu, 7 Jan 2021 14:19:11 -0800 Subject: [PATCH 05/37] interop: remove test.proto clones/variants and use grpc-proto repo instead (#4129) --- benchmark/benchmain/main.go | 10 +- benchmark/benchmark.go | 32 +- benchmark/client/main.go | 2 +- benchmark/grpc_testing/control.pb.go | 1994 ------------- benchmark/grpc_testing/control.proto | 188 -- benchmark/grpc_testing/messages.pb.go | 1160 -------- benchmark/grpc_testing/messages.proto | 159 -- benchmark/grpc_testing/payloads.proto | 42 - benchmark/grpc_testing/services.pb.go | 152 - benchmark/grpc_testing/services.proto | 61 - benchmark/grpc_testing/stats.pb.go | 473 ---- benchmark/grpc_testing/stats.proto | 57 - benchmark/worker/benchmark_client.go | 2 +- benchmark/worker/benchmark_server.go | 2 +- benchmark/worker/main.go | 2 +- binarylog/binarylog_end2end_test.go | 101 +- interop/grpc_testing/benchmark_service.pb.go | 127 + .../grpc_testing/benchmark_service_grpc.pb.go | 392 +++ interop/grpc_testing/control.pb.go | 2461 +++++++++++++++++ interop/grpc_testing/core/stats.pb.go | 412 +++ interop/grpc_testing/empty.pb.go | 158 ++ interop/grpc_testing/messages.pb.go | 2035 ++++++++++++++ .../grpc_testing/payloads.pb.go | 148 +- .../report_qps_scenario_service.pb.go | 99 + .../report_qps_scenario_service_grpc.pb.go | 103 + interop/grpc_testing/stats.pb.go | 632 +++++ interop/grpc_testing/test.pb.go | 2030 ++------------ interop/grpc_testing/test.proto | 281 -- interop/grpc_testing/test_grpc.pb.go | 337 ++- interop/grpc_testing/worker_service.pb.go | 120 + .../grpc_testing/worker_service_grpc.pb.go | 237 +- interop/test_utils.go | 4 - regenerate.sh | 8 +- stats/grpc_testing/test.pb.go | 254 -- stats/grpc_testing/test.proto | 45 - stats/grpc_testing/test_grpc.pb.go | 316 --- stats/stats_test.go | 125 +- 37 files changed, 7268 insertions(+), 7493 deletions(-) delete mode 100644 benchmark/grpc_testing/control.pb.go delete mode 100644 benchmark/grpc_testing/control.proto delete mode 100644 benchmark/grpc_testing/messages.pb.go delete mode 100644 benchmark/grpc_testing/messages.proto delete mode 100644 benchmark/grpc_testing/payloads.proto delete mode 100644 benchmark/grpc_testing/services.pb.go delete mode 100644 benchmark/grpc_testing/services.proto delete mode 100644 benchmark/grpc_testing/stats.pb.go delete mode 100644 benchmark/grpc_testing/stats.proto create mode 100644 interop/grpc_testing/benchmark_service.pb.go create mode 100644 interop/grpc_testing/benchmark_service_grpc.pb.go create mode 100644 interop/grpc_testing/control.pb.go create mode 100644 interop/grpc_testing/core/stats.pb.go create mode 100644 interop/grpc_testing/empty.pb.go create mode 100644 interop/grpc_testing/messages.pb.go rename {benchmark => interop}/grpc_testing/payloads.pb.go (59%) create mode 100644 interop/grpc_testing/report_qps_scenario_service.pb.go create mode 100644 interop/grpc_testing/report_qps_scenario_service_grpc.pb.go create mode 100644 interop/grpc_testing/stats.pb.go delete mode 100644 interop/grpc_testing/test.proto create mode 100644 interop/grpc_testing/worker_service.pb.go rename benchmark/grpc_testing/services_grpc.pb.go => interop/grpc_testing/worker_service_grpc.pb.go (54%) delete mode 100644 stats/grpc_testing/test.pb.go delete mode 100644 stats/grpc_testing/test.proto delete mode 100644 stats/grpc_testing/test_grpc.pb.go diff --git a/benchmark/benchmain/main.go b/benchmark/benchmain/main.go index 956024c7f047..509a1b905654 100644 --- a/benchmark/benchmain/main.go +++ b/benchmark/benchmain/main.go @@ -58,14 +58,16 @@ import ( "time" "google.golang.org/grpc" + "google.golang.org/grpc/benchmark" bm "google.golang.org/grpc/benchmark" "google.golang.org/grpc/benchmark/flags" - testpb "google.golang.org/grpc/benchmark/grpc_testing" "google.golang.org/grpc/benchmark/latency" "google.golang.org/grpc/benchmark/stats" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/channelz" + testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/test/bufconn" ) @@ -404,10 +406,12 @@ func setupUnconstrainedStream(bf stats.Features) ([]testpb.BenchmarkService_Stre tc, cleanup := makeClient(bf) streams := make([]testpb.BenchmarkService_StreamingCallClient, bf.MaxConcurrentCalls) + md := metadata.Pairs(benchmark.UnconstrainedStreamingHeader, "1") + ctx := metadata.NewOutgoingContext(context.Background(), md) for i := 0; i < bf.MaxConcurrentCalls; i++ { - stream, err := tc.UnconstrainedStreamingCall(context.Background()) + stream, err := tc.StreamingCall(ctx) if err != nil { - logger.Fatalf("%v.UnconstrainedStreamingCall(_) = _, %v", tc, err) + logger.Fatalf("%v.StreamingCall(_) = _, %v", tc, err) } streams[i] = stream } diff --git a/benchmark/benchmark.go b/benchmark/benchmark.go index 56841e172366..92fbeb888365 100644 --- a/benchmark/benchmark.go +++ b/benchmark/benchmark.go @@ -29,9 +29,10 @@ import ( "net" "google.golang.org/grpc" - testpb "google.golang.org/grpc/benchmark/grpc_testing" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + testpb "google.golang.org/grpc/interop/grpc_testing" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -45,8 +46,6 @@ func setPayload(p *testpb.Payload, t testpb.PayloadType, size int) { body := make([]byte, size) switch t { case testpb.PayloadType_COMPRESSABLE: - case testpb.PayloadType_UNCOMPRESSABLE: - logger.Fatalf("PayloadType UNCOMPRESSABLE is not supported") default: logger.Fatalf("Unsupported payload type: %d", t) } @@ -71,7 +70,15 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (* }, nil } +// UnconstrainedStreamingHeader indicates to the StreamingCall handler that its +// behavior should be unconstrained (constant send/receive in parallel) instead +// of ping-pong. +const UnconstrainedStreamingHeader = "unconstrained-streaming" + func (s *testServer) StreamingCall(stream testpb.BenchmarkService_StreamingCallServer) error { + if md, ok := metadata.FromIncomingContext(stream.Context()); ok && len(md[UnconstrainedStreamingHeader]) != 0 { + return s.UnconstrainedStreamingCall(stream) + } response := &testpb.SimpleResponse{ Payload: new(testpb.Payload), } @@ -93,7 +100,7 @@ func (s *testServer) StreamingCall(stream testpb.BenchmarkService_StreamingCallS } } -func (s *testServer) UnconstrainedStreamingCall(stream testpb.BenchmarkService_UnconstrainedStreamingCallServer) error { +func (s *testServer) UnconstrainedStreamingCall(stream testpb.BenchmarkService_StreamingCallServer) error { in := new(testpb.SimpleRequest) // Receive a message to learn response type and size. err := stream.RecvMsg(in) @@ -171,23 +178,6 @@ func (s *byteBufServer) StreamingCall(stream testpb.BenchmarkService_StreamingCa } } -func (s *byteBufServer) UnconstrainedStreamingCall(stream testpb.BenchmarkService_UnconstrainedStreamingCallServer) error { - for { - var in []byte - err := stream.(grpc.ServerStream).RecvMsg(&in) - if err == io.EOF { - return nil - } - if err != nil { - return err - } - out := make([]byte, s.respSize) - if err := stream.(grpc.ServerStream).SendMsg(&out); err != nil { - return err - } - } -} - // ServerInfo contains the information to create a gRPC benchmark server. type ServerInfo struct { // Type is the type of the server. diff --git a/benchmark/client/main.go b/benchmark/client/main.go index f750c5c30721..c744348469ed 100644 --- a/benchmark/client/main.go +++ b/benchmark/client/main.go @@ -50,10 +50,10 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/benchmark" - testpb "google.golang.org/grpc/benchmark/grpc_testing" "google.golang.org/grpc/benchmark/stats" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/syscall" + testpb "google.golang.org/grpc/interop/grpc_testing" ) var ( diff --git a/benchmark/grpc_testing/control.pb.go b/benchmark/grpc_testing/control.pb.go deleted file mode 100644 index af117985dbda..000000000000 --- a/benchmark/grpc_testing/control.pb.go +++ /dev/null @@ -1,1994 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.14.0 -// source: benchmark/grpc_testing/control.proto - -package grpc_testing - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -type ClientType int32 - -const ( - ClientType_SYNC_CLIENT ClientType = 0 - ClientType_ASYNC_CLIENT ClientType = 1 -) - -// Enum value maps for ClientType. -var ( - ClientType_name = map[int32]string{ - 0: "SYNC_CLIENT", - 1: "ASYNC_CLIENT", - } - ClientType_value = map[string]int32{ - "SYNC_CLIENT": 0, - "ASYNC_CLIENT": 1, - } -) - -func (x ClientType) Enum() *ClientType { - p := new(ClientType) - *p = x - return p -} - -func (x ClientType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ClientType) Descriptor() protoreflect.EnumDescriptor { - return file_benchmark_grpc_testing_control_proto_enumTypes[0].Descriptor() -} - -func (ClientType) Type() protoreflect.EnumType { - return &file_benchmark_grpc_testing_control_proto_enumTypes[0] -} - -func (x ClientType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ClientType.Descriptor instead. -func (ClientType) EnumDescriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{0} -} - -type ServerType int32 - -const ( - ServerType_SYNC_SERVER ServerType = 0 - ServerType_ASYNC_SERVER ServerType = 1 - ServerType_ASYNC_GENERIC_SERVER ServerType = 2 -) - -// Enum value maps for ServerType. -var ( - ServerType_name = map[int32]string{ - 0: "SYNC_SERVER", - 1: "ASYNC_SERVER", - 2: "ASYNC_GENERIC_SERVER", - } - ServerType_value = map[string]int32{ - "SYNC_SERVER": 0, - "ASYNC_SERVER": 1, - "ASYNC_GENERIC_SERVER": 2, - } -) - -func (x ServerType) Enum() *ServerType { - p := new(ServerType) - *p = x - return p -} - -func (x ServerType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ServerType) Descriptor() protoreflect.EnumDescriptor { - return file_benchmark_grpc_testing_control_proto_enumTypes[1].Descriptor() -} - -func (ServerType) Type() protoreflect.EnumType { - return &file_benchmark_grpc_testing_control_proto_enumTypes[1] -} - -func (x ServerType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ServerType.Descriptor instead. -func (ServerType) EnumDescriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{1} -} - -type RpcType int32 - -const ( - RpcType_UNARY RpcType = 0 - RpcType_STREAMING RpcType = 1 -) - -// Enum value maps for RpcType. -var ( - RpcType_name = map[int32]string{ - 0: "UNARY", - 1: "STREAMING", - } - RpcType_value = map[string]int32{ - "UNARY": 0, - "STREAMING": 1, - } -) - -func (x RpcType) Enum() *RpcType { - p := new(RpcType) - *p = x - return p -} - -func (x RpcType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RpcType) Descriptor() protoreflect.EnumDescriptor { - return file_benchmark_grpc_testing_control_proto_enumTypes[2].Descriptor() -} - -func (RpcType) Type() protoreflect.EnumType { - return &file_benchmark_grpc_testing_control_proto_enumTypes[2] -} - -func (x RpcType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RpcType.Descriptor instead. -func (RpcType) EnumDescriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{2} -} - -// Parameters of poisson process distribution, which is a good representation -// of activity coming in from independent identical stationary sources. -type PoissonParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The rate of arrivals (a.k.a. lambda parameter of the exp distribution). - OfferedLoad float64 `protobuf:"fixed64,1,opt,name=offered_load,json=offeredLoad,proto3" json:"offered_load,omitempty"` -} - -func (x *PoissonParams) Reset() { - *x = PoissonParams{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PoissonParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PoissonParams) ProtoMessage() {} - -func (x *PoissonParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PoissonParams.ProtoReflect.Descriptor instead. -func (*PoissonParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{0} -} - -func (x *PoissonParams) GetOfferedLoad() float64 { - if x != nil { - return x.OfferedLoad - } - return 0 -} - -type UniformParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - InterarrivalLo float64 `protobuf:"fixed64,1,opt,name=interarrival_lo,json=interarrivalLo,proto3" json:"interarrival_lo,omitempty"` - InterarrivalHi float64 `protobuf:"fixed64,2,opt,name=interarrival_hi,json=interarrivalHi,proto3" json:"interarrival_hi,omitempty"` -} - -func (x *UniformParams) Reset() { - *x = UniformParams{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UniformParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniformParams) ProtoMessage() {} - -func (x *UniformParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UniformParams.ProtoReflect.Descriptor instead. -func (*UniformParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{1} -} - -func (x *UniformParams) GetInterarrivalLo() float64 { - if x != nil { - return x.InterarrivalLo - } - return 0 -} - -func (x *UniformParams) GetInterarrivalHi() float64 { - if x != nil { - return x.InterarrivalHi - } - return 0 -} - -type DeterministicParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OfferedLoad float64 `protobuf:"fixed64,1,opt,name=offered_load,json=offeredLoad,proto3" json:"offered_load,omitempty"` -} - -func (x *DeterministicParams) Reset() { - *x = DeterministicParams{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeterministicParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeterministicParams) ProtoMessage() {} - -func (x *DeterministicParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeterministicParams.ProtoReflect.Descriptor instead. -func (*DeterministicParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{2} -} - -func (x *DeterministicParams) GetOfferedLoad() float64 { - if x != nil { - return x.OfferedLoad - } - return 0 -} - -type ParetoParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - InterarrivalBase float64 `protobuf:"fixed64,1,opt,name=interarrival_base,json=interarrivalBase,proto3" json:"interarrival_base,omitempty"` - Alpha float64 `protobuf:"fixed64,2,opt,name=alpha,proto3" json:"alpha,omitempty"` -} - -func (x *ParetoParams) Reset() { - *x = ParetoParams{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParetoParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParetoParams) ProtoMessage() {} - -func (x *ParetoParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ParetoParams.ProtoReflect.Descriptor instead. -func (*ParetoParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{3} -} - -func (x *ParetoParams) GetInterarrivalBase() float64 { - if x != nil { - return x.InterarrivalBase - } - return 0 -} - -func (x *ParetoParams) GetAlpha() float64 { - if x != nil { - return x.Alpha - } - return 0 -} - -// Once an RPC finishes, immediately start a new one. -// No configuration parameters needed. -type ClosedLoopParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ClosedLoopParams) Reset() { - *x = ClosedLoopParams{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClosedLoopParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClosedLoopParams) ProtoMessage() {} - -func (x *ClosedLoopParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClosedLoopParams.ProtoReflect.Descriptor instead. -func (*ClosedLoopParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{4} -} - -type LoadParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Load: - // *LoadParams_ClosedLoop - // *LoadParams_Poisson - // *LoadParams_Uniform - // *LoadParams_Determ - // *LoadParams_Pareto - Load isLoadParams_Load `protobuf_oneof:"load"` -} - -func (x *LoadParams) Reset() { - *x = LoadParams{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoadParams) ProtoMessage() {} - -func (x *LoadParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoadParams.ProtoReflect.Descriptor instead. -func (*LoadParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{5} -} - -func (m *LoadParams) GetLoad() isLoadParams_Load { - if m != nil { - return m.Load - } - return nil -} - -func (x *LoadParams) GetClosedLoop() *ClosedLoopParams { - if x, ok := x.GetLoad().(*LoadParams_ClosedLoop); ok { - return x.ClosedLoop - } - return nil -} - -func (x *LoadParams) GetPoisson() *PoissonParams { - if x, ok := x.GetLoad().(*LoadParams_Poisson); ok { - return x.Poisson - } - return nil -} - -func (x *LoadParams) GetUniform() *UniformParams { - if x, ok := x.GetLoad().(*LoadParams_Uniform); ok { - return x.Uniform - } - return nil -} - -func (x *LoadParams) GetDeterm() *DeterministicParams { - if x, ok := x.GetLoad().(*LoadParams_Determ); ok { - return x.Determ - } - return nil -} - -func (x *LoadParams) GetPareto() *ParetoParams { - if x, ok := x.GetLoad().(*LoadParams_Pareto); ok { - return x.Pareto - } - return nil -} - -type isLoadParams_Load interface { - isLoadParams_Load() -} - -type LoadParams_ClosedLoop struct { - ClosedLoop *ClosedLoopParams `protobuf:"bytes,1,opt,name=closed_loop,json=closedLoop,proto3,oneof"` -} - -type LoadParams_Poisson struct { - Poisson *PoissonParams `protobuf:"bytes,2,opt,name=poisson,proto3,oneof"` -} - -type LoadParams_Uniform struct { - Uniform *UniformParams `protobuf:"bytes,3,opt,name=uniform,proto3,oneof"` -} - -type LoadParams_Determ struct { - Determ *DeterministicParams `protobuf:"bytes,4,opt,name=determ,proto3,oneof"` -} - -type LoadParams_Pareto struct { - Pareto *ParetoParams `protobuf:"bytes,5,opt,name=pareto,proto3,oneof"` -} - -func (*LoadParams_ClosedLoop) isLoadParams_Load() {} - -func (*LoadParams_Poisson) isLoadParams_Load() {} - -func (*LoadParams_Uniform) isLoadParams_Load() {} - -func (*LoadParams_Determ) isLoadParams_Load() {} - -func (*LoadParams_Pareto) isLoadParams_Load() {} - -// presence of SecurityParams implies use of TLS -type SecurityParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UseTestCa bool `protobuf:"varint,1,opt,name=use_test_ca,json=useTestCa,proto3" json:"use_test_ca,omitempty"` - ServerHostOverride string `protobuf:"bytes,2,opt,name=server_host_override,json=serverHostOverride,proto3" json:"server_host_override,omitempty"` -} - -func (x *SecurityParams) Reset() { - *x = SecurityParams{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SecurityParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecurityParams) ProtoMessage() {} - -func (x *SecurityParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SecurityParams.ProtoReflect.Descriptor instead. -func (*SecurityParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{6} -} - -func (x *SecurityParams) GetUseTestCa() bool { - if x != nil { - return x.UseTestCa - } - return false -} - -func (x *SecurityParams) GetServerHostOverride() string { - if x != nil { - return x.ServerHostOverride - } - return "" -} - -type ClientConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of targets to connect to. At least one target needs to be specified. - ServerTargets []string `protobuf:"bytes,1,rep,name=server_targets,json=serverTargets,proto3" json:"server_targets,omitempty"` - ClientType ClientType `protobuf:"varint,2,opt,name=client_type,json=clientType,proto3,enum=grpc.testing.ClientType" json:"client_type,omitempty"` - SecurityParams *SecurityParams `protobuf:"bytes,3,opt,name=security_params,json=securityParams,proto3" json:"security_params,omitempty"` - // How many concurrent RPCs to start for each channel. - // For synchronous client, use a separate thread for each outstanding RPC. - OutstandingRpcsPerChannel int32 `protobuf:"varint,4,opt,name=outstanding_rpcs_per_channel,json=outstandingRpcsPerChannel,proto3" json:"outstanding_rpcs_per_channel,omitempty"` - // Number of independent client channels to create. - // i-th channel will connect to server_target[i % server_targets.size()] - ClientChannels int32 `protobuf:"varint,5,opt,name=client_channels,json=clientChannels,proto3" json:"client_channels,omitempty"` - // Only for async client. Number of threads to use to start/manage RPCs. - AsyncClientThreads int32 `protobuf:"varint,7,opt,name=async_client_threads,json=asyncClientThreads,proto3" json:"async_client_threads,omitempty"` - RpcType RpcType `protobuf:"varint,8,opt,name=rpc_type,json=rpcType,proto3,enum=grpc.testing.RpcType" json:"rpc_type,omitempty"` - // The requested load for the entire client (aggregated over all the threads). - LoadParams *LoadParams `protobuf:"bytes,10,opt,name=load_params,json=loadParams,proto3" json:"load_params,omitempty"` - PayloadConfig *PayloadConfig `protobuf:"bytes,11,opt,name=payload_config,json=payloadConfig,proto3" json:"payload_config,omitempty"` - HistogramParams *HistogramParams `protobuf:"bytes,12,opt,name=histogram_params,json=histogramParams,proto3" json:"histogram_params,omitempty"` - // Specify the cores we should run the client on, if desired - CoreList []int32 `protobuf:"varint,13,rep,packed,name=core_list,json=coreList,proto3" json:"core_list,omitempty"` - CoreLimit int32 `protobuf:"varint,14,opt,name=core_limit,json=coreLimit,proto3" json:"core_limit,omitempty"` -} - -func (x *ClientConfig) Reset() { - *x = ClientConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientConfig) ProtoMessage() {} - -func (x *ClientConfig) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead. -func (*ClientConfig) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{7} -} - -func (x *ClientConfig) GetServerTargets() []string { - if x != nil { - return x.ServerTargets - } - return nil -} - -func (x *ClientConfig) GetClientType() ClientType { - if x != nil { - return x.ClientType - } - return ClientType_SYNC_CLIENT -} - -func (x *ClientConfig) GetSecurityParams() *SecurityParams { - if x != nil { - return x.SecurityParams - } - return nil -} - -func (x *ClientConfig) GetOutstandingRpcsPerChannel() int32 { - if x != nil { - return x.OutstandingRpcsPerChannel - } - return 0 -} - -func (x *ClientConfig) GetClientChannels() int32 { - if x != nil { - return x.ClientChannels - } - return 0 -} - -func (x *ClientConfig) GetAsyncClientThreads() int32 { - if x != nil { - return x.AsyncClientThreads - } - return 0 -} - -func (x *ClientConfig) GetRpcType() RpcType { - if x != nil { - return x.RpcType - } - return RpcType_UNARY -} - -func (x *ClientConfig) GetLoadParams() *LoadParams { - if x != nil { - return x.LoadParams - } - return nil -} - -func (x *ClientConfig) GetPayloadConfig() *PayloadConfig { - if x != nil { - return x.PayloadConfig - } - return nil -} - -func (x *ClientConfig) GetHistogramParams() *HistogramParams { - if x != nil { - return x.HistogramParams - } - return nil -} - -func (x *ClientConfig) GetCoreList() []int32 { - if x != nil { - return x.CoreList - } - return nil -} - -func (x *ClientConfig) GetCoreLimit() int32 { - if x != nil { - return x.CoreLimit - } - return 0 -} - -type ClientStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Stats *ClientStats `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"` -} - -func (x *ClientStatus) Reset() { - *x = ClientStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientStatus) ProtoMessage() {} - -func (x *ClientStatus) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientStatus.ProtoReflect.Descriptor instead. -func (*ClientStatus) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{8} -} - -func (x *ClientStatus) GetStats() *ClientStats { - if x != nil { - return x.Stats - } - return nil -} - -// Request current stats -type Mark struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // if true, the stats will be reset after taking their snapshot. - Reset_ bool `protobuf:"varint,1,opt,name=reset,proto3" json:"reset,omitempty"` -} - -func (x *Mark) Reset() { - *x = Mark{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Mark) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Mark) ProtoMessage() {} - -func (x *Mark) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Mark.ProtoReflect.Descriptor instead. -func (*Mark) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{9} -} - -func (x *Mark) GetReset_() bool { - if x != nil { - return x.Reset_ - } - return false -} - -type ClientArgs struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Argtype: - // *ClientArgs_Setup - // *ClientArgs_Mark - Argtype isClientArgs_Argtype `protobuf_oneof:"argtype"` -} - -func (x *ClientArgs) Reset() { - *x = ClientArgs{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientArgs) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientArgs) ProtoMessage() {} - -func (x *ClientArgs) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientArgs.ProtoReflect.Descriptor instead. -func (*ClientArgs) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{10} -} - -func (m *ClientArgs) GetArgtype() isClientArgs_Argtype { - if m != nil { - return m.Argtype - } - return nil -} - -func (x *ClientArgs) GetSetup() *ClientConfig { - if x, ok := x.GetArgtype().(*ClientArgs_Setup); ok { - return x.Setup - } - return nil -} - -func (x *ClientArgs) GetMark() *Mark { - if x, ok := x.GetArgtype().(*ClientArgs_Mark); ok { - return x.Mark - } - return nil -} - -type isClientArgs_Argtype interface { - isClientArgs_Argtype() -} - -type ClientArgs_Setup struct { - Setup *ClientConfig `protobuf:"bytes,1,opt,name=setup,proto3,oneof"` -} - -type ClientArgs_Mark struct { - Mark *Mark `protobuf:"bytes,2,opt,name=mark,proto3,oneof"` -} - -func (*ClientArgs_Setup) isClientArgs_Argtype() {} - -func (*ClientArgs_Mark) isClientArgs_Argtype() {} - -type ServerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServerType ServerType `protobuf:"varint,1,opt,name=server_type,json=serverType,proto3,enum=grpc.testing.ServerType" json:"server_type,omitempty"` - SecurityParams *SecurityParams `protobuf:"bytes,2,opt,name=security_params,json=securityParams,proto3" json:"security_params,omitempty"` - // Port on which to listen. Zero means pick unused port. - Port int32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` - // Only for async server. Number of threads used to serve the requests. - AsyncServerThreads int32 `protobuf:"varint,7,opt,name=async_server_threads,json=asyncServerThreads,proto3" json:"async_server_threads,omitempty"` - // Specify the number of cores to limit server to, if desired - CoreLimit int32 `protobuf:"varint,8,opt,name=core_limit,json=coreLimit,proto3" json:"core_limit,omitempty"` - // payload config, used in generic server - PayloadConfig *PayloadConfig `protobuf:"bytes,9,opt,name=payload_config,json=payloadConfig,proto3" json:"payload_config,omitempty"` - // Specify the cores we should run the server on, if desired - CoreList []int32 `protobuf:"varint,10,rep,packed,name=core_list,json=coreList,proto3" json:"core_list,omitempty"` -} - -func (x *ServerConfig) Reset() { - *x = ServerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerConfig) ProtoMessage() {} - -func (x *ServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. -func (*ServerConfig) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{11} -} - -func (x *ServerConfig) GetServerType() ServerType { - if x != nil { - return x.ServerType - } - return ServerType_SYNC_SERVER -} - -func (x *ServerConfig) GetSecurityParams() *SecurityParams { - if x != nil { - return x.SecurityParams - } - return nil -} - -func (x *ServerConfig) GetPort() int32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *ServerConfig) GetAsyncServerThreads() int32 { - if x != nil { - return x.AsyncServerThreads - } - return 0 -} - -func (x *ServerConfig) GetCoreLimit() int32 { - if x != nil { - return x.CoreLimit - } - return 0 -} - -func (x *ServerConfig) GetPayloadConfig() *PayloadConfig { - if x != nil { - return x.PayloadConfig - } - return nil -} - -func (x *ServerConfig) GetCoreList() []int32 { - if x != nil { - return x.CoreList - } - return nil -} - -type ServerArgs struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Argtype: - // *ServerArgs_Setup - // *ServerArgs_Mark - Argtype isServerArgs_Argtype `protobuf_oneof:"argtype"` -} - -func (x *ServerArgs) Reset() { - *x = ServerArgs{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerArgs) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerArgs) ProtoMessage() {} - -func (x *ServerArgs) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerArgs.ProtoReflect.Descriptor instead. -func (*ServerArgs) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{12} -} - -func (m *ServerArgs) GetArgtype() isServerArgs_Argtype { - if m != nil { - return m.Argtype - } - return nil -} - -func (x *ServerArgs) GetSetup() *ServerConfig { - if x, ok := x.GetArgtype().(*ServerArgs_Setup); ok { - return x.Setup - } - return nil -} - -func (x *ServerArgs) GetMark() *Mark { - if x, ok := x.GetArgtype().(*ServerArgs_Mark); ok { - return x.Mark - } - return nil -} - -type isServerArgs_Argtype interface { - isServerArgs_Argtype() -} - -type ServerArgs_Setup struct { - Setup *ServerConfig `protobuf:"bytes,1,opt,name=setup,proto3,oneof"` -} - -type ServerArgs_Mark struct { - Mark *Mark `protobuf:"bytes,2,opt,name=mark,proto3,oneof"` -} - -func (*ServerArgs_Setup) isServerArgs_Argtype() {} - -func (*ServerArgs_Mark) isServerArgs_Argtype() {} - -type ServerStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Stats *ServerStats `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"` - // the port bound by the server - Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - // Number of cores available to the server - Cores int32 `protobuf:"varint,3,opt,name=cores,proto3" json:"cores,omitempty"` -} - -func (x *ServerStatus) Reset() { - *x = ServerStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerStatus) ProtoMessage() {} - -func (x *ServerStatus) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerStatus.ProtoReflect.Descriptor instead. -func (*ServerStatus) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{13} -} - -func (x *ServerStatus) GetStats() *ServerStats { - if x != nil { - return x.Stats - } - return nil -} - -func (x *ServerStatus) GetPort() int32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *ServerStatus) GetCores() int32 { - if x != nil { - return x.Cores - } - return 0 -} - -type CoreRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CoreRequest) Reset() { - *x = CoreRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CoreRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CoreRequest) ProtoMessage() {} - -func (x *CoreRequest) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CoreRequest.ProtoReflect.Descriptor instead. -func (*CoreRequest) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{14} -} - -type CoreResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Number of cores available on the server - Cores int32 `protobuf:"varint,1,opt,name=cores,proto3" json:"cores,omitempty"` -} - -func (x *CoreResponse) Reset() { - *x = CoreResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CoreResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CoreResponse) ProtoMessage() {} - -func (x *CoreResponse) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CoreResponse.ProtoReflect.Descriptor instead. -func (*CoreResponse) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{15} -} - -func (x *CoreResponse) GetCores() int32 { - if x != nil { - return x.Cores - } - return 0 -} - -type Void struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Void) Reset() { - *x = Void{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Void) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Void) ProtoMessage() {} - -func (x *Void) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Void.ProtoReflect.Descriptor instead. -func (*Void) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{16} -} - -// A single performance scenario: input to qps_json_driver -type Scenario struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Human readable name for this scenario - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Client configuration - ClientConfig *ClientConfig `protobuf:"bytes,2,opt,name=client_config,json=clientConfig,proto3" json:"client_config,omitempty"` - // Number of clients to start for the test - NumClients int32 `protobuf:"varint,3,opt,name=num_clients,json=numClients,proto3" json:"num_clients,omitempty"` - // Server configuration - ServerConfig *ServerConfig `protobuf:"bytes,4,opt,name=server_config,json=serverConfig,proto3" json:"server_config,omitempty"` - // Number of servers to start for the test - NumServers int32 `protobuf:"varint,5,opt,name=num_servers,json=numServers,proto3" json:"num_servers,omitempty"` - // Warmup period, in seconds - WarmupSeconds int32 `protobuf:"varint,6,opt,name=warmup_seconds,json=warmupSeconds,proto3" json:"warmup_seconds,omitempty"` - // Benchmark time, in seconds - BenchmarkSeconds int32 `protobuf:"varint,7,opt,name=benchmark_seconds,json=benchmarkSeconds,proto3" json:"benchmark_seconds,omitempty"` - // Number of workers to spawn locally (usually zero) - SpawnLocalWorkerCount int32 `protobuf:"varint,8,opt,name=spawn_local_worker_count,json=spawnLocalWorkerCount,proto3" json:"spawn_local_worker_count,omitempty"` -} - -func (x *Scenario) Reset() { - *x = Scenario{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Scenario) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Scenario) ProtoMessage() {} - -func (x *Scenario) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Scenario.ProtoReflect.Descriptor instead. -func (*Scenario) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{17} -} - -func (x *Scenario) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Scenario) GetClientConfig() *ClientConfig { - if x != nil { - return x.ClientConfig - } - return nil -} - -func (x *Scenario) GetNumClients() int32 { - if x != nil { - return x.NumClients - } - return 0 -} - -func (x *Scenario) GetServerConfig() *ServerConfig { - if x != nil { - return x.ServerConfig - } - return nil -} - -func (x *Scenario) GetNumServers() int32 { - if x != nil { - return x.NumServers - } - return 0 -} - -func (x *Scenario) GetWarmupSeconds() int32 { - if x != nil { - return x.WarmupSeconds - } - return 0 -} - -func (x *Scenario) GetBenchmarkSeconds() int32 { - if x != nil { - return x.BenchmarkSeconds - } - return 0 -} - -func (x *Scenario) GetSpawnLocalWorkerCount() int32 { - if x != nil { - return x.SpawnLocalWorkerCount - } - return 0 -} - -// A set of scenarios to be run with qps_json_driver -type Scenarios struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Scenarios []*Scenario `protobuf:"bytes,1,rep,name=scenarios,proto3" json:"scenarios,omitempty"` -} - -func (x *Scenarios) Reset() { - *x = Scenarios{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Scenarios) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Scenarios) ProtoMessage() {} - -func (x *Scenarios) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_control_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Scenarios.ProtoReflect.Descriptor instead. -func (*Scenarios) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_control_proto_rawDescGZIP(), []int{18} -} - -func (x *Scenarios) GetScenarios() []*Scenario { - if x != nil { - return x.Scenarios - } - return nil -} - -var File_benchmark_grpc_testing_control_proto protoreflect.FileDescriptor - -var file_benchmark_grpc_testing_control_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x25, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x62, 0x65, 0x6e, - 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x67, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x32, 0x0a, 0x0d, 0x50, 0x6f, 0x69, 0x73, 0x73, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x61, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x65, 0x64, 0x4c, - 0x6f, 0x61, 0x64, 0x22, 0x61, 0x0a, 0x0d, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x72, 0x72, - 0x69, 0x76, 0x61, 0x6c, 0x5f, 0x6c, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x61, 0x72, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x4c, 0x6f, 0x12, 0x27, 0x0a, - 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x72, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x5f, 0x68, 0x69, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x72, 0x72, - 0x69, 0x76, 0x61, 0x6c, 0x48, 0x69, 0x22, 0x38, 0x0a, 0x13, 0x44, 0x65, 0x74, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x69, 0x73, 0x74, 0x69, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x0a, - 0x0c, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x65, 0x64, 0x4c, 0x6f, 0x61, 0x64, - 0x22, 0x51, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x65, 0x74, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x72, 0x72, 0x69, 0x76, 0x61, 0x6c, - 0x5f, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x61, 0x72, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x42, 0x61, 0x73, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x22, 0x12, 0x0a, 0x10, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x4c, 0x6f, 0x6f, - 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xbc, 0x02, 0x0a, 0x0a, 0x4c, 0x6f, 0x61, 0x64, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, - 0x5f, 0x6c, 0x6f, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, - 0x64, 0x4c, 0x6f, 0x6f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x63, - 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x4c, 0x6f, 0x6f, 0x70, 0x12, 0x37, 0x0a, 0x07, 0x70, 0x6f, 0x69, - 0x73, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x6f, 0x69, 0x73, 0x73, 0x6f, - 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x07, 0x70, 0x6f, 0x69, 0x73, 0x73, - 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x2e, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x48, 0x00, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x3b, 0x0a, 0x06, 0x64, - 0x65, 0x74, 0x65, 0x72, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x74, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x69, 0x73, 0x74, 0x69, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, - 0x52, 0x06, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, - 0x74, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x65, 0x74, 0x6f, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x74, 0x6f, 0x42, 0x06, - 0x0a, 0x04, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x62, 0x0a, 0x0e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x5f, - 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, - 0x73, 0x65, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x6f, - 0x73, 0x74, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x22, 0x8a, 0x05, 0x0a, 0x0c, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x45, 0x0a, - 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3f, 0x0a, 0x1c, 0x6f, 0x75, 0x74, 0x73, 0x74, 0x61, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x61, - 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x19, 0x6f, 0x75, 0x74, 0x73, - 0x74, 0x61, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x70, 0x63, 0x73, 0x50, 0x65, 0x72, 0x43, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, - 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, 0x30, - 0x0a, 0x14, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, - 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x61, 0x73, - 0x79, 0x6e, 0x63, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, - 0x12, 0x30, 0x0a, 0x08, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x2e, 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x72, 0x70, 0x63, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x0a, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x42, 0x0a, - 0x0e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x48, 0x0a, 0x10, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, - 0x67, 0x72, 0x61, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0f, 0x68, 0x69, 0x73, 0x74, - 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, - 0x6f, 0x72, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, - 0x63, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x72, 0x65, - 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6f, - 0x72, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x3f, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x22, 0x1c, 0x0a, 0x04, 0x4d, 0x61, 0x72, 0x6b, - 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x05, 0x72, 0x65, 0x73, 0x65, 0x74, 0x22, 0x75, 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x41, 0x72, 0x67, 0x73, 0x12, 0x32, 0x0a, 0x05, 0x73, 0x65, 0x74, 0x75, 0x70, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, - 0x00, 0x52, 0x05, 0x73, 0x65, 0x74, 0x75, 0x70, 0x12, 0x28, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x61, - 0x72, 0x6b, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x72, 0x67, 0x74, 0x79, 0x70, 0x65, 0x22, 0xd6, 0x02, - 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x39, - 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x45, 0x0a, 0x0f, 0x73, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, - 0x70, 0x6f, 0x72, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x12, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, - 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6f, 0x72, 0x65, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x42, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x72, - 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f, - 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x75, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x41, 0x72, 0x67, 0x73, 0x12, 0x32, 0x0a, 0x05, 0x73, 0x65, 0x74, 0x75, 0x70, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, - 0x00, 0x52, 0x05, 0x73, 0x65, 0x74, 0x75, 0x70, 0x12, 0x28, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x61, - 0x72, 0x6b, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x72, 0x67, 0x74, 0x79, 0x70, 0x65, 0x22, 0x69, 0x0a, - 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2f, 0x0a, - 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, - 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x22, 0x0d, 0x0a, 0x0b, 0x43, 0x6f, 0x72, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x24, 0x0a, 0x0c, 0x43, 0x6f, 0x72, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x72, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x22, 0x06, 0x0a, - 0x04, 0x56, 0x6f, 0x69, 0x64, 0x22, 0xef, 0x02, 0x0a, 0x08, 0x53, 0x63, 0x65, 0x6e, 0x61, 0x72, - 0x69, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x75, 0x6d, 0x5f, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6e, 0x75, - 0x6d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x75, 0x6d, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, - 0x6e, 0x75, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x61, - 0x72, 0x6d, 0x75, 0x70, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0d, 0x77, 0x61, 0x72, 0x6d, 0x75, 0x70, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, - 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x73, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x62, 0x65, - 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x37, - 0x0a, 0x18, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x77, 0x6f, - 0x72, 0x6b, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x15, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x57, 0x6f, 0x72, 0x6b, - 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x41, 0x0a, 0x09, 0x53, 0x63, 0x65, 0x6e, 0x61, - 0x72, 0x69, 0x6f, 0x73, 0x12, 0x34, 0x0a, 0x09, 0x73, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, 0x52, - 0x09, 0x73, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, 0x73, 0x2a, 0x2f, 0x0a, 0x0a, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x59, 0x4e, 0x43, - 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x53, 0x59, - 0x4e, 0x43, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x2a, 0x49, 0x0a, 0x0a, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x59, 0x4e, - 0x43, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x53, - 0x59, 0x4e, 0x43, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, - 0x41, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x49, 0x43, 0x5f, 0x53, 0x45, - 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x2a, 0x23, 0x0a, 0x07, 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, - 0x53, 0x54, 0x52, 0x45, 0x41, 0x4d, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x42, 0x2f, 0x5a, 0x2d, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_benchmark_grpc_testing_control_proto_rawDescOnce sync.Once - file_benchmark_grpc_testing_control_proto_rawDescData = file_benchmark_grpc_testing_control_proto_rawDesc -) - -func file_benchmark_grpc_testing_control_proto_rawDescGZIP() []byte { - file_benchmark_grpc_testing_control_proto_rawDescOnce.Do(func() { - file_benchmark_grpc_testing_control_proto_rawDescData = protoimpl.X.CompressGZIP(file_benchmark_grpc_testing_control_proto_rawDescData) - }) - return file_benchmark_grpc_testing_control_proto_rawDescData -} - -var file_benchmark_grpc_testing_control_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_benchmark_grpc_testing_control_proto_msgTypes = make([]protoimpl.MessageInfo, 19) -var file_benchmark_grpc_testing_control_proto_goTypes = []interface{}{ - (ClientType)(0), // 0: grpc.testing.ClientType - (ServerType)(0), // 1: grpc.testing.ServerType - (RpcType)(0), // 2: grpc.testing.RpcType - (*PoissonParams)(nil), // 3: grpc.testing.PoissonParams - (*UniformParams)(nil), // 4: grpc.testing.UniformParams - (*DeterministicParams)(nil), // 5: grpc.testing.DeterministicParams - (*ParetoParams)(nil), // 6: grpc.testing.ParetoParams - (*ClosedLoopParams)(nil), // 7: grpc.testing.ClosedLoopParams - (*LoadParams)(nil), // 8: grpc.testing.LoadParams - (*SecurityParams)(nil), // 9: grpc.testing.SecurityParams - (*ClientConfig)(nil), // 10: grpc.testing.ClientConfig - (*ClientStatus)(nil), // 11: grpc.testing.ClientStatus - (*Mark)(nil), // 12: grpc.testing.Mark - (*ClientArgs)(nil), // 13: grpc.testing.ClientArgs - (*ServerConfig)(nil), // 14: grpc.testing.ServerConfig - (*ServerArgs)(nil), // 15: grpc.testing.ServerArgs - (*ServerStatus)(nil), // 16: grpc.testing.ServerStatus - (*CoreRequest)(nil), // 17: grpc.testing.CoreRequest - (*CoreResponse)(nil), // 18: grpc.testing.CoreResponse - (*Void)(nil), // 19: grpc.testing.Void - (*Scenario)(nil), // 20: grpc.testing.Scenario - (*Scenarios)(nil), // 21: grpc.testing.Scenarios - (*PayloadConfig)(nil), // 22: grpc.testing.PayloadConfig - (*HistogramParams)(nil), // 23: grpc.testing.HistogramParams - (*ClientStats)(nil), // 24: grpc.testing.ClientStats - (*ServerStats)(nil), // 25: grpc.testing.ServerStats -} -var file_benchmark_grpc_testing_control_proto_depIdxs = []int32{ - 7, // 0: grpc.testing.LoadParams.closed_loop:type_name -> grpc.testing.ClosedLoopParams - 3, // 1: grpc.testing.LoadParams.poisson:type_name -> grpc.testing.PoissonParams - 4, // 2: grpc.testing.LoadParams.uniform:type_name -> grpc.testing.UniformParams - 5, // 3: grpc.testing.LoadParams.determ:type_name -> grpc.testing.DeterministicParams - 6, // 4: grpc.testing.LoadParams.pareto:type_name -> grpc.testing.ParetoParams - 0, // 5: grpc.testing.ClientConfig.client_type:type_name -> grpc.testing.ClientType - 9, // 6: grpc.testing.ClientConfig.security_params:type_name -> grpc.testing.SecurityParams - 2, // 7: grpc.testing.ClientConfig.rpc_type:type_name -> grpc.testing.RpcType - 8, // 8: grpc.testing.ClientConfig.load_params:type_name -> grpc.testing.LoadParams - 22, // 9: grpc.testing.ClientConfig.payload_config:type_name -> grpc.testing.PayloadConfig - 23, // 10: grpc.testing.ClientConfig.histogram_params:type_name -> grpc.testing.HistogramParams - 24, // 11: grpc.testing.ClientStatus.stats:type_name -> grpc.testing.ClientStats - 10, // 12: grpc.testing.ClientArgs.setup:type_name -> grpc.testing.ClientConfig - 12, // 13: grpc.testing.ClientArgs.mark:type_name -> grpc.testing.Mark - 1, // 14: grpc.testing.ServerConfig.server_type:type_name -> grpc.testing.ServerType - 9, // 15: grpc.testing.ServerConfig.security_params:type_name -> grpc.testing.SecurityParams - 22, // 16: grpc.testing.ServerConfig.payload_config:type_name -> grpc.testing.PayloadConfig - 14, // 17: grpc.testing.ServerArgs.setup:type_name -> grpc.testing.ServerConfig - 12, // 18: grpc.testing.ServerArgs.mark:type_name -> grpc.testing.Mark - 25, // 19: grpc.testing.ServerStatus.stats:type_name -> grpc.testing.ServerStats - 10, // 20: grpc.testing.Scenario.client_config:type_name -> grpc.testing.ClientConfig - 14, // 21: grpc.testing.Scenario.server_config:type_name -> grpc.testing.ServerConfig - 20, // 22: grpc.testing.Scenarios.scenarios:type_name -> grpc.testing.Scenario - 23, // [23:23] is the sub-list for method output_type - 23, // [23:23] is the sub-list for method input_type - 23, // [23:23] is the sub-list for extension type_name - 23, // [23:23] is the sub-list for extension extendee - 0, // [0:23] is the sub-list for field type_name -} - -func init() { file_benchmark_grpc_testing_control_proto_init() } -func file_benchmark_grpc_testing_control_proto_init() { - if File_benchmark_grpc_testing_control_proto != nil { - return - } - file_benchmark_grpc_testing_payloads_proto_init() - file_benchmark_grpc_testing_stats_proto_init() - if !protoimpl.UnsafeEnabled { - file_benchmark_grpc_testing_control_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PoissonParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UniformParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeterministicParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParetoParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClosedLoopParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecurityParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Mark); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientArgs); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerArgs); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CoreRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CoreResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Void); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Scenario); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Scenarios); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_benchmark_grpc_testing_control_proto_msgTypes[5].OneofWrappers = []interface{}{ - (*LoadParams_ClosedLoop)(nil), - (*LoadParams_Poisson)(nil), - (*LoadParams_Uniform)(nil), - (*LoadParams_Determ)(nil), - (*LoadParams_Pareto)(nil), - } - file_benchmark_grpc_testing_control_proto_msgTypes[10].OneofWrappers = []interface{}{ - (*ClientArgs_Setup)(nil), - (*ClientArgs_Mark)(nil), - } - file_benchmark_grpc_testing_control_proto_msgTypes[12].OneofWrappers = []interface{}{ - (*ServerArgs_Setup)(nil), - (*ServerArgs_Mark)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_benchmark_grpc_testing_control_proto_rawDesc, - NumEnums: 3, - NumMessages: 19, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_benchmark_grpc_testing_control_proto_goTypes, - DependencyIndexes: file_benchmark_grpc_testing_control_proto_depIdxs, - EnumInfos: file_benchmark_grpc_testing_control_proto_enumTypes, - MessageInfos: file_benchmark_grpc_testing_control_proto_msgTypes, - }.Build() - File_benchmark_grpc_testing_control_proto = out.File - file_benchmark_grpc_testing_control_proto_rawDesc = nil - file_benchmark_grpc_testing_control_proto_goTypes = nil - file_benchmark_grpc_testing_control_proto_depIdxs = nil -} diff --git a/benchmark/grpc_testing/control.proto b/benchmark/grpc_testing/control.proto deleted file mode 100644 index e9ee3484d19f..000000000000 --- a/benchmark/grpc_testing/control.proto +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -option go_package = "google.golang.org/grpc/benchmark/grpc_testing"; - -import "benchmark/grpc_testing/payloads.proto"; -import "benchmark/grpc_testing/stats.proto"; - -package grpc.testing; - -enum ClientType { - SYNC_CLIENT = 0; - ASYNC_CLIENT = 1; -} - -enum ServerType { - SYNC_SERVER = 0; - ASYNC_SERVER = 1; - ASYNC_GENERIC_SERVER = 2; -} - -enum RpcType { - UNARY = 0; - STREAMING = 1; -} - -// Parameters of poisson process distribution, which is a good representation -// of activity coming in from independent identical stationary sources. -message PoissonParams { - // The rate of arrivals (a.k.a. lambda parameter of the exp distribution). - double offered_load = 1; -} - -message UniformParams { - double interarrival_lo = 1; - double interarrival_hi = 2; -} - -message DeterministicParams { - double offered_load = 1; -} - -message ParetoParams { - double interarrival_base = 1; - double alpha = 2; -} - -// Once an RPC finishes, immediately start a new one. -// No configuration parameters needed. -message ClosedLoopParams { -} - -message LoadParams { - oneof load { - ClosedLoopParams closed_loop = 1; - PoissonParams poisson = 2; - UniformParams uniform = 3; - DeterministicParams determ = 4; - ParetoParams pareto = 5; - }; -} - -// presence of SecurityParams implies use of TLS -message SecurityParams { - bool use_test_ca = 1; - string server_host_override = 2; -} - -message ClientConfig { - // List of targets to connect to. At least one target needs to be specified. - repeated string server_targets = 1; - ClientType client_type = 2; - SecurityParams security_params = 3; - // How many concurrent RPCs to start for each channel. - // For synchronous client, use a separate thread for each outstanding RPC. - int32 outstanding_rpcs_per_channel = 4; - // Number of independent client channels to create. - // i-th channel will connect to server_target[i % server_targets.size()] - int32 client_channels = 5; - // Only for async client. Number of threads to use to start/manage RPCs. - int32 async_client_threads = 7; - RpcType rpc_type = 8; - // The requested load for the entire client (aggregated over all the threads). - LoadParams load_params = 10; - PayloadConfig payload_config = 11; - HistogramParams histogram_params = 12; - - // Specify the cores we should run the client on, if desired - repeated int32 core_list = 13; - int32 core_limit = 14; -} - -message ClientStatus { - ClientStats stats = 1; -} - -// Request current stats -message Mark { - // if true, the stats will be reset after taking their snapshot. - bool reset = 1; -} - -message ClientArgs { - oneof argtype { - ClientConfig setup = 1; - Mark mark = 2; - } -} - -message ServerConfig { - ServerType server_type = 1; - SecurityParams security_params = 2; - // Port on which to listen. Zero means pick unused port. - int32 port = 4; - // Only for async server. Number of threads used to serve the requests. - int32 async_server_threads = 7; - // Specify the number of cores to limit server to, if desired - int32 core_limit = 8; - // payload config, used in generic server - PayloadConfig payload_config = 9; - - // Specify the cores we should run the server on, if desired - repeated int32 core_list = 10; -} - -message ServerArgs { - oneof argtype { - ServerConfig setup = 1; - Mark mark = 2; - } -} - -message ServerStatus { - ServerStats stats = 1; - // the port bound by the server - int32 port = 2; - // Number of cores available to the server - int32 cores = 3; -} - -message CoreRequest { -} - -message CoreResponse { - // Number of cores available on the server - int32 cores = 1; -} - -message Void { -} - -// A single performance scenario: input to qps_json_driver -message Scenario { - // Human readable name for this scenario - string name = 1; - // Client configuration - ClientConfig client_config = 2; - // Number of clients to start for the test - int32 num_clients = 3; - // Server configuration - ServerConfig server_config = 4; - // Number of servers to start for the test - int32 num_servers = 5; - // Warmup period, in seconds - int32 warmup_seconds = 6; - // Benchmark time, in seconds - int32 benchmark_seconds = 7; - // Number of workers to spawn locally (usually zero) - int32 spawn_local_worker_count = 8; -} - -// A set of scenarios to be run with qps_json_driver -message Scenarios { - repeated Scenario scenarios = 1; -} diff --git a/benchmark/grpc_testing/messages.pb.go b/benchmark/grpc_testing/messages.pb.go deleted file mode 100644 index eb6e2975b326..000000000000 --- a/benchmark/grpc_testing/messages.pb.go +++ /dev/null @@ -1,1160 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Message definitions to be used by integration test service definitions. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.14.0 -// source: benchmark/grpc_testing/messages.proto - -package grpc_testing - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// The type of payload that should be returned. -type PayloadType int32 - -const ( - // Compressable text format. - PayloadType_COMPRESSABLE PayloadType = 0 - // Uncompressable binary format. - PayloadType_UNCOMPRESSABLE PayloadType = 1 - // Randomly chosen from all other formats defined in this enum. - PayloadType_RANDOM PayloadType = 2 -) - -// Enum value maps for PayloadType. -var ( - PayloadType_name = map[int32]string{ - 0: "COMPRESSABLE", - 1: "UNCOMPRESSABLE", - 2: "RANDOM", - } - PayloadType_value = map[string]int32{ - "COMPRESSABLE": 0, - "UNCOMPRESSABLE": 1, - "RANDOM": 2, - } -) - -func (x PayloadType) Enum() *PayloadType { - p := new(PayloadType) - *p = x - return p -} - -func (x PayloadType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PayloadType) Descriptor() protoreflect.EnumDescriptor { - return file_benchmark_grpc_testing_messages_proto_enumTypes[0].Descriptor() -} - -func (PayloadType) Type() protoreflect.EnumType { - return &file_benchmark_grpc_testing_messages_proto_enumTypes[0] -} - -func (x PayloadType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PayloadType.Descriptor instead. -func (PayloadType) EnumDescriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{0} -} - -// Compression algorithms -type CompressionType int32 - -const ( - // No compression - CompressionType_NONE CompressionType = 0 - CompressionType_GZIP CompressionType = 1 - CompressionType_DEFLATE CompressionType = 2 -) - -// Enum value maps for CompressionType. -var ( - CompressionType_name = map[int32]string{ - 0: "NONE", - 1: "GZIP", - 2: "DEFLATE", - } - CompressionType_value = map[string]int32{ - "NONE": 0, - "GZIP": 1, - "DEFLATE": 2, - } -) - -func (x CompressionType) Enum() *CompressionType { - p := new(CompressionType) - *p = x - return p -} - -func (x CompressionType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CompressionType) Descriptor() protoreflect.EnumDescriptor { - return file_benchmark_grpc_testing_messages_proto_enumTypes[1].Descriptor() -} - -func (CompressionType) Type() protoreflect.EnumType { - return &file_benchmark_grpc_testing_messages_proto_enumTypes[1] -} - -func (x CompressionType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CompressionType.Descriptor instead. -func (CompressionType) EnumDescriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{1} -} - -// A block of data, to simply increase gRPC message size. -type Payload struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The type of data in body. - Type PayloadType `protobuf:"varint,1,opt,name=type,proto3,enum=grpc.testing.PayloadType" json:"type,omitempty"` - // Primary contents of payload. - Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` -} - -func (x *Payload) Reset() { - *x = Payload{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Payload) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Payload) ProtoMessage() {} - -func (x *Payload) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Payload.ProtoReflect.Descriptor instead. -func (*Payload) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{0} -} - -func (x *Payload) GetType() PayloadType { - if x != nil { - return x.Type - } - return PayloadType_COMPRESSABLE -} - -func (x *Payload) GetBody() []byte { - if x != nil { - return x.Body - } - return nil -} - -// A protobuf representation for grpc status. This is used by test -// clients to specify a status that the server should attempt to return. -type EchoStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *EchoStatus) Reset() { - *x = EchoStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EchoStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EchoStatus) ProtoMessage() {} - -func (x *EchoStatus) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EchoStatus.ProtoReflect.Descriptor instead. -func (*EchoStatus) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{1} -} - -func (x *EchoStatus) GetCode() int32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *EchoStatus) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -// Unary request. -type SimpleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,proto3,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` - // Desired payload size in the response from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - ResponseSize int32 `protobuf:"varint,2,opt,name=response_size,json=responseSize,proto3" json:"response_size,omitempty"` - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - // Whether SimpleResponse should include username. - FillUsername bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername,proto3" json:"fill_username,omitempty"` - // Whether SimpleResponse should include OAuth scope. - FillOauthScope bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope,proto3" json:"fill_oauth_scope,omitempty"` - // Compression algorithm to be used by the server for the response (stream) - ResponseCompression CompressionType `protobuf:"varint,6,opt,name=response_compression,json=responseCompression,proto3,enum=grpc.testing.CompressionType" json:"response_compression,omitempty"` - // Whether server should return a given status - ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` -} - -func (x *SimpleRequest) Reset() { - *x = SimpleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SimpleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SimpleRequest) ProtoMessage() {} - -func (x *SimpleRequest) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SimpleRequest.ProtoReflect.Descriptor instead. -func (*SimpleRequest) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{2} -} - -func (x *SimpleRequest) GetResponseType() PayloadType { - if x != nil { - return x.ResponseType - } - return PayloadType_COMPRESSABLE -} - -func (x *SimpleRequest) GetResponseSize() int32 { - if x != nil { - return x.ResponseSize - } - return 0 -} - -func (x *SimpleRequest) GetPayload() *Payload { - if x != nil { - return x.Payload - } - return nil -} - -func (x *SimpleRequest) GetFillUsername() bool { - if x != nil { - return x.FillUsername - } - return false -} - -func (x *SimpleRequest) GetFillOauthScope() bool { - if x != nil { - return x.FillOauthScope - } - return false -} - -func (x *SimpleRequest) GetResponseCompression() CompressionType { - if x != nil { - return x.ResponseCompression - } - return CompressionType_NONE -} - -func (x *SimpleRequest) GetResponseStatus() *EchoStatus { - if x != nil { - return x.ResponseStatus - } - return nil -} - -// Unary response, as configured by the request. -type SimpleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Payload to increase message size. - Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - // The user the request came from, for verifying authentication was - // successful when the client expected it. - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` - // OAuth scope. - OauthScope string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope,proto3" json:"oauth_scope,omitempty"` -} - -func (x *SimpleResponse) Reset() { - *x = SimpleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SimpleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SimpleResponse) ProtoMessage() {} - -func (x *SimpleResponse) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SimpleResponse.ProtoReflect.Descriptor instead. -func (*SimpleResponse) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{3} -} - -func (x *SimpleResponse) GetPayload() *Payload { - if x != nil { - return x.Payload - } - return nil -} - -func (x *SimpleResponse) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *SimpleResponse) GetOauthScope() string { - if x != nil { - return x.OauthScope - } - return "" -} - -// Client-streaming request. -type StreamingInputCallRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (x *StreamingInputCallRequest) Reset() { - *x = StreamingInputCallRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StreamingInputCallRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StreamingInputCallRequest) ProtoMessage() {} - -func (x *StreamingInputCallRequest) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StreamingInputCallRequest.ProtoReflect.Descriptor instead. -func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{4} -} - -func (x *StreamingInputCallRequest) GetPayload() *Payload { - if x != nil { - return x.Payload - } - return nil -} - -// Client-streaming response. -type StreamingInputCallResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Aggregated size of payloads received from the client. - AggregatedPayloadSize int32 `protobuf:"varint,1,opt,name=aggregated_payload_size,json=aggregatedPayloadSize,proto3" json:"aggregated_payload_size,omitempty"` -} - -func (x *StreamingInputCallResponse) Reset() { - *x = StreamingInputCallResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StreamingInputCallResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StreamingInputCallResponse) ProtoMessage() {} - -func (x *StreamingInputCallResponse) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StreamingInputCallResponse.ProtoReflect.Descriptor instead. -func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{5} -} - -func (x *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 { - if x != nil { - return x.AggregatedPayloadSize - } - return 0 -} - -// Configuration for a particular response. -type ResponseParameters struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Desired payload sizes in responses from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - Size int32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` - // Desired interval between consecutive responses in the response stream in - // microseconds. - IntervalUs int32 `protobuf:"varint,2,opt,name=interval_us,json=intervalUs,proto3" json:"interval_us,omitempty"` -} - -func (x *ResponseParameters) Reset() { - *x = ResponseParameters{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResponseParameters) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResponseParameters) ProtoMessage() {} - -func (x *ResponseParameters) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResponseParameters.ProtoReflect.Descriptor instead. -func (*ResponseParameters) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{6} -} - -func (x *ResponseParameters) GetSize() int32 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *ResponseParameters) GetIntervalUs() int32 { - if x != nil { - return x.IntervalUs - } - return 0 -} - -// Server-streaming request. -type StreamingOutputCallRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Desired payload type in the response from the server. - // If response_type is RANDOM, the payload from each response in the stream - // might be of different types. This is to simulate a mixed type of payload - // stream. - ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,proto3,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` - // Configuration for each expected response message. - ResponseParameters []*ResponseParameters `protobuf:"bytes,2,rep,name=response_parameters,json=responseParameters,proto3" json:"response_parameters,omitempty"` - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - // Compression algorithm to be used by the server for the response (stream) - ResponseCompression CompressionType `protobuf:"varint,6,opt,name=response_compression,json=responseCompression,proto3,enum=grpc.testing.CompressionType" json:"response_compression,omitempty"` - // Whether server should return a given status - ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` -} - -func (x *StreamingOutputCallRequest) Reset() { - *x = StreamingOutputCallRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StreamingOutputCallRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StreamingOutputCallRequest) ProtoMessage() {} - -func (x *StreamingOutputCallRequest) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StreamingOutputCallRequest.ProtoReflect.Descriptor instead. -func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{7} -} - -func (x *StreamingOutputCallRequest) GetResponseType() PayloadType { - if x != nil { - return x.ResponseType - } - return PayloadType_COMPRESSABLE -} - -func (x *StreamingOutputCallRequest) GetResponseParameters() []*ResponseParameters { - if x != nil { - return x.ResponseParameters - } - return nil -} - -func (x *StreamingOutputCallRequest) GetPayload() *Payload { - if x != nil { - return x.Payload - } - return nil -} - -func (x *StreamingOutputCallRequest) GetResponseCompression() CompressionType { - if x != nil { - return x.ResponseCompression - } - return CompressionType_NONE -} - -func (x *StreamingOutputCallRequest) GetResponseStatus() *EchoStatus { - if x != nil { - return x.ResponseStatus - } - return nil -} - -// Server-streaming response, as configured by the request and parameters. -type StreamingOutputCallResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Payload to increase response size. - Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (x *StreamingOutputCallResponse) Reset() { - *x = StreamingOutputCallResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StreamingOutputCallResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StreamingOutputCallResponse) ProtoMessage() {} - -func (x *StreamingOutputCallResponse) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StreamingOutputCallResponse.ProtoReflect.Descriptor instead. -func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{8} -} - -func (x *StreamingOutputCallResponse) GetPayload() *Payload { - if x != nil { - return x.Payload - } - return nil -} - -// For reconnect interop test only. -// Client tells server what reconnection parameters it used. -type ReconnectParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MaxReconnectBackoffMs int32 `protobuf:"varint,1,opt,name=max_reconnect_backoff_ms,json=maxReconnectBackoffMs,proto3" json:"max_reconnect_backoff_ms,omitempty"` -} - -func (x *ReconnectParams) Reset() { - *x = ReconnectParams{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReconnectParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReconnectParams) ProtoMessage() {} - -func (x *ReconnectParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReconnectParams.ProtoReflect.Descriptor instead. -func (*ReconnectParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{9} -} - -func (x *ReconnectParams) GetMaxReconnectBackoffMs() int32 { - if x != nil { - return x.MaxReconnectBackoffMs - } - return 0 -} - -// For reconnect interop test only. -// Server tells client whether its reconnects are following the spec and the -// reconnect backoffs it saw. -type ReconnectInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Passed bool `protobuf:"varint,1,opt,name=passed,proto3" json:"passed,omitempty"` - BackoffMs []int32 `protobuf:"varint,2,rep,packed,name=backoff_ms,json=backoffMs,proto3" json:"backoff_ms,omitempty"` -} - -func (x *ReconnectInfo) Reset() { - *x = ReconnectInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReconnectInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReconnectInfo) ProtoMessage() {} - -func (x *ReconnectInfo) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_messages_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReconnectInfo.ProtoReflect.Descriptor instead. -func (*ReconnectInfo) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_messages_proto_rawDescGZIP(), []int{10} -} - -func (x *ReconnectInfo) GetPassed() bool { - if x != nil { - return x.Passed - } - return false -} - -func (x *ReconnectInfo) GetBackoffMs() []int32 { - if x != nil { - return x.BackoffMs - } - return nil -} - -var File_benchmark_grpc_testing_messages_proto protoreflect.FileDescriptor - -var file_benchmark_grpc_testing_messages_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x4c, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x22, 0x3a, 0x0a, 0x0a, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, - 0x89, 0x03, 0x0a, 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x6c, 0x5f, - 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, - 0x66, 0x69, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x10, - 0x66, 0x69, 0x6c, 0x6c, 0x5f, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x6c, 0x4f, 0x61, 0x75, 0x74, - 0x68, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x50, 0x0a, 0x14, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x13, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6d, - 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, - 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x7e, 0x0a, 0x0e, 0x53, - 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, - 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1a, - 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x61, - 0x75, 0x74, 0x68, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x22, 0x4c, 0x0a, 0x19, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, - 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x54, 0x0a, 0x1a, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x22, - 0x49, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x5f, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x55, 0x73, 0x22, 0xf5, 0x02, 0x0a, 0x1a, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, - 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x51, 0x0a, 0x13, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2f, 0x0a, 0x07, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x50, 0x0a, - 0x14, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x72, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x13, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x41, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0x4e, 0x0a, 0x1b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x22, 0x4a, 0x0a, 0x0f, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x5f, 0x6d, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x4d, 0x73, 0x22, 0x46, - 0x0a, 0x0d, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x16, 0x0a, 0x06, 0x70, 0x61, 0x73, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x70, 0x61, 0x73, 0x73, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x6f, - 0x66, 0x66, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x62, 0x61, 0x63, - 0x6b, 0x6f, 0x66, 0x66, 0x4d, 0x73, 0x2a, 0x3f, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, - 0x53, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x43, 0x4f, 0x4d, - 0x50, 0x52, 0x45, 0x53, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x52, - 0x41, 0x4e, 0x44, 0x4f, 0x4d, 0x10, 0x02, 0x2a, 0x32, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x70, 0x72, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, - 0x4e, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x47, 0x5a, 0x49, 0x50, 0x10, 0x01, 0x12, 0x0b, - 0x0a, 0x07, 0x44, 0x45, 0x46, 0x4c, 0x41, 0x54, 0x45, 0x10, 0x02, 0x42, 0x2f, 0x5a, 0x2d, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_benchmark_grpc_testing_messages_proto_rawDescOnce sync.Once - file_benchmark_grpc_testing_messages_proto_rawDescData = file_benchmark_grpc_testing_messages_proto_rawDesc -) - -func file_benchmark_grpc_testing_messages_proto_rawDescGZIP() []byte { - file_benchmark_grpc_testing_messages_proto_rawDescOnce.Do(func() { - file_benchmark_grpc_testing_messages_proto_rawDescData = protoimpl.X.CompressGZIP(file_benchmark_grpc_testing_messages_proto_rawDescData) - }) - return file_benchmark_grpc_testing_messages_proto_rawDescData -} - -var file_benchmark_grpc_testing_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_benchmark_grpc_testing_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_benchmark_grpc_testing_messages_proto_goTypes = []interface{}{ - (PayloadType)(0), // 0: grpc.testing.PayloadType - (CompressionType)(0), // 1: grpc.testing.CompressionType - (*Payload)(nil), // 2: grpc.testing.Payload - (*EchoStatus)(nil), // 3: grpc.testing.EchoStatus - (*SimpleRequest)(nil), // 4: grpc.testing.SimpleRequest - (*SimpleResponse)(nil), // 5: grpc.testing.SimpleResponse - (*StreamingInputCallRequest)(nil), // 6: grpc.testing.StreamingInputCallRequest - (*StreamingInputCallResponse)(nil), // 7: grpc.testing.StreamingInputCallResponse - (*ResponseParameters)(nil), // 8: grpc.testing.ResponseParameters - (*StreamingOutputCallRequest)(nil), // 9: grpc.testing.StreamingOutputCallRequest - (*StreamingOutputCallResponse)(nil), // 10: grpc.testing.StreamingOutputCallResponse - (*ReconnectParams)(nil), // 11: grpc.testing.ReconnectParams - (*ReconnectInfo)(nil), // 12: grpc.testing.ReconnectInfo -} -var file_benchmark_grpc_testing_messages_proto_depIdxs = []int32{ - 0, // 0: grpc.testing.Payload.type:type_name -> grpc.testing.PayloadType - 0, // 1: grpc.testing.SimpleRequest.response_type:type_name -> grpc.testing.PayloadType - 2, // 2: grpc.testing.SimpleRequest.payload:type_name -> grpc.testing.Payload - 1, // 3: grpc.testing.SimpleRequest.response_compression:type_name -> grpc.testing.CompressionType - 3, // 4: grpc.testing.SimpleRequest.response_status:type_name -> grpc.testing.EchoStatus - 2, // 5: grpc.testing.SimpleResponse.payload:type_name -> grpc.testing.Payload - 2, // 6: grpc.testing.StreamingInputCallRequest.payload:type_name -> grpc.testing.Payload - 0, // 7: grpc.testing.StreamingOutputCallRequest.response_type:type_name -> grpc.testing.PayloadType - 8, // 8: grpc.testing.StreamingOutputCallRequest.response_parameters:type_name -> grpc.testing.ResponseParameters - 2, // 9: grpc.testing.StreamingOutputCallRequest.payload:type_name -> grpc.testing.Payload - 1, // 10: grpc.testing.StreamingOutputCallRequest.response_compression:type_name -> grpc.testing.CompressionType - 3, // 11: grpc.testing.StreamingOutputCallRequest.response_status:type_name -> grpc.testing.EchoStatus - 2, // 12: grpc.testing.StreamingOutputCallResponse.payload:type_name -> grpc.testing.Payload - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_benchmark_grpc_testing_messages_proto_init() } -func file_benchmark_grpc_testing_messages_proto_init() { - if File_benchmark_grpc_testing_messages_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_benchmark_grpc_testing_messages_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Payload); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_messages_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EchoStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_messages_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SimpleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_messages_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SimpleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_messages_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamingInputCallRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_messages_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamingInputCallResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_messages_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResponseParameters); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_messages_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamingOutputCallRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_messages_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamingOutputCallResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_messages_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReconnectParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_messages_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReconnectInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_benchmark_grpc_testing_messages_proto_rawDesc, - NumEnums: 2, - NumMessages: 11, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_benchmark_grpc_testing_messages_proto_goTypes, - DependencyIndexes: file_benchmark_grpc_testing_messages_proto_depIdxs, - EnumInfos: file_benchmark_grpc_testing_messages_proto_enumTypes, - MessageInfos: file_benchmark_grpc_testing_messages_proto_msgTypes, - }.Build() - File_benchmark_grpc_testing_messages_proto = out.File - file_benchmark_grpc_testing_messages_proto_rawDesc = nil - file_benchmark_grpc_testing_messages_proto_goTypes = nil - file_benchmark_grpc_testing_messages_proto_depIdxs = nil -} diff --git a/benchmark/grpc_testing/messages.proto b/benchmark/grpc_testing/messages.proto deleted file mode 100644 index c48cdae9a29e..000000000000 --- a/benchmark/grpc_testing/messages.proto +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Message definitions to be used by integration test service definitions. - -syntax = "proto3"; - -option go_package = "google.golang.org/grpc/benchmark/grpc_testing"; - -package grpc.testing; - -// The type of payload that should be returned. -enum PayloadType { - // Compressable text format. - COMPRESSABLE = 0; - - // Uncompressable binary format. - UNCOMPRESSABLE = 1; - - // Randomly chosen from all other formats defined in this enum. - RANDOM = 2; -} - -// Compression algorithms -enum CompressionType { - // No compression - NONE = 0; - GZIP = 1; - DEFLATE = 2; -} - -// A block of data, to simply increase gRPC message size. -message Payload { - // The type of data in body. - PayloadType type = 1; - // Primary contents of payload. - bytes body = 2; -} - -// A protobuf representation for grpc status. This is used by test -// clients to specify a status that the server should attempt to return. -message EchoStatus { - int32 code = 1; - string message = 2; -} - -// Unary request. -message SimpleRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - PayloadType response_type = 1; - - // Desired payload size in the response from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - int32 response_size = 2; - - // Optional input payload sent along with the request. - Payload payload = 3; - - // Whether SimpleResponse should include username. - bool fill_username = 4; - - // Whether SimpleResponse should include OAuth scope. - bool fill_oauth_scope = 5; - - // Compression algorithm to be used by the server for the response (stream) - CompressionType response_compression = 6; - - // Whether server should return a given status - EchoStatus response_status = 7; -} - -// Unary response, as configured by the request. -message SimpleResponse { - // Payload to increase message size. - Payload payload = 1; - // The user the request came from, for verifying authentication was - // successful when the client expected it. - string username = 2; - // OAuth scope. - string oauth_scope = 3; -} - -// Client-streaming request. -message StreamingInputCallRequest { - // Optional input payload sent along with the request. - Payload payload = 1; - - // Not expecting any payload from the response. -} - -// Client-streaming response. -message StreamingInputCallResponse { - // Aggregated size of payloads received from the client. - int32 aggregated_payload_size = 1; -} - -// Configuration for a particular response. -message ResponseParameters { - // Desired payload sizes in responses from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - int32 size = 1; - - // Desired interval between consecutive responses in the response stream in - // microseconds. - int32 interval_us = 2; -} - -// Server-streaming request. -message StreamingOutputCallRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, the payload from each response in the stream - // might be of different types. This is to simulate a mixed type of payload - // stream. - PayloadType response_type = 1; - - // Configuration for each expected response message. - repeated ResponseParameters response_parameters = 2; - - // Optional input payload sent along with the request. - Payload payload = 3; - - // Compression algorithm to be used by the server for the response (stream) - CompressionType response_compression = 6; - - // Whether server should return a given status - EchoStatus response_status = 7; -} - -// Server-streaming response, as configured by the request and parameters. -message StreamingOutputCallResponse { - // Payload to increase response size. - Payload payload = 1; -} - -// For reconnect interop test only. -// Client tells server what reconnection parameters it used. -message ReconnectParams { - int32 max_reconnect_backoff_ms = 1; -} - -// For reconnect interop test only. -// Server tells client whether its reconnects are following the spec and the -// reconnect backoffs it saw. -message ReconnectInfo { - bool passed = 1; - repeated int32 backoff_ms = 2; -} diff --git a/benchmark/grpc_testing/payloads.proto b/benchmark/grpc_testing/payloads.proto deleted file mode 100644 index 862fb71bc135..000000000000 --- a/benchmark/grpc_testing/payloads.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -option go_package = "google.golang.org/grpc/benchmark/grpc_testing"; - -package grpc.testing; - -message ByteBufferParams { - int32 req_size = 1; - int32 resp_size = 2; -} - -message SimpleProtoParams { - int32 req_size = 1; - int32 resp_size = 2; -} - -message ComplexProtoParams { - // TODO (vpai): Fill this in once the details of complex, representative - // protos are decided -} - -message PayloadConfig { - oneof payload { - ByteBufferParams bytebuf_params = 1; - SimpleProtoParams simple_params = 2; - ComplexProtoParams complex_params = 3; - } -} diff --git a/benchmark/grpc_testing/services.pb.go b/benchmark/grpc_testing/services.pb.go deleted file mode 100644 index 17d33e05678b..000000000000 --- a/benchmark/grpc_testing/services.pb.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// An integration test service that covers all the method signature permutations -// of unary/streaming requests/responses. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.14.0 -// source: benchmark/grpc_testing/services.proto - -package grpc_testing - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -var File_benchmark_grpc_testing_services_proto protoreflect.FileDescriptor - -var file_benchmark_grpc_testing_services_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x25, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x62, 0x65, - 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x32, 0x87, 0x02, 0x0a, 0x10, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x55, 0x6e, 0x61, 0x72, 0x79, - 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, - 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4e, 0x0a, 0x0d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x43, 0x61, 0x6c, 0x6c, - 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, - 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, - 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, - 0x5b, 0x0a, 0x1a, 0x55, 0x6e, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x65, 0x64, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x1b, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, - 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x32, 0x97, 0x02, 0x0a, - 0x0d, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, - 0x0a, 0x09, 0x52, 0x75, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x41, 0x72, 0x67, 0x73, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x28, 0x01, 0x30, 0x01, 0x12, 0x45, 0x0a, 0x09, 0x52, 0x75, 0x6e, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x72, 0x67, 0x73, 0x1a, 0x1a, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x28, 0x01, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x09, - 0x43, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x34, 0x0a, 0x0a, 0x51, 0x75, 0x69, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x12, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x6f, - 0x69, 0x64, 0x1a, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x2e, 0x56, 0x6f, 0x69, 0x64, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, - 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_benchmark_grpc_testing_services_proto_goTypes = []interface{}{ - (*SimpleRequest)(nil), // 0: grpc.testing.SimpleRequest - (*ServerArgs)(nil), // 1: grpc.testing.ServerArgs - (*ClientArgs)(nil), // 2: grpc.testing.ClientArgs - (*CoreRequest)(nil), // 3: grpc.testing.CoreRequest - (*Void)(nil), // 4: grpc.testing.Void - (*SimpleResponse)(nil), // 5: grpc.testing.SimpleResponse - (*ServerStatus)(nil), // 6: grpc.testing.ServerStatus - (*ClientStatus)(nil), // 7: grpc.testing.ClientStatus - (*CoreResponse)(nil), // 8: grpc.testing.CoreResponse -} -var file_benchmark_grpc_testing_services_proto_depIdxs = []int32{ - 0, // 0: grpc.testing.BenchmarkService.UnaryCall:input_type -> grpc.testing.SimpleRequest - 0, // 1: grpc.testing.BenchmarkService.StreamingCall:input_type -> grpc.testing.SimpleRequest - 0, // 2: grpc.testing.BenchmarkService.UnconstrainedStreamingCall:input_type -> grpc.testing.SimpleRequest - 1, // 3: grpc.testing.WorkerService.RunServer:input_type -> grpc.testing.ServerArgs - 2, // 4: grpc.testing.WorkerService.RunClient:input_type -> grpc.testing.ClientArgs - 3, // 5: grpc.testing.WorkerService.CoreCount:input_type -> grpc.testing.CoreRequest - 4, // 6: grpc.testing.WorkerService.QuitWorker:input_type -> grpc.testing.Void - 5, // 7: grpc.testing.BenchmarkService.UnaryCall:output_type -> grpc.testing.SimpleResponse - 5, // 8: grpc.testing.BenchmarkService.StreamingCall:output_type -> grpc.testing.SimpleResponse - 5, // 9: grpc.testing.BenchmarkService.UnconstrainedStreamingCall:output_type -> grpc.testing.SimpleResponse - 6, // 10: grpc.testing.WorkerService.RunServer:output_type -> grpc.testing.ServerStatus - 7, // 11: grpc.testing.WorkerService.RunClient:output_type -> grpc.testing.ClientStatus - 8, // 12: grpc.testing.WorkerService.CoreCount:output_type -> grpc.testing.CoreResponse - 4, // 13: grpc.testing.WorkerService.QuitWorker:output_type -> grpc.testing.Void - 7, // [7:14] is the sub-list for method output_type - 0, // [0:7] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_benchmark_grpc_testing_services_proto_init() } -func file_benchmark_grpc_testing_services_proto_init() { - if File_benchmark_grpc_testing_services_proto != nil { - return - } - file_benchmark_grpc_testing_messages_proto_init() - file_benchmark_grpc_testing_control_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_benchmark_grpc_testing_services_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_benchmark_grpc_testing_services_proto_goTypes, - DependencyIndexes: file_benchmark_grpc_testing_services_proto_depIdxs, - }.Build() - File_benchmark_grpc_testing_services_proto = out.File - file_benchmark_grpc_testing_services_proto_rawDesc = nil - file_benchmark_grpc_testing_services_proto_goTypes = nil - file_benchmark_grpc_testing_services_proto_depIdxs = nil -} diff --git a/benchmark/grpc_testing/services.proto b/benchmark/grpc_testing/services.proto deleted file mode 100644 index 9028c9cfe113..000000000000 --- a/benchmark/grpc_testing/services.proto +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// An integration test service that covers all the method signature permutations -// of unary/streaming requests/responses. -syntax = "proto3"; - -option go_package = "google.golang.org/grpc/benchmark/grpc_testing"; - -import "benchmark/grpc_testing/messages.proto"; -import "benchmark/grpc_testing/control.proto"; - -package grpc.testing; - -service BenchmarkService { - // One request followed by one response. - // The server returns the client payload as-is. - rpc UnaryCall(SimpleRequest) returns (SimpleResponse); - - // One request followed by one response. - // The server returns the client payload as-is. - rpc StreamingCall(stream SimpleRequest) returns (stream SimpleResponse); - // Unconstrainted streaming. - // Both server and client keep sending & receiving simultaneously. - rpc UnconstrainedStreamingCall(stream SimpleRequest) returns (stream SimpleResponse); -} - -service WorkerService { - // Start server with specified workload. - // First request sent specifies the ServerConfig followed by ServerStatus - // response. After that, a "Mark" can be sent anytime to request the latest - // stats. Closing the stream will initiate shutdown of the test server - // and once the shutdown has finished, the OK status is sent to terminate - // this RPC. - rpc RunServer(stream ServerArgs) returns (stream ServerStatus); - - // Start client with specified workload. - // First request sent specifies the ClientConfig followed by ClientStatus - // response. After that, a "Mark" can be sent anytime to request the latest - // stats. Closing the stream will initiate shutdown of the test client - // and once the shutdown has finished, the OK status is sent to terminate - // this RPC. - rpc RunClient(stream ClientArgs) returns (stream ClientStatus); - - // Just return the core count - unary call - rpc CoreCount(CoreRequest) returns (CoreResponse); - - // Quit this worker - rpc QuitWorker(Void) returns (Void); -} diff --git a/benchmark/grpc_testing/stats.pb.go b/benchmark/grpc_testing/stats.pb.go deleted file mode 100644 index 87fc9bf2d3bc..000000000000 --- a/benchmark/grpc_testing/stats.pb.go +++ /dev/null @@ -1,473 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.14.0 -// source: benchmark/grpc_testing/stats.proto - -package grpc_testing - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -type ServerStats struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // wall clock time change in seconds since last reset - TimeElapsed float64 `protobuf:"fixed64,1,opt,name=time_elapsed,json=timeElapsed,proto3" json:"time_elapsed,omitempty"` - // change in user time (in seconds) used by the server since last reset - TimeUser float64 `protobuf:"fixed64,2,opt,name=time_user,json=timeUser,proto3" json:"time_user,omitempty"` - // change in server time (in seconds) used by the server process and all - // threads since last reset - TimeSystem float64 `protobuf:"fixed64,3,opt,name=time_system,json=timeSystem,proto3" json:"time_system,omitempty"` -} - -func (x *ServerStats) Reset() { - *x = ServerStats{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_stats_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerStats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerStats) ProtoMessage() {} - -func (x *ServerStats) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_stats_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerStats.ProtoReflect.Descriptor instead. -func (*ServerStats) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_stats_proto_rawDescGZIP(), []int{0} -} - -func (x *ServerStats) GetTimeElapsed() float64 { - if x != nil { - return x.TimeElapsed - } - return 0 -} - -func (x *ServerStats) GetTimeUser() float64 { - if x != nil { - return x.TimeUser - } - return 0 -} - -func (x *ServerStats) GetTimeSystem() float64 { - if x != nil { - return x.TimeSystem - } - return 0 -} - -// Histogram params based on grpc/support/histogram.c -type HistogramParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Resolution float64 `protobuf:"fixed64,1,opt,name=resolution,proto3" json:"resolution,omitempty"` // first bucket is [0, 1 + resolution) - MaxPossible float64 `protobuf:"fixed64,2,opt,name=max_possible,json=maxPossible,proto3" json:"max_possible,omitempty"` // use enough buckets to allow this value -} - -func (x *HistogramParams) Reset() { - *x = HistogramParams{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_stats_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HistogramParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HistogramParams) ProtoMessage() {} - -func (x *HistogramParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_stats_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HistogramParams.ProtoReflect.Descriptor instead. -func (*HistogramParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_stats_proto_rawDescGZIP(), []int{1} -} - -func (x *HistogramParams) GetResolution() float64 { - if x != nil { - return x.Resolution - } - return 0 -} - -func (x *HistogramParams) GetMaxPossible() float64 { - if x != nil { - return x.MaxPossible - } - return 0 -} - -// Histogram data based on grpc/support/histogram.c -type HistogramData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Bucket []uint32 `protobuf:"varint,1,rep,packed,name=bucket,proto3" json:"bucket,omitempty"` - MinSeen float64 `protobuf:"fixed64,2,opt,name=min_seen,json=minSeen,proto3" json:"min_seen,omitempty"` - MaxSeen float64 `protobuf:"fixed64,3,opt,name=max_seen,json=maxSeen,proto3" json:"max_seen,omitempty"` - Sum float64 `protobuf:"fixed64,4,opt,name=sum,proto3" json:"sum,omitempty"` - SumOfSquares float64 `protobuf:"fixed64,5,opt,name=sum_of_squares,json=sumOfSquares,proto3" json:"sum_of_squares,omitempty"` - Count float64 `protobuf:"fixed64,6,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *HistogramData) Reset() { - *x = HistogramData{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_stats_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HistogramData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HistogramData) ProtoMessage() {} - -func (x *HistogramData) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_stats_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HistogramData.ProtoReflect.Descriptor instead. -func (*HistogramData) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_stats_proto_rawDescGZIP(), []int{2} -} - -func (x *HistogramData) GetBucket() []uint32 { - if x != nil { - return x.Bucket - } - return nil -} - -func (x *HistogramData) GetMinSeen() float64 { - if x != nil { - return x.MinSeen - } - return 0 -} - -func (x *HistogramData) GetMaxSeen() float64 { - if x != nil { - return x.MaxSeen - } - return 0 -} - -func (x *HistogramData) GetSum() float64 { - if x != nil { - return x.Sum - } - return 0 -} - -func (x *HistogramData) GetSumOfSquares() float64 { - if x != nil { - return x.SumOfSquares - } - return 0 -} - -func (x *HistogramData) GetCount() float64 { - if x != nil { - return x.Count - } - return 0 -} - -type ClientStats struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Latency histogram. Data points are in nanoseconds. - Latencies *HistogramData `protobuf:"bytes,1,opt,name=latencies,proto3" json:"latencies,omitempty"` - // See ServerStats for details. - TimeElapsed float64 `protobuf:"fixed64,2,opt,name=time_elapsed,json=timeElapsed,proto3" json:"time_elapsed,omitempty"` - TimeUser float64 `protobuf:"fixed64,3,opt,name=time_user,json=timeUser,proto3" json:"time_user,omitempty"` - TimeSystem float64 `protobuf:"fixed64,4,opt,name=time_system,json=timeSystem,proto3" json:"time_system,omitempty"` -} - -func (x *ClientStats) Reset() { - *x = ClientStats{} - if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_stats_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientStats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientStats) ProtoMessage() {} - -func (x *ClientStats) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_stats_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientStats.ProtoReflect.Descriptor instead. -func (*ClientStats) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_stats_proto_rawDescGZIP(), []int{3} -} - -func (x *ClientStats) GetLatencies() *HistogramData { - if x != nil { - return x.Latencies - } - return nil -} - -func (x *ClientStats) GetTimeElapsed() float64 { - if x != nil { - return x.TimeElapsed - } - return 0 -} - -func (x *ClientStats) GetTimeUser() float64 { - if x != nil { - return x.TimeUser - } - return 0 -} - -func (x *ClientStats) GetTimeSystem() float64 { - if x != nil { - return x.TimeSystem - } - return 0 -} - -var File_benchmark_grpc_testing_stats_proto protoreflect.FileDescriptor - -var file_benchmark_grpc_testing_stats_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x22, 0x6e, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, - 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x65, 0x6c, 0x61, 0x70, 0x73, 0x65, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x45, 0x6c, 0x61, - 0x70, 0x73, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x22, 0x54, 0x0a, 0x0f, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x6c, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x6f, 0x73, - 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6d, 0x61, 0x78, - 0x50, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x0d, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x65, 0x6e, 0x12, 0x19, 0x0a, - 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, - 0x07, 0x6d, 0x61, 0x78, 0x53, 0x65, 0x65, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x75, - 0x6d, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x0c, 0x73, 0x75, 0x6d, 0x4f, 0x66, 0x53, 0x71, 0x75, 0x61, 0x72, 0x65, 0x73, - 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, - 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa9, 0x01, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x39, 0x0a, 0x09, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, - 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, - 0x61, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x69, 0x65, - 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x65, 0x6c, 0x61, 0x70, 0x73, 0x65, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x45, 0x6c, 0x61, - 0x70, 0x73, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, - 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x65, 0x6e, - 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_benchmark_grpc_testing_stats_proto_rawDescOnce sync.Once - file_benchmark_grpc_testing_stats_proto_rawDescData = file_benchmark_grpc_testing_stats_proto_rawDesc -) - -func file_benchmark_grpc_testing_stats_proto_rawDescGZIP() []byte { - file_benchmark_grpc_testing_stats_proto_rawDescOnce.Do(func() { - file_benchmark_grpc_testing_stats_proto_rawDescData = protoimpl.X.CompressGZIP(file_benchmark_grpc_testing_stats_proto_rawDescData) - }) - return file_benchmark_grpc_testing_stats_proto_rawDescData -} - -var file_benchmark_grpc_testing_stats_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_benchmark_grpc_testing_stats_proto_goTypes = []interface{}{ - (*ServerStats)(nil), // 0: grpc.testing.ServerStats - (*HistogramParams)(nil), // 1: grpc.testing.HistogramParams - (*HistogramData)(nil), // 2: grpc.testing.HistogramData - (*ClientStats)(nil), // 3: grpc.testing.ClientStats -} -var file_benchmark_grpc_testing_stats_proto_depIdxs = []int32{ - 2, // 0: grpc.testing.ClientStats.latencies:type_name -> grpc.testing.HistogramData - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_benchmark_grpc_testing_stats_proto_init() } -func file_benchmark_grpc_testing_stats_proto_init() { - if File_benchmark_grpc_testing_stats_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_benchmark_grpc_testing_stats_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerStats); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_stats_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistogramParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_stats_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistogramData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_benchmark_grpc_testing_stats_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientStats); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_benchmark_grpc_testing_stats_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_benchmark_grpc_testing_stats_proto_goTypes, - DependencyIndexes: file_benchmark_grpc_testing_stats_proto_depIdxs, - MessageInfos: file_benchmark_grpc_testing_stats_proto_msgTypes, - }.Build() - File_benchmark_grpc_testing_stats_proto = out.File - file_benchmark_grpc_testing_stats_proto_rawDesc = nil - file_benchmark_grpc_testing_stats_proto_goTypes = nil - file_benchmark_grpc_testing_stats_proto_depIdxs = nil -} diff --git a/benchmark/grpc_testing/stats.proto b/benchmark/grpc_testing/stats.proto deleted file mode 100644 index 1517e7f6d2ef..000000000000 --- a/benchmark/grpc_testing/stats.proto +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -option go_package = "google.golang.org/grpc/benchmark/grpc_testing"; - -package grpc.testing; - -message ServerStats { - // wall clock time change in seconds since last reset - double time_elapsed = 1; - - // change in user time (in seconds) used by the server since last reset - double time_user = 2; - - // change in server time (in seconds) used by the server process and all - // threads since last reset - double time_system = 3; -} - -// Histogram params based on grpc/support/histogram.c -message HistogramParams { - double resolution = 1; // first bucket is [0, 1 + resolution) - double max_possible = 2; // use enough buckets to allow this value -} - -// Histogram data based on grpc/support/histogram.c -message HistogramData { - repeated uint32 bucket = 1; - double min_seen = 2; - double max_seen = 3; - double sum = 4; - double sum_of_squares = 5; - double count = 6; -} - -message ClientStats { - // Latency histogram. Data points are in nanoseconds. - HistogramData latencies = 1; - - // See ServerStats for details. - double time_elapsed = 2; - double time_user = 3; - double time_system = 4; -} diff --git a/benchmark/worker/benchmark_client.go b/benchmark/worker/benchmark_client.go index 9253c0b48737..f760c7c36acc 100644 --- a/benchmark/worker/benchmark_client.go +++ b/benchmark/worker/benchmark_client.go @@ -28,11 +28,11 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/benchmark" - testpb "google.golang.org/grpc/benchmark/grpc_testing" "google.golang.org/grpc/benchmark/stats" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/syscall" + testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/status" "google.golang.org/grpc/testdata" ) diff --git a/benchmark/worker/benchmark_server.go b/benchmark/worker/benchmark_server.go index 60d52d75da38..da6288c11de4 100644 --- a/benchmark/worker/benchmark_server.go +++ b/benchmark/worker/benchmark_server.go @@ -30,10 +30,10 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/benchmark" - testpb "google.golang.org/grpc/benchmark/grpc_testing" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/syscall" + testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/status" "google.golang.org/grpc/testdata" ) diff --git a/benchmark/worker/main.go b/benchmark/worker/main.go index 634f09e658c5..4ecf997238d8 100644 --- a/benchmark/worker/main.go +++ b/benchmark/worker/main.go @@ -33,9 +33,9 @@ import ( "time" "google.golang.org/grpc" - testpb "google.golang.org/grpc/benchmark/grpc_testing" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/status" ) diff --git a/binarylog/binarylog_end2end_test.go b/binarylog/binarylog_end2end_test.go index 89685c65a26b..e06ffec9166e 100644 --- a/binarylog/binarylog_end2end_test.go +++ b/binarylog/binarylog_end2end_test.go @@ -35,8 +35,8 @@ import ( "google.golang.org/grpc/grpclog" iblog "google.golang.org/grpc/internal/binarylog" "google.golang.org/grpc/internal/grpctest" + testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/metadata" - testpb "google.golang.org/grpc/stats/grpc_testing" "google.golang.org/grpc/status" ) @@ -114,6 +114,17 @@ var ( globalRPCID uint64 // RPC id starts with 1, but we do ++ at the beginning of each test. ) +func idToPayload(id int32) *testpb.Payload { + return &testpb.Payload{Body: []byte{byte(id), byte(id >> 8), byte(id >> 16), byte(id >> 24)}} +} + +func payloadToID(p *testpb.Payload) int32 { + if p == nil || len(p.Body) != 4 { + panic("invalid payload") + } + return int32(p.Body[0]) + int32(p.Body[1])<<8 + int32(p.Body[2])<<16 + int32(p.Body[3])<<24 +} + type testServer struct { testpb.UnimplementedTestServiceServer te *test @@ -130,11 +141,11 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (* } } - if in.Id == errorID { - return nil, fmt.Errorf("got error id: %v", in.Id) + if id := payloadToID(in.Payload); id == errorID { + return nil, fmt.Errorf("got error id: %v", id) } - return &testpb.SimpleResponse{Id: in.Id}, nil + return &testpb.SimpleResponse{Payload: in.Payload}, nil } func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { @@ -155,17 +166,17 @@ func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServ return err } - if in.Id == errorID { - return fmt.Errorf("got error id: %v", in.Id) + if id := payloadToID(in.Payload); id == errorID { + return fmt.Errorf("got error id: %v", id) } - if err := stream.Send(&testpb.SimpleResponse{Id: in.Id}); err != nil { + if err := stream.Send(&testpb.StreamingOutputCallResponse{Payload: in.Payload}); err != nil { return err } } } -func (s *testServer) ClientStreamCall(stream testpb.TestService_ClientStreamCallServer) error { +func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInputCallServer) error { md, ok := metadata.FromIncomingContext(stream.Context()) if ok { if err := stream.SendHeader(md); err != nil { @@ -177,19 +188,19 @@ func (s *testServer) ClientStreamCall(stream testpb.TestService_ClientStreamCall in, err := stream.Recv() if err == io.EOF { // read done. - return stream.SendAndClose(&testpb.SimpleResponse{Id: int32(0)}) + return stream.SendAndClose(&testpb.StreamingInputCallResponse{AggregatedPayloadSize: 0}) } if err != nil { return err } - if in.Id == errorID { - return fmt.Errorf("got error id: %v", in.Id) + if id := payloadToID(in.Payload); id == errorID { + return fmt.Errorf("got error id: %v", id) } } } -func (s *testServer) ServerStreamCall(in *testpb.SimpleRequest, stream testpb.TestService_ServerStreamCallServer) error { +func (s *testServer) StreamingOutputCall(in *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { md, ok := metadata.FromIncomingContext(stream.Context()) if ok { if err := stream.SendHeader(md); err != nil { @@ -198,12 +209,12 @@ func (s *testServer) ServerStreamCall(in *testpb.SimpleRequest, stream testpb.Te stream.SetTrailer(testTrailerMetadata) } - if in.Id == errorID { - return fmt.Errorf("got error id: %v", in.Id) + if id := payloadToID(in.Payload); id == errorID { + return fmt.Errorf("got error id: %v", id) } for i := 0; i < 5; i++ { - if err := stream.Send(&testpb.SimpleResponse{Id: in.Id}); err != nil { + if err := stream.Send(&testpb.StreamingOutputCallResponse{Payload: in.Payload}); err != nil { return err } } @@ -334,9 +345,9 @@ func (te *test) doUnaryCall(c *rpcConfig) (*testpb.SimpleRequest, *testpb.Simple ) tc := testpb.NewTestServiceClient(te.clientConn()) if c.success { - req = &testpb.SimpleRequest{Id: errorID + 1} + req = &testpb.SimpleRequest{Payload: idToPayload(errorID + 1)} } else { - req = &testpb.SimpleRequest{Id: errorID} + req = &testpb.SimpleRequest{Payload: idToPayload(errorID)} } ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() @@ -346,10 +357,10 @@ func (te *test) doUnaryCall(c *rpcConfig) (*testpb.SimpleRequest, *testpb.Simple return req, resp, err } -func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]*testpb.SimpleRequest, []*testpb.SimpleResponse, error) { +func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]proto.Message, []proto.Message, error) { var ( - reqs []*testpb.SimpleRequest - resps []*testpb.SimpleResponse + reqs []proto.Message + resps []proto.Message err error ) tc := testpb.NewTestServiceClient(te.clientConn()) @@ -372,14 +383,14 @@ func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]*testpb.SimpleRequest startID = errorID } for i := 0; i < c.count; i++ { - req := &testpb.SimpleRequest{ - Id: int32(i) + startID, + req := &testpb.StreamingOutputCallRequest{ + Payload: idToPayload(int32(i) + startID), } reqs = append(reqs, req) if err = stream.Send(req); err != nil { return reqs, resps, err } - var resp *testpb.SimpleResponse + var resp *testpb.StreamingOutputCallResponse if resp, err = stream.Recv(); err != nil { return reqs, resps, err } @@ -395,10 +406,10 @@ func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]*testpb.SimpleRequest return reqs, resps, nil } -func (te *test) doClientStreamCall(c *rpcConfig) ([]*testpb.SimpleRequest, *testpb.SimpleResponse, error) { +func (te *test) doClientStreamCall(c *rpcConfig) ([]proto.Message, proto.Message, error) { var ( - reqs []*testpb.SimpleRequest - resp *testpb.SimpleResponse + reqs []proto.Message + resp *testpb.StreamingInputCallResponse err error ) tc := testpb.NewTestServiceClient(te.clientConn()) @@ -406,7 +417,7 @@ func (te *test) doClientStreamCall(c *rpcConfig) ([]*testpb.SimpleRequest, *test defer cancel() ctx = metadata.NewOutgoingContext(ctx, testMetadata) - stream, err := tc.ClientStreamCall(ctx) + stream, err := tc.StreamingInputCall(ctx) if err != nil { return reqs, resp, err } @@ -415,8 +426,8 @@ func (te *test) doClientStreamCall(c *rpcConfig) ([]*testpb.SimpleRequest, *test startID = errorID } for i := 0; i < c.count; i++ { - req := &testpb.SimpleRequest{ - Id: int32(i) + startID, + req := &testpb.StreamingInputCallRequest{ + Payload: idToPayload(int32(i) + startID), } reqs = append(reqs, req) if err = stream.Send(req); err != nil { @@ -427,10 +438,10 @@ func (te *test) doClientStreamCall(c *rpcConfig) ([]*testpb.SimpleRequest, *test return reqs, resp, err } -func (te *test) doServerStreamCall(c *rpcConfig) (*testpb.SimpleRequest, []*testpb.SimpleResponse, error) { +func (te *test) doServerStreamCall(c *rpcConfig) (proto.Message, []proto.Message, error) { var ( - req *testpb.SimpleRequest - resps []*testpb.SimpleResponse + req *testpb.StreamingOutputCallRequest + resps []proto.Message err error ) @@ -443,13 +454,13 @@ func (te *test) doServerStreamCall(c *rpcConfig) (*testpb.SimpleRequest, []*test if !c.success { startID = errorID } - req = &testpb.SimpleRequest{Id: startID} - stream, err := tc.ServerStreamCall(ctx, req) + req = &testpb.StreamingOutputCallRequest{Payload: idToPayload(startID)} + stream, err := tc.StreamingOutputCall(ctx, req) if err != nil { return req, resps, err } for { - var resp *testpb.SimpleResponse + var resp *testpb.StreamingOutputCallResponse resp, err := stream.Recv() if err == io.EOF { return req, resps, nil @@ -465,8 +476,8 @@ type expectedData struct { cc *rpcConfig method string - requests []*testpb.SimpleRequest - responses []*testpb.SimpleResponse + requests []proto.Message + responses []proto.Message err error } @@ -534,7 +545,7 @@ func (ed *expectedData) newServerHeaderEntry(client bool, rpcID, inRPCID uint64) } } -func (ed *expectedData) newClientMessageEntry(client bool, rpcID, inRPCID uint64, msg *testpb.SimpleRequest) *pb.GrpcLogEntry { +func (ed *expectedData) newClientMessageEntry(client bool, rpcID, inRPCID uint64, msg proto.Message) *pb.GrpcLogEntry { logger := pb.GrpcLogEntry_LOGGER_CLIENT if !client { logger = pb.GrpcLogEntry_LOGGER_SERVER @@ -558,7 +569,7 @@ func (ed *expectedData) newClientMessageEntry(client bool, rpcID, inRPCID uint64 } } -func (ed *expectedData) newServerMessageEntry(client bool, rpcID, inRPCID uint64, msg *testpb.SimpleResponse) *pb.GrpcLogEntry { +func (ed *expectedData) newServerMessageEntry(client bool, rpcID, inRPCID uint64, msg proto.Message) *pb.GrpcLogEntry { logger := pb.GrpcLogEntry_LOGGER_CLIENT if !client { logger = pb.GrpcLogEntry_LOGGER_SERVER @@ -795,20 +806,20 @@ func runRPCs(t *testing.T, tc *testConfig, cc *rpcConfig) *expectedData { case unaryRPC: expect.method = "/grpc.testing.TestService/UnaryCall" req, resp, err := te.doUnaryCall(cc) - expect.requests = []*testpb.SimpleRequest{req} - expect.responses = []*testpb.SimpleResponse{resp} + expect.requests = []proto.Message{req} + expect.responses = []proto.Message{resp} expect.err = err case clientStreamRPC: - expect.method = "/grpc.testing.TestService/ClientStreamCall" + expect.method = "/grpc.testing.TestService/StreamingInputCall" reqs, resp, err := te.doClientStreamCall(cc) expect.requests = reqs - expect.responses = []*testpb.SimpleResponse{resp} + expect.responses = []proto.Message{resp} expect.err = err case serverStreamRPC: - expect.method = "/grpc.testing.TestService/ServerStreamCall" + expect.method = "/grpc.testing.TestService/StreamingOutputCall" req, resps, err := te.doServerStreamCall(cc) expect.responses = resps - expect.requests = []*testpb.SimpleRequest{req} + expect.requests = []proto.Message{req} expect.err = err case fullDuplexStreamRPC, cancelRPC: expect.method = "/grpc.testing.TestService/FullDuplexCall" diff --git a/interop/grpc_testing/benchmark_service.pb.go b/interop/grpc_testing/benchmark_service.pb.go new file mode 100644 index 000000000000..a1057b8a7599 --- /dev/null +++ b/interop/grpc_testing/benchmark_service.pb.go @@ -0,0 +1,127 @@ +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: grpc/testing/benchmark_service.proto + +package grpc_testing + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +var File_grpc_testing_benchmark_service_proto protoreflect.FileDescriptor + +var file_grpc_testing_benchmark_service_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x62, + 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x1b, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x32, 0xa6, 0x03, 0x0a, 0x10, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x43, + 0x61, 0x6c, 0x6c, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, + 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, + 0x0a, 0x0d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x43, 0x61, 0x6c, 0x6c, 0x12, + 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x52, + 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x6f, 0x6d, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x28, 0x01, 0x12, 0x52, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x46, + 0x72, 0x6f, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x52, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x74, 0x68, 0x57, 0x61, 0x79, 0x73, 0x12, 0x1b, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var file_grpc_testing_benchmark_service_proto_goTypes = []interface{}{ + (*SimpleRequest)(nil), // 0: grpc.testing.SimpleRequest + (*SimpleResponse)(nil), // 1: grpc.testing.SimpleResponse +} +var file_grpc_testing_benchmark_service_proto_depIdxs = []int32{ + 0, // 0: grpc.testing.BenchmarkService.UnaryCall:input_type -> grpc.testing.SimpleRequest + 0, // 1: grpc.testing.BenchmarkService.StreamingCall:input_type -> grpc.testing.SimpleRequest + 0, // 2: grpc.testing.BenchmarkService.StreamingFromClient:input_type -> grpc.testing.SimpleRequest + 0, // 3: grpc.testing.BenchmarkService.StreamingFromServer:input_type -> grpc.testing.SimpleRequest + 0, // 4: grpc.testing.BenchmarkService.StreamingBothWays:input_type -> grpc.testing.SimpleRequest + 1, // 5: grpc.testing.BenchmarkService.UnaryCall:output_type -> grpc.testing.SimpleResponse + 1, // 6: grpc.testing.BenchmarkService.StreamingCall:output_type -> grpc.testing.SimpleResponse + 1, // 7: grpc.testing.BenchmarkService.StreamingFromClient:output_type -> grpc.testing.SimpleResponse + 1, // 8: grpc.testing.BenchmarkService.StreamingFromServer:output_type -> grpc.testing.SimpleResponse + 1, // 9: grpc.testing.BenchmarkService.StreamingBothWays:output_type -> grpc.testing.SimpleResponse + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_grpc_testing_benchmark_service_proto_init() } +func file_grpc_testing_benchmark_service_proto_init() { + if File_grpc_testing_benchmark_service_proto != nil { + return + } + file_grpc_testing_messages_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_grpc_testing_benchmark_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_grpc_testing_benchmark_service_proto_goTypes, + DependencyIndexes: file_grpc_testing_benchmark_service_proto_depIdxs, + }.Build() + File_grpc_testing_benchmark_service_proto = out.File + file_grpc_testing_benchmark_service_proto_rawDesc = nil + file_grpc_testing_benchmark_service_proto_goTypes = nil + file_grpc_testing_benchmark_service_proto_depIdxs = nil +} diff --git a/interop/grpc_testing/benchmark_service_grpc.pb.go b/interop/grpc_testing/benchmark_service_grpc.pb.go new file mode 100644 index 000000000000..b4badf5fe5d3 --- /dev/null +++ b/interop/grpc_testing/benchmark_service_grpc.pb.go @@ -0,0 +1,392 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package grpc_testing + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion7 + +// BenchmarkServiceClient is the client API for BenchmarkService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type BenchmarkServiceClient interface { + // One request followed by one response. + // The server returns the client payload as-is. + UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) + // Repeated sequence of one request followed by one response. + // Should be called streaming ping-pong + // The server returns the client payload as-is on each response + StreamingCall(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingCallClient, error) + // Single-sided unbounded streaming from client to server + // The server returns the client payload as-is once the client does WritesDone + StreamingFromClient(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingFromClientClient, error) + // Single-sided unbounded streaming from server to client + // The server repeatedly returns the client payload as-is + StreamingFromServer(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (BenchmarkService_StreamingFromServerClient, error) + // Two-sided unbounded streaming between server to client + // Both sides send the content of their own choice to the other + StreamingBothWays(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingBothWaysClient, error) +} + +type benchmarkServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewBenchmarkServiceClient(cc grpc.ClientConnInterface) BenchmarkServiceClient { + return &benchmarkServiceClient{cc} +} + +func (c *benchmarkServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { + out := new(SimpleResponse) + err := c.cc.Invoke(ctx, "/grpc.testing.BenchmarkService/UnaryCall", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *benchmarkServiceClient) StreamingCall(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingCallClient, error) { + stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[0], "/grpc.testing.BenchmarkService/StreamingCall", opts...) + if err != nil { + return nil, err + } + x := &benchmarkServiceStreamingCallClient{stream} + return x, nil +} + +type BenchmarkService_StreamingCallClient interface { + Send(*SimpleRequest) error + Recv() (*SimpleResponse, error) + grpc.ClientStream +} + +type benchmarkServiceStreamingCallClient struct { + grpc.ClientStream +} + +func (x *benchmarkServiceStreamingCallClient) Send(m *SimpleRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *benchmarkServiceStreamingCallClient) Recv() (*SimpleResponse, error) { + m := new(SimpleResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *benchmarkServiceClient) StreamingFromClient(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingFromClientClient, error) { + stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[1], "/grpc.testing.BenchmarkService/StreamingFromClient", opts...) + if err != nil { + return nil, err + } + x := &benchmarkServiceStreamingFromClientClient{stream} + return x, nil +} + +type BenchmarkService_StreamingFromClientClient interface { + Send(*SimpleRequest) error + CloseAndRecv() (*SimpleResponse, error) + grpc.ClientStream +} + +type benchmarkServiceStreamingFromClientClient struct { + grpc.ClientStream +} + +func (x *benchmarkServiceStreamingFromClientClient) Send(m *SimpleRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *benchmarkServiceStreamingFromClientClient) CloseAndRecv() (*SimpleResponse, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(SimpleResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *benchmarkServiceClient) StreamingFromServer(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (BenchmarkService_StreamingFromServerClient, error) { + stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[2], "/grpc.testing.BenchmarkService/StreamingFromServer", opts...) + if err != nil { + return nil, err + } + x := &benchmarkServiceStreamingFromServerClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type BenchmarkService_StreamingFromServerClient interface { + Recv() (*SimpleResponse, error) + grpc.ClientStream +} + +type benchmarkServiceStreamingFromServerClient struct { + grpc.ClientStream +} + +func (x *benchmarkServiceStreamingFromServerClient) Recv() (*SimpleResponse, error) { + m := new(SimpleResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *benchmarkServiceClient) StreamingBothWays(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingBothWaysClient, error) { + stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[3], "/grpc.testing.BenchmarkService/StreamingBothWays", opts...) + if err != nil { + return nil, err + } + x := &benchmarkServiceStreamingBothWaysClient{stream} + return x, nil +} + +type BenchmarkService_StreamingBothWaysClient interface { + Send(*SimpleRequest) error + Recv() (*SimpleResponse, error) + grpc.ClientStream +} + +type benchmarkServiceStreamingBothWaysClient struct { + grpc.ClientStream +} + +func (x *benchmarkServiceStreamingBothWaysClient) Send(m *SimpleRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *benchmarkServiceStreamingBothWaysClient) Recv() (*SimpleResponse, error) { + m := new(SimpleResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// BenchmarkServiceServer is the server API for BenchmarkService service. +// All implementations must embed UnimplementedBenchmarkServiceServer +// for forward compatibility +type BenchmarkServiceServer interface { + // One request followed by one response. + // The server returns the client payload as-is. + UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) + // Repeated sequence of one request followed by one response. + // Should be called streaming ping-pong + // The server returns the client payload as-is on each response + StreamingCall(BenchmarkService_StreamingCallServer) error + // Single-sided unbounded streaming from client to server + // The server returns the client payload as-is once the client does WritesDone + StreamingFromClient(BenchmarkService_StreamingFromClientServer) error + // Single-sided unbounded streaming from server to client + // The server repeatedly returns the client payload as-is + StreamingFromServer(*SimpleRequest, BenchmarkService_StreamingFromServerServer) error + // Two-sided unbounded streaming between server to client + // Both sides send the content of their own choice to the other + StreamingBothWays(BenchmarkService_StreamingBothWaysServer) error + mustEmbedUnimplementedBenchmarkServiceServer() +} + +// UnimplementedBenchmarkServiceServer must be embedded to have forward compatible implementations. +type UnimplementedBenchmarkServiceServer struct { +} + +func (UnimplementedBenchmarkServiceServer) UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnaryCall not implemented") +} +func (UnimplementedBenchmarkServiceServer) StreamingCall(BenchmarkService_StreamingCallServer) error { + return status.Errorf(codes.Unimplemented, "method StreamingCall not implemented") +} +func (UnimplementedBenchmarkServiceServer) StreamingFromClient(BenchmarkService_StreamingFromClientServer) error { + return status.Errorf(codes.Unimplemented, "method StreamingFromClient not implemented") +} +func (UnimplementedBenchmarkServiceServer) StreamingFromServer(*SimpleRequest, BenchmarkService_StreamingFromServerServer) error { + return status.Errorf(codes.Unimplemented, "method StreamingFromServer not implemented") +} +func (UnimplementedBenchmarkServiceServer) StreamingBothWays(BenchmarkService_StreamingBothWaysServer) error { + return status.Errorf(codes.Unimplemented, "method StreamingBothWays not implemented") +} +func (UnimplementedBenchmarkServiceServer) mustEmbedUnimplementedBenchmarkServiceServer() {} + +// UnsafeBenchmarkServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BenchmarkServiceServer will +// result in compilation errors. +type UnsafeBenchmarkServiceServer interface { + mustEmbedUnimplementedBenchmarkServiceServer() +} + +func RegisterBenchmarkServiceServer(s grpc.ServiceRegistrar, srv BenchmarkServiceServer) { + s.RegisterService(&BenchmarkService_ServiceDesc, srv) +} + +func _BenchmarkService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SimpleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BenchmarkServiceServer).UnaryCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.BenchmarkService/UnaryCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BenchmarkServiceServer).UnaryCall(ctx, req.(*SimpleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BenchmarkService_StreamingCall_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(BenchmarkServiceServer).StreamingCall(&benchmarkServiceStreamingCallServer{stream}) +} + +type BenchmarkService_StreamingCallServer interface { + Send(*SimpleResponse) error + Recv() (*SimpleRequest, error) + grpc.ServerStream +} + +type benchmarkServiceStreamingCallServer struct { + grpc.ServerStream +} + +func (x *benchmarkServiceStreamingCallServer) Send(m *SimpleResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *benchmarkServiceStreamingCallServer) Recv() (*SimpleRequest, error) { + m := new(SimpleRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _BenchmarkService_StreamingFromClient_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(BenchmarkServiceServer).StreamingFromClient(&benchmarkServiceStreamingFromClientServer{stream}) +} + +type BenchmarkService_StreamingFromClientServer interface { + SendAndClose(*SimpleResponse) error + Recv() (*SimpleRequest, error) + grpc.ServerStream +} + +type benchmarkServiceStreamingFromClientServer struct { + grpc.ServerStream +} + +func (x *benchmarkServiceStreamingFromClientServer) SendAndClose(m *SimpleResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *benchmarkServiceStreamingFromClientServer) Recv() (*SimpleRequest, error) { + m := new(SimpleRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _BenchmarkService_StreamingFromServer_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SimpleRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BenchmarkServiceServer).StreamingFromServer(m, &benchmarkServiceStreamingFromServerServer{stream}) +} + +type BenchmarkService_StreamingFromServerServer interface { + Send(*SimpleResponse) error + grpc.ServerStream +} + +type benchmarkServiceStreamingFromServerServer struct { + grpc.ServerStream +} + +func (x *benchmarkServiceStreamingFromServerServer) Send(m *SimpleResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _BenchmarkService_StreamingBothWays_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(BenchmarkServiceServer).StreamingBothWays(&benchmarkServiceStreamingBothWaysServer{stream}) +} + +type BenchmarkService_StreamingBothWaysServer interface { + Send(*SimpleResponse) error + Recv() (*SimpleRequest, error) + grpc.ServerStream +} + +type benchmarkServiceStreamingBothWaysServer struct { + grpc.ServerStream +} + +func (x *benchmarkServiceStreamingBothWaysServer) Send(m *SimpleResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *benchmarkServiceStreamingBothWaysServer) Recv() (*SimpleRequest, error) { + m := new(SimpleRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// BenchmarkService_ServiceDesc is the grpc.ServiceDesc for BenchmarkService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BenchmarkService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.BenchmarkService", + HandlerType: (*BenchmarkServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UnaryCall", + Handler: _BenchmarkService_UnaryCall_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamingCall", + Handler: _BenchmarkService_StreamingCall_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "StreamingFromClient", + Handler: _BenchmarkService_StreamingFromClient_Handler, + ClientStreams: true, + }, + { + StreamName: "StreamingFromServer", + Handler: _BenchmarkService_StreamingFromServer_Handler, + ServerStreams: true, + }, + { + StreamName: "StreamingBothWays", + Handler: _BenchmarkService_StreamingBothWays_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "grpc/testing/benchmark_service.proto", +} diff --git a/interop/grpc_testing/control.pb.go b/interop/grpc_testing/control.pb.go new file mode 100644 index 000000000000..8db13921b77e --- /dev/null +++ b/interop/grpc_testing/control.pb.go @@ -0,0 +1,2461 @@ +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: grpc/testing/control.proto + +package grpc_testing + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type ClientType int32 + +const ( + // Many languages support a basic distinction between using + // sync or async client, and this allows the specification + ClientType_SYNC_CLIENT ClientType = 0 + ClientType_ASYNC_CLIENT ClientType = 1 + ClientType_OTHER_CLIENT ClientType = 2 // used for some language-specific variants + ClientType_CALLBACK_CLIENT ClientType = 3 +) + +// Enum value maps for ClientType. +var ( + ClientType_name = map[int32]string{ + 0: "SYNC_CLIENT", + 1: "ASYNC_CLIENT", + 2: "OTHER_CLIENT", + 3: "CALLBACK_CLIENT", + } + ClientType_value = map[string]int32{ + "SYNC_CLIENT": 0, + "ASYNC_CLIENT": 1, + "OTHER_CLIENT": 2, + "CALLBACK_CLIENT": 3, + } +) + +func (x ClientType) Enum() *ClientType { + p := new(ClientType) + *p = x + return p +} + +func (x ClientType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ClientType) Descriptor() protoreflect.EnumDescriptor { + return file_grpc_testing_control_proto_enumTypes[0].Descriptor() +} + +func (ClientType) Type() protoreflect.EnumType { + return &file_grpc_testing_control_proto_enumTypes[0] +} + +func (x ClientType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ClientType.Descriptor instead. +func (ClientType) EnumDescriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{0} +} + +type ServerType int32 + +const ( + ServerType_SYNC_SERVER ServerType = 0 + ServerType_ASYNC_SERVER ServerType = 1 + ServerType_ASYNC_GENERIC_SERVER ServerType = 2 + ServerType_OTHER_SERVER ServerType = 3 // used for some language-specific variants + ServerType_CALLBACK_SERVER ServerType = 4 +) + +// Enum value maps for ServerType. +var ( + ServerType_name = map[int32]string{ + 0: "SYNC_SERVER", + 1: "ASYNC_SERVER", + 2: "ASYNC_GENERIC_SERVER", + 3: "OTHER_SERVER", + 4: "CALLBACK_SERVER", + } + ServerType_value = map[string]int32{ + "SYNC_SERVER": 0, + "ASYNC_SERVER": 1, + "ASYNC_GENERIC_SERVER": 2, + "OTHER_SERVER": 3, + "CALLBACK_SERVER": 4, + } +) + +func (x ServerType) Enum() *ServerType { + p := new(ServerType) + *p = x + return p +} + +func (x ServerType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ServerType) Descriptor() protoreflect.EnumDescriptor { + return file_grpc_testing_control_proto_enumTypes[1].Descriptor() +} + +func (ServerType) Type() protoreflect.EnumType { + return &file_grpc_testing_control_proto_enumTypes[1] +} + +func (x ServerType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ServerType.Descriptor instead. +func (ServerType) EnumDescriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{1} +} + +type RpcType int32 + +const ( + RpcType_UNARY RpcType = 0 + RpcType_STREAMING RpcType = 1 + RpcType_STREAMING_FROM_CLIENT RpcType = 2 + RpcType_STREAMING_FROM_SERVER RpcType = 3 + RpcType_STREAMING_BOTH_WAYS RpcType = 4 +) + +// Enum value maps for RpcType. +var ( + RpcType_name = map[int32]string{ + 0: "UNARY", + 1: "STREAMING", + 2: "STREAMING_FROM_CLIENT", + 3: "STREAMING_FROM_SERVER", + 4: "STREAMING_BOTH_WAYS", + } + RpcType_value = map[string]int32{ + "UNARY": 0, + "STREAMING": 1, + "STREAMING_FROM_CLIENT": 2, + "STREAMING_FROM_SERVER": 3, + "STREAMING_BOTH_WAYS": 4, + } +) + +func (x RpcType) Enum() *RpcType { + p := new(RpcType) + *p = x + return p +} + +func (x RpcType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RpcType) Descriptor() protoreflect.EnumDescriptor { + return file_grpc_testing_control_proto_enumTypes[2].Descriptor() +} + +func (RpcType) Type() protoreflect.EnumType { + return &file_grpc_testing_control_proto_enumTypes[2] +} + +func (x RpcType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RpcType.Descriptor instead. +func (RpcType) EnumDescriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{2} +} + +// Parameters of poisson process distribution, which is a good representation +// of activity coming in from independent identical stationary sources. +type PoissonParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The rate of arrivals (a.k.a. lambda parameter of the exp distribution). + OfferedLoad float64 `protobuf:"fixed64,1,opt,name=offered_load,json=offeredLoad,proto3" json:"offered_load,omitempty"` +} + +func (x *PoissonParams) Reset() { + *x = PoissonParams{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PoissonParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PoissonParams) ProtoMessage() {} + +func (x *PoissonParams) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PoissonParams.ProtoReflect.Descriptor instead. +func (*PoissonParams) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{0} +} + +func (x *PoissonParams) GetOfferedLoad() float64 { + if x != nil { + return x.OfferedLoad + } + return 0 +} + +// Once an RPC finishes, immediately start a new one. +// No configuration parameters needed. +type ClosedLoopParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ClosedLoopParams) Reset() { + *x = ClosedLoopParams{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClosedLoopParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClosedLoopParams) ProtoMessage() {} + +func (x *ClosedLoopParams) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClosedLoopParams.ProtoReflect.Descriptor instead. +func (*ClosedLoopParams) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{1} +} + +type LoadParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Load: + // *LoadParams_ClosedLoop + // *LoadParams_Poisson + Load isLoadParams_Load `protobuf_oneof:"load"` +} + +func (x *LoadParams) Reset() { + *x = LoadParams{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoadParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadParams) ProtoMessage() {} + +func (x *LoadParams) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadParams.ProtoReflect.Descriptor instead. +func (*LoadParams) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{2} +} + +func (m *LoadParams) GetLoad() isLoadParams_Load { + if m != nil { + return m.Load + } + return nil +} + +func (x *LoadParams) GetClosedLoop() *ClosedLoopParams { + if x, ok := x.GetLoad().(*LoadParams_ClosedLoop); ok { + return x.ClosedLoop + } + return nil +} + +func (x *LoadParams) GetPoisson() *PoissonParams { + if x, ok := x.GetLoad().(*LoadParams_Poisson); ok { + return x.Poisson + } + return nil +} + +type isLoadParams_Load interface { + isLoadParams_Load() +} + +type LoadParams_ClosedLoop struct { + ClosedLoop *ClosedLoopParams `protobuf:"bytes,1,opt,name=closed_loop,json=closedLoop,proto3,oneof"` +} + +type LoadParams_Poisson struct { + Poisson *PoissonParams `protobuf:"bytes,2,opt,name=poisson,proto3,oneof"` +} + +func (*LoadParams_ClosedLoop) isLoadParams_Load() {} + +func (*LoadParams_Poisson) isLoadParams_Load() {} + +// presence of SecurityParams implies use of TLS +type SecurityParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UseTestCa bool `protobuf:"varint,1,opt,name=use_test_ca,json=useTestCa,proto3" json:"use_test_ca,omitempty"` + ServerHostOverride string `protobuf:"bytes,2,opt,name=server_host_override,json=serverHostOverride,proto3" json:"server_host_override,omitempty"` + CredType string `protobuf:"bytes,3,opt,name=cred_type,json=credType,proto3" json:"cred_type,omitempty"` +} + +func (x *SecurityParams) Reset() { + *x = SecurityParams{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SecurityParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SecurityParams) ProtoMessage() {} + +func (x *SecurityParams) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SecurityParams.ProtoReflect.Descriptor instead. +func (*SecurityParams) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{3} +} + +func (x *SecurityParams) GetUseTestCa() bool { + if x != nil { + return x.UseTestCa + } + return false +} + +func (x *SecurityParams) GetServerHostOverride() string { + if x != nil { + return x.ServerHostOverride + } + return "" +} + +func (x *SecurityParams) GetCredType() string { + if x != nil { + return x.CredType + } + return "" +} + +type ChannelArg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Types that are assignable to Value: + // *ChannelArg_StrValue + // *ChannelArg_IntValue + Value isChannelArg_Value `protobuf_oneof:"value"` +} + +func (x *ChannelArg) Reset() { + *x = ChannelArg{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelArg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelArg) ProtoMessage() {} + +func (x *ChannelArg) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChannelArg.ProtoReflect.Descriptor instead. +func (*ChannelArg) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{4} +} + +func (x *ChannelArg) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (m *ChannelArg) GetValue() isChannelArg_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *ChannelArg) GetStrValue() string { + if x, ok := x.GetValue().(*ChannelArg_StrValue); ok { + return x.StrValue + } + return "" +} + +func (x *ChannelArg) GetIntValue() int32 { + if x, ok := x.GetValue().(*ChannelArg_IntValue); ok { + return x.IntValue + } + return 0 +} + +type isChannelArg_Value interface { + isChannelArg_Value() +} + +type ChannelArg_StrValue struct { + StrValue string `protobuf:"bytes,2,opt,name=str_value,json=strValue,proto3,oneof"` +} + +type ChannelArg_IntValue struct { + IntValue int32 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"` +} + +func (*ChannelArg_StrValue) isChannelArg_Value() {} + +func (*ChannelArg_IntValue) isChannelArg_Value() {} + +type ClientConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of targets to connect to. At least one target needs to be specified. + ServerTargets []string `protobuf:"bytes,1,rep,name=server_targets,json=serverTargets,proto3" json:"server_targets,omitempty"` + ClientType ClientType `protobuf:"varint,2,opt,name=client_type,json=clientType,proto3,enum=grpc.testing.ClientType" json:"client_type,omitempty"` + SecurityParams *SecurityParams `protobuf:"bytes,3,opt,name=security_params,json=securityParams,proto3" json:"security_params,omitempty"` + // How many concurrent RPCs to start for each channel. + // For synchronous client, use a separate thread for each outstanding RPC. + OutstandingRpcsPerChannel int32 `protobuf:"varint,4,opt,name=outstanding_rpcs_per_channel,json=outstandingRpcsPerChannel,proto3" json:"outstanding_rpcs_per_channel,omitempty"` + // Number of independent client channels to create. + // i-th channel will connect to server_target[i % server_targets.size()] + ClientChannels int32 `protobuf:"varint,5,opt,name=client_channels,json=clientChannels,proto3" json:"client_channels,omitempty"` + // Only for async client. Number of threads to use to start/manage RPCs. + AsyncClientThreads int32 `protobuf:"varint,7,opt,name=async_client_threads,json=asyncClientThreads,proto3" json:"async_client_threads,omitempty"` + RpcType RpcType `protobuf:"varint,8,opt,name=rpc_type,json=rpcType,proto3,enum=grpc.testing.RpcType" json:"rpc_type,omitempty"` + // The requested load for the entire client (aggregated over all the threads). + LoadParams *LoadParams `protobuf:"bytes,10,opt,name=load_params,json=loadParams,proto3" json:"load_params,omitempty"` + PayloadConfig *PayloadConfig `protobuf:"bytes,11,opt,name=payload_config,json=payloadConfig,proto3" json:"payload_config,omitempty"` + HistogramParams *HistogramParams `protobuf:"bytes,12,opt,name=histogram_params,json=histogramParams,proto3" json:"histogram_params,omitempty"` + // Specify the cores we should run the client on, if desired + CoreList []int32 `protobuf:"varint,13,rep,packed,name=core_list,json=coreList,proto3" json:"core_list,omitempty"` + CoreLimit int32 `protobuf:"varint,14,opt,name=core_limit,json=coreLimit,proto3" json:"core_limit,omitempty"` + // If we use an OTHER_CLIENT client_type, this string gives more detail + OtherClientApi string `protobuf:"bytes,15,opt,name=other_client_api,json=otherClientApi,proto3" json:"other_client_api,omitempty"` + ChannelArgs []*ChannelArg `protobuf:"bytes,16,rep,name=channel_args,json=channelArgs,proto3" json:"channel_args,omitempty"` + // Number of threads that share each completion queue + ThreadsPerCq int32 `protobuf:"varint,17,opt,name=threads_per_cq,json=threadsPerCq,proto3" json:"threads_per_cq,omitempty"` + // Number of messages on a stream before it gets finished/restarted + MessagesPerStream int32 `protobuf:"varint,18,opt,name=messages_per_stream,json=messagesPerStream,proto3" json:"messages_per_stream,omitempty"` + // Use coalescing API when possible. + UseCoalesceApi bool `protobuf:"varint,19,opt,name=use_coalesce_api,json=useCoalesceApi,proto3" json:"use_coalesce_api,omitempty"` + // If 0, disabled. Else, specifies the period between gathering latency + // medians in milliseconds. + MedianLatencyCollectionIntervalMillis int32 `protobuf:"varint,20,opt,name=median_latency_collection_interval_millis,json=medianLatencyCollectionIntervalMillis,proto3" json:"median_latency_collection_interval_millis,omitempty"` + // Number of client processes. 0 indicates no restriction. + ClientProcesses int32 `protobuf:"varint,21,opt,name=client_processes,json=clientProcesses,proto3" json:"client_processes,omitempty"` +} + +func (x *ClientConfig) Reset() { + *x = ClientConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientConfig) ProtoMessage() {} + +func (x *ClientConfig) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead. +func (*ClientConfig) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{5} +} + +func (x *ClientConfig) GetServerTargets() []string { + if x != nil { + return x.ServerTargets + } + return nil +} + +func (x *ClientConfig) GetClientType() ClientType { + if x != nil { + return x.ClientType + } + return ClientType_SYNC_CLIENT +} + +func (x *ClientConfig) GetSecurityParams() *SecurityParams { + if x != nil { + return x.SecurityParams + } + return nil +} + +func (x *ClientConfig) GetOutstandingRpcsPerChannel() int32 { + if x != nil { + return x.OutstandingRpcsPerChannel + } + return 0 +} + +func (x *ClientConfig) GetClientChannels() int32 { + if x != nil { + return x.ClientChannels + } + return 0 +} + +func (x *ClientConfig) GetAsyncClientThreads() int32 { + if x != nil { + return x.AsyncClientThreads + } + return 0 +} + +func (x *ClientConfig) GetRpcType() RpcType { + if x != nil { + return x.RpcType + } + return RpcType_UNARY +} + +func (x *ClientConfig) GetLoadParams() *LoadParams { + if x != nil { + return x.LoadParams + } + return nil +} + +func (x *ClientConfig) GetPayloadConfig() *PayloadConfig { + if x != nil { + return x.PayloadConfig + } + return nil +} + +func (x *ClientConfig) GetHistogramParams() *HistogramParams { + if x != nil { + return x.HistogramParams + } + return nil +} + +func (x *ClientConfig) GetCoreList() []int32 { + if x != nil { + return x.CoreList + } + return nil +} + +func (x *ClientConfig) GetCoreLimit() int32 { + if x != nil { + return x.CoreLimit + } + return 0 +} + +func (x *ClientConfig) GetOtherClientApi() string { + if x != nil { + return x.OtherClientApi + } + return "" +} + +func (x *ClientConfig) GetChannelArgs() []*ChannelArg { + if x != nil { + return x.ChannelArgs + } + return nil +} + +func (x *ClientConfig) GetThreadsPerCq() int32 { + if x != nil { + return x.ThreadsPerCq + } + return 0 +} + +func (x *ClientConfig) GetMessagesPerStream() int32 { + if x != nil { + return x.MessagesPerStream + } + return 0 +} + +func (x *ClientConfig) GetUseCoalesceApi() bool { + if x != nil { + return x.UseCoalesceApi + } + return false +} + +func (x *ClientConfig) GetMedianLatencyCollectionIntervalMillis() int32 { + if x != nil { + return x.MedianLatencyCollectionIntervalMillis + } + return 0 +} + +func (x *ClientConfig) GetClientProcesses() int32 { + if x != nil { + return x.ClientProcesses + } + return 0 +} + +type ClientStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Stats *ClientStats `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"` +} + +func (x *ClientStatus) Reset() { + *x = ClientStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientStatus) ProtoMessage() {} + +func (x *ClientStatus) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientStatus.ProtoReflect.Descriptor instead. +func (*ClientStatus) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{6} +} + +func (x *ClientStatus) GetStats() *ClientStats { + if x != nil { + return x.Stats + } + return nil +} + +// Request current stats +type Mark struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // if true, the stats will be reset after taking their snapshot. + Reset_ bool `protobuf:"varint,1,opt,name=reset,proto3" json:"reset,omitempty"` +} + +func (x *Mark) Reset() { + *x = Mark{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mark) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mark) ProtoMessage() {} + +func (x *Mark) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Mark.ProtoReflect.Descriptor instead. +func (*Mark) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{7} +} + +func (x *Mark) GetReset_() bool { + if x != nil { + return x.Reset_ + } + return false +} + +type ClientArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Argtype: + // *ClientArgs_Setup + // *ClientArgs_Mark + Argtype isClientArgs_Argtype `protobuf_oneof:"argtype"` +} + +func (x *ClientArgs) Reset() { + *x = ClientArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientArgs) ProtoMessage() {} + +func (x *ClientArgs) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientArgs.ProtoReflect.Descriptor instead. +func (*ClientArgs) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{8} +} + +func (m *ClientArgs) GetArgtype() isClientArgs_Argtype { + if m != nil { + return m.Argtype + } + return nil +} + +func (x *ClientArgs) GetSetup() *ClientConfig { + if x, ok := x.GetArgtype().(*ClientArgs_Setup); ok { + return x.Setup + } + return nil +} + +func (x *ClientArgs) GetMark() *Mark { + if x, ok := x.GetArgtype().(*ClientArgs_Mark); ok { + return x.Mark + } + return nil +} + +type isClientArgs_Argtype interface { + isClientArgs_Argtype() +} + +type ClientArgs_Setup struct { + Setup *ClientConfig `protobuf:"bytes,1,opt,name=setup,proto3,oneof"` +} + +type ClientArgs_Mark struct { + Mark *Mark `protobuf:"bytes,2,opt,name=mark,proto3,oneof"` +} + +func (*ClientArgs_Setup) isClientArgs_Argtype() {} + +func (*ClientArgs_Mark) isClientArgs_Argtype() {} + +type ServerConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServerType ServerType `protobuf:"varint,1,opt,name=server_type,json=serverType,proto3,enum=grpc.testing.ServerType" json:"server_type,omitempty"` + SecurityParams *SecurityParams `protobuf:"bytes,2,opt,name=security_params,json=securityParams,proto3" json:"security_params,omitempty"` + // Port on which to listen. Zero means pick unused port. + Port int32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` + // Only for async server. Number of threads used to serve the requests. + AsyncServerThreads int32 `protobuf:"varint,7,opt,name=async_server_threads,json=asyncServerThreads,proto3" json:"async_server_threads,omitempty"` + // Specify the number of cores to limit server to, if desired + CoreLimit int32 `protobuf:"varint,8,opt,name=core_limit,json=coreLimit,proto3" json:"core_limit,omitempty"` + // payload config, used in generic server. + // Note this must NOT be used in proto (non-generic) servers. For proto servers, + // 'response sizes' must be configured from the 'response_size' field of the + // 'SimpleRequest' objects in RPC requests. + PayloadConfig *PayloadConfig `protobuf:"bytes,9,opt,name=payload_config,json=payloadConfig,proto3" json:"payload_config,omitempty"` + // Specify the cores we should run the server on, if desired + CoreList []int32 `protobuf:"varint,10,rep,packed,name=core_list,json=coreList,proto3" json:"core_list,omitempty"` + // If we use an OTHER_SERVER client_type, this string gives more detail + OtherServerApi string `protobuf:"bytes,11,opt,name=other_server_api,json=otherServerApi,proto3" json:"other_server_api,omitempty"` + // Number of threads that share each completion queue + ThreadsPerCq int32 `protobuf:"varint,12,opt,name=threads_per_cq,json=threadsPerCq,proto3" json:"threads_per_cq,omitempty"` + // Buffer pool size (no buffer pool specified if unset) + ResourceQuotaSize int32 `protobuf:"varint,1001,opt,name=resource_quota_size,json=resourceQuotaSize,proto3" json:"resource_quota_size,omitempty"` + ChannelArgs []*ChannelArg `protobuf:"bytes,1002,rep,name=channel_args,json=channelArgs,proto3" json:"channel_args,omitempty"` + // Number of server processes. 0 indicates no restriction. + ServerProcesses int32 `protobuf:"varint,21,opt,name=server_processes,json=serverProcesses,proto3" json:"server_processes,omitempty"` +} + +func (x *ServerConfig) Reset() { + *x = ServerConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServerConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServerConfig) ProtoMessage() {} + +func (x *ServerConfig) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. +func (*ServerConfig) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{9} +} + +func (x *ServerConfig) GetServerType() ServerType { + if x != nil { + return x.ServerType + } + return ServerType_SYNC_SERVER +} + +func (x *ServerConfig) GetSecurityParams() *SecurityParams { + if x != nil { + return x.SecurityParams + } + return nil +} + +func (x *ServerConfig) GetPort() int32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *ServerConfig) GetAsyncServerThreads() int32 { + if x != nil { + return x.AsyncServerThreads + } + return 0 +} + +func (x *ServerConfig) GetCoreLimit() int32 { + if x != nil { + return x.CoreLimit + } + return 0 +} + +func (x *ServerConfig) GetPayloadConfig() *PayloadConfig { + if x != nil { + return x.PayloadConfig + } + return nil +} + +func (x *ServerConfig) GetCoreList() []int32 { + if x != nil { + return x.CoreList + } + return nil +} + +func (x *ServerConfig) GetOtherServerApi() string { + if x != nil { + return x.OtherServerApi + } + return "" +} + +func (x *ServerConfig) GetThreadsPerCq() int32 { + if x != nil { + return x.ThreadsPerCq + } + return 0 +} + +func (x *ServerConfig) GetResourceQuotaSize() int32 { + if x != nil { + return x.ResourceQuotaSize + } + return 0 +} + +func (x *ServerConfig) GetChannelArgs() []*ChannelArg { + if x != nil { + return x.ChannelArgs + } + return nil +} + +func (x *ServerConfig) GetServerProcesses() int32 { + if x != nil { + return x.ServerProcesses + } + return 0 +} + +type ServerArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Argtype: + // *ServerArgs_Setup + // *ServerArgs_Mark + Argtype isServerArgs_Argtype `protobuf_oneof:"argtype"` +} + +func (x *ServerArgs) Reset() { + *x = ServerArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServerArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServerArgs) ProtoMessage() {} + +func (x *ServerArgs) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServerArgs.ProtoReflect.Descriptor instead. +func (*ServerArgs) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{10} +} + +func (m *ServerArgs) GetArgtype() isServerArgs_Argtype { + if m != nil { + return m.Argtype + } + return nil +} + +func (x *ServerArgs) GetSetup() *ServerConfig { + if x, ok := x.GetArgtype().(*ServerArgs_Setup); ok { + return x.Setup + } + return nil +} + +func (x *ServerArgs) GetMark() *Mark { + if x, ok := x.GetArgtype().(*ServerArgs_Mark); ok { + return x.Mark + } + return nil +} + +type isServerArgs_Argtype interface { + isServerArgs_Argtype() +} + +type ServerArgs_Setup struct { + Setup *ServerConfig `protobuf:"bytes,1,opt,name=setup,proto3,oneof"` +} + +type ServerArgs_Mark struct { + Mark *Mark `protobuf:"bytes,2,opt,name=mark,proto3,oneof"` +} + +func (*ServerArgs_Setup) isServerArgs_Argtype() {} + +func (*ServerArgs_Mark) isServerArgs_Argtype() {} + +type ServerStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Stats *ServerStats `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"` + // the port bound by the server + Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + // Number of cores available to the server + Cores int32 `protobuf:"varint,3,opt,name=cores,proto3" json:"cores,omitempty"` +} + +func (x *ServerStatus) Reset() { + *x = ServerStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServerStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServerStatus) ProtoMessage() {} + +func (x *ServerStatus) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServerStatus.ProtoReflect.Descriptor instead. +func (*ServerStatus) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{11} +} + +func (x *ServerStatus) GetStats() *ServerStats { + if x != nil { + return x.Stats + } + return nil +} + +func (x *ServerStatus) GetPort() int32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *ServerStatus) GetCores() int32 { + if x != nil { + return x.Cores + } + return 0 +} + +type CoreRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CoreRequest) Reset() { + *x = CoreRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CoreRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CoreRequest) ProtoMessage() {} + +func (x *CoreRequest) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CoreRequest.ProtoReflect.Descriptor instead. +func (*CoreRequest) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{12} +} + +type CoreResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Number of cores available on the server + Cores int32 `protobuf:"varint,1,opt,name=cores,proto3" json:"cores,omitempty"` +} + +func (x *CoreResponse) Reset() { + *x = CoreResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CoreResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CoreResponse) ProtoMessage() {} + +func (x *CoreResponse) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CoreResponse.ProtoReflect.Descriptor instead. +func (*CoreResponse) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{13} +} + +func (x *CoreResponse) GetCores() int32 { + if x != nil { + return x.Cores + } + return 0 +} + +type Void struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Void) Reset() { + *x = Void{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Void) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Void) ProtoMessage() {} + +func (x *Void) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Void.ProtoReflect.Descriptor instead. +func (*Void) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{14} +} + +// A single performance scenario: input to qps_json_driver +type Scenario struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Human readable name for this scenario + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Client configuration + ClientConfig *ClientConfig `protobuf:"bytes,2,opt,name=client_config,json=clientConfig,proto3" json:"client_config,omitempty"` + // Number of clients to start for the test + NumClients int32 `protobuf:"varint,3,opt,name=num_clients,json=numClients,proto3" json:"num_clients,omitempty"` + // Server configuration + ServerConfig *ServerConfig `protobuf:"bytes,4,opt,name=server_config,json=serverConfig,proto3" json:"server_config,omitempty"` + // Number of servers to start for the test + NumServers int32 `protobuf:"varint,5,opt,name=num_servers,json=numServers,proto3" json:"num_servers,omitempty"` + // Warmup period, in seconds + WarmupSeconds int32 `protobuf:"varint,6,opt,name=warmup_seconds,json=warmupSeconds,proto3" json:"warmup_seconds,omitempty"` + // Benchmark time, in seconds + BenchmarkSeconds int32 `protobuf:"varint,7,opt,name=benchmark_seconds,json=benchmarkSeconds,proto3" json:"benchmark_seconds,omitempty"` + // Number of workers to spawn locally (usually zero) + SpawnLocalWorkerCount int32 `protobuf:"varint,8,opt,name=spawn_local_worker_count,json=spawnLocalWorkerCount,proto3" json:"spawn_local_worker_count,omitempty"` +} + +func (x *Scenario) Reset() { + *x = Scenario{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Scenario) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Scenario) ProtoMessage() {} + +func (x *Scenario) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Scenario.ProtoReflect.Descriptor instead. +func (*Scenario) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{15} +} + +func (x *Scenario) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Scenario) GetClientConfig() *ClientConfig { + if x != nil { + return x.ClientConfig + } + return nil +} + +func (x *Scenario) GetNumClients() int32 { + if x != nil { + return x.NumClients + } + return 0 +} + +func (x *Scenario) GetServerConfig() *ServerConfig { + if x != nil { + return x.ServerConfig + } + return nil +} + +func (x *Scenario) GetNumServers() int32 { + if x != nil { + return x.NumServers + } + return 0 +} + +func (x *Scenario) GetWarmupSeconds() int32 { + if x != nil { + return x.WarmupSeconds + } + return 0 +} + +func (x *Scenario) GetBenchmarkSeconds() int32 { + if x != nil { + return x.BenchmarkSeconds + } + return 0 +} + +func (x *Scenario) GetSpawnLocalWorkerCount() int32 { + if x != nil { + return x.SpawnLocalWorkerCount + } + return 0 +} + +// A set of scenarios to be run with qps_json_driver +type Scenarios struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scenarios []*Scenario `protobuf:"bytes,1,rep,name=scenarios,proto3" json:"scenarios,omitempty"` +} + +func (x *Scenarios) Reset() { + *x = Scenarios{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Scenarios) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Scenarios) ProtoMessage() {} + +func (x *Scenarios) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Scenarios.ProtoReflect.Descriptor instead. +func (*Scenarios) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{16} +} + +func (x *Scenarios) GetScenarios() []*Scenario { + if x != nil { + return x.Scenarios + } + return nil +} + +// Basic summary that can be computed from ClientStats and ServerStats +// once the scenario has finished. +type ScenarioResultSummary struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Total number of operations per second over all clients. What is counted as 1 'operation' depends on the benchmark scenarios: + // For unary benchmarks, an operation is processing of a single unary RPC. + // For streaming benchmarks, an operation is processing of a single ping pong of request and response. + Qps float64 `protobuf:"fixed64,1,opt,name=qps,proto3" json:"qps,omitempty"` + // QPS per server core. + QpsPerServerCore float64 `protobuf:"fixed64,2,opt,name=qps_per_server_core,json=qpsPerServerCore,proto3" json:"qps_per_server_core,omitempty"` + // The total server cpu load based on system time across all server processes, expressed as percentage of a single cpu core. + // For example, 85 implies 85% of a cpu core, 125 implies 125% of a cpu core. Since we are accumulating the cpu load across all the server + // processes, the value could > 100 when there are multiple servers or a single server using multiple threads and cores. + // Same explanation for the total client cpu load below. + ServerSystemTime float64 `protobuf:"fixed64,3,opt,name=server_system_time,json=serverSystemTime,proto3" json:"server_system_time,omitempty"` + // The total server cpu load based on user time across all server processes, expressed as percentage of a single cpu core. (85 => 85%, 125 => 125%) + ServerUserTime float64 `protobuf:"fixed64,4,opt,name=server_user_time,json=serverUserTime,proto3" json:"server_user_time,omitempty"` + // The total client cpu load based on system time across all client processes, expressed as percentage of a single cpu core. (85 => 85%, 125 => 125%) + ClientSystemTime float64 `protobuf:"fixed64,5,opt,name=client_system_time,json=clientSystemTime,proto3" json:"client_system_time,omitempty"` + // The total client cpu load based on user time across all client processes, expressed as percentage of a single cpu core. (85 => 85%, 125 => 125%) + ClientUserTime float64 `protobuf:"fixed64,6,opt,name=client_user_time,json=clientUserTime,proto3" json:"client_user_time,omitempty"` + // X% latency percentiles (in nanoseconds) + Latency_50 float64 `protobuf:"fixed64,7,opt,name=latency_50,json=latency50,proto3" json:"latency_50,omitempty"` + Latency_90 float64 `protobuf:"fixed64,8,opt,name=latency_90,json=latency90,proto3" json:"latency_90,omitempty"` + Latency_95 float64 `protobuf:"fixed64,9,opt,name=latency_95,json=latency95,proto3" json:"latency_95,omitempty"` + Latency_99 float64 `protobuf:"fixed64,10,opt,name=latency_99,json=latency99,proto3" json:"latency_99,omitempty"` + Latency_999 float64 `protobuf:"fixed64,11,opt,name=latency_999,json=latency999,proto3" json:"latency_999,omitempty"` + // server cpu usage percentage + ServerCpuUsage float64 `protobuf:"fixed64,12,opt,name=server_cpu_usage,json=serverCpuUsage,proto3" json:"server_cpu_usage,omitempty"` + // Number of requests that succeeded/failed + SuccessfulRequestsPerSecond float64 `protobuf:"fixed64,13,opt,name=successful_requests_per_second,json=successfulRequestsPerSecond,proto3" json:"successful_requests_per_second,omitempty"` + FailedRequestsPerSecond float64 `protobuf:"fixed64,14,opt,name=failed_requests_per_second,json=failedRequestsPerSecond,proto3" json:"failed_requests_per_second,omitempty"` + // Number of polls called inside completion queue per request + ClientPollsPerRequest float64 `protobuf:"fixed64,15,opt,name=client_polls_per_request,json=clientPollsPerRequest,proto3" json:"client_polls_per_request,omitempty"` + ServerPollsPerRequest float64 `protobuf:"fixed64,16,opt,name=server_polls_per_request,json=serverPollsPerRequest,proto3" json:"server_polls_per_request,omitempty"` + // Queries per CPU-sec over all servers or clients + ServerQueriesPerCpuSec float64 `protobuf:"fixed64,17,opt,name=server_queries_per_cpu_sec,json=serverQueriesPerCpuSec,proto3" json:"server_queries_per_cpu_sec,omitempty"` + ClientQueriesPerCpuSec float64 `protobuf:"fixed64,18,opt,name=client_queries_per_cpu_sec,json=clientQueriesPerCpuSec,proto3" json:"client_queries_per_cpu_sec,omitempty"` +} + +func (x *ScenarioResultSummary) Reset() { + *x = ScenarioResultSummary{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScenarioResultSummary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScenarioResultSummary) ProtoMessage() {} + +func (x *ScenarioResultSummary) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScenarioResultSummary.ProtoReflect.Descriptor instead. +func (*ScenarioResultSummary) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{17} +} + +func (x *ScenarioResultSummary) GetQps() float64 { + if x != nil { + return x.Qps + } + return 0 +} + +func (x *ScenarioResultSummary) GetQpsPerServerCore() float64 { + if x != nil { + return x.QpsPerServerCore + } + return 0 +} + +func (x *ScenarioResultSummary) GetServerSystemTime() float64 { + if x != nil { + return x.ServerSystemTime + } + return 0 +} + +func (x *ScenarioResultSummary) GetServerUserTime() float64 { + if x != nil { + return x.ServerUserTime + } + return 0 +} + +func (x *ScenarioResultSummary) GetClientSystemTime() float64 { + if x != nil { + return x.ClientSystemTime + } + return 0 +} + +func (x *ScenarioResultSummary) GetClientUserTime() float64 { + if x != nil { + return x.ClientUserTime + } + return 0 +} + +func (x *ScenarioResultSummary) GetLatency_50() float64 { + if x != nil { + return x.Latency_50 + } + return 0 +} + +func (x *ScenarioResultSummary) GetLatency_90() float64 { + if x != nil { + return x.Latency_90 + } + return 0 +} + +func (x *ScenarioResultSummary) GetLatency_95() float64 { + if x != nil { + return x.Latency_95 + } + return 0 +} + +func (x *ScenarioResultSummary) GetLatency_99() float64 { + if x != nil { + return x.Latency_99 + } + return 0 +} + +func (x *ScenarioResultSummary) GetLatency_999() float64 { + if x != nil { + return x.Latency_999 + } + return 0 +} + +func (x *ScenarioResultSummary) GetServerCpuUsage() float64 { + if x != nil { + return x.ServerCpuUsage + } + return 0 +} + +func (x *ScenarioResultSummary) GetSuccessfulRequestsPerSecond() float64 { + if x != nil { + return x.SuccessfulRequestsPerSecond + } + return 0 +} + +func (x *ScenarioResultSummary) GetFailedRequestsPerSecond() float64 { + if x != nil { + return x.FailedRequestsPerSecond + } + return 0 +} + +func (x *ScenarioResultSummary) GetClientPollsPerRequest() float64 { + if x != nil { + return x.ClientPollsPerRequest + } + return 0 +} + +func (x *ScenarioResultSummary) GetServerPollsPerRequest() float64 { + if x != nil { + return x.ServerPollsPerRequest + } + return 0 +} + +func (x *ScenarioResultSummary) GetServerQueriesPerCpuSec() float64 { + if x != nil { + return x.ServerQueriesPerCpuSec + } + return 0 +} + +func (x *ScenarioResultSummary) GetClientQueriesPerCpuSec() float64 { + if x != nil { + return x.ClientQueriesPerCpuSec + } + return 0 +} + +// Results of a single benchmark scenario. +type ScenarioResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Inputs used to run the scenario. + Scenario *Scenario `protobuf:"bytes,1,opt,name=scenario,proto3" json:"scenario,omitempty"` + // Histograms from all clients merged into one histogram. + Latencies *HistogramData `protobuf:"bytes,2,opt,name=latencies,proto3" json:"latencies,omitempty"` + // Client stats for each client + ClientStats []*ClientStats `protobuf:"bytes,3,rep,name=client_stats,json=clientStats,proto3" json:"client_stats,omitempty"` + // Server stats for each server + ServerStats []*ServerStats `protobuf:"bytes,4,rep,name=server_stats,json=serverStats,proto3" json:"server_stats,omitempty"` + // Number of cores available to each server + ServerCores []int32 `protobuf:"varint,5,rep,packed,name=server_cores,json=serverCores,proto3" json:"server_cores,omitempty"` + // An after-the-fact computed summary + Summary *ScenarioResultSummary `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` + // Information on success or failure of each worker + ClientSuccess []bool `protobuf:"varint,7,rep,packed,name=client_success,json=clientSuccess,proto3" json:"client_success,omitempty"` + ServerSuccess []bool `protobuf:"varint,8,rep,packed,name=server_success,json=serverSuccess,proto3" json:"server_success,omitempty"` + // Number of failed requests (one row per status code seen) + RequestResults []*RequestResultCount `protobuf:"bytes,9,rep,name=request_results,json=requestResults,proto3" json:"request_results,omitempty"` +} + +func (x *ScenarioResult) Reset() { + *x = ScenarioResult{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_control_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScenarioResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScenarioResult) ProtoMessage() {} + +func (x *ScenarioResult) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_control_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScenarioResult.ProtoReflect.Descriptor instead. +func (*ScenarioResult) Descriptor() ([]byte, []int) { + return file_grpc_testing_control_proto_rawDescGZIP(), []int{18} +} + +func (x *ScenarioResult) GetScenario() *Scenario { + if x != nil { + return x.Scenario + } + return nil +} + +func (x *ScenarioResult) GetLatencies() *HistogramData { + if x != nil { + return x.Latencies + } + return nil +} + +func (x *ScenarioResult) GetClientStats() []*ClientStats { + if x != nil { + return x.ClientStats + } + return nil +} + +func (x *ScenarioResult) GetServerStats() []*ServerStats { + if x != nil { + return x.ServerStats + } + return nil +} + +func (x *ScenarioResult) GetServerCores() []int32 { + if x != nil { + return x.ServerCores + } + return nil +} + +func (x *ScenarioResult) GetSummary() *ScenarioResultSummary { + if x != nil { + return x.Summary + } + return nil +} + +func (x *ScenarioResult) GetClientSuccess() []bool { + if x != nil { + return x.ClientSuccess + } + return nil +} + +func (x *ScenarioResult) GetServerSuccess() []bool { + if x != nil { + return x.ServerSuccess + } + return nil +} + +func (x *ScenarioResult) GetRequestResults() []*RequestResultCount { + if x != nil { + return x.RequestResults + } + return nil +} + +var File_grpc_testing_control_proto protoreflect.FileDescriptor + +var file_grpc_testing_control_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x1b, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x32, 0x0a, 0x0d, 0x50, 0x6f, 0x69, 0x73, 0x73, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x65, 0x64, 0x5f, 0x6c, 0x6f, + 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x65, + 0x64, 0x4c, 0x6f, 0x61, 0x64, 0x22, 0x12, 0x0a, 0x10, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x4c, + 0x6f, 0x6f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, + 0x61, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x6c, 0x6f, 0x73, + 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x6f, + 0x73, 0x65, 0x64, 0x4c, 0x6f, 0x6f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, + 0x0a, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x4c, 0x6f, 0x6f, 0x70, 0x12, 0x37, 0x0a, 0x07, 0x70, + 0x6f, 0x69, 0x73, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x6f, 0x69, 0x73, + 0x73, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x07, 0x70, 0x6f, 0x69, + 0x73, 0x73, 0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x7f, 0x0a, 0x0e, + 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, + 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, 0x73, 0x65, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x12, 0x30, + 0x0a, 0x14, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6f, 0x76, + 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x72, 0x65, 0x64, 0x54, 0x79, 0x70, 0x65, 0x22, 0x67, 0x0a, + 0x0a, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x41, 0x72, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1d, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x73, 0x74, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, + 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xf6, 0x07, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x39, + 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x45, 0x0a, 0x0f, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x3f, 0x0a, 0x1c, 0x6f, 0x75, 0x74, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, + 0x72, 0x70, 0x63, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x19, 0x6f, 0x75, 0x74, 0x73, 0x74, 0x61, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x52, 0x70, 0x63, 0x73, 0x50, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x61, 0x73, + 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x61, + 0x64, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x12, 0x30, 0x0a, 0x08, + 0x72, 0x70, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x70, + 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x72, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, + 0x0a, 0x0b, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0a, 0x6c, + 0x6f, 0x61, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x48, 0x0a, + 0x10, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, + 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x72, 0x65, 0x5f, + 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f, 0x72, 0x65, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6f, 0x72, 0x65, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x70, 0x69, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, + 0x74, 0x68, 0x65, 0x72, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x12, 0x3b, 0x0a, + 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, 0x10, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x41, 0x72, 0x67, 0x52, 0x0b, 0x63, + 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x41, 0x72, 0x67, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x68, + 0x72, 0x65, 0x61, 0x64, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x71, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0c, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x50, 0x65, 0x72, 0x43, 0x71, + 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x5f, 0x70, 0x65, 0x72, + 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x50, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x12, 0x28, 0x0a, 0x10, 0x75, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x61, 0x6c, 0x65, 0x73, 0x63, 0x65, + 0x5f, 0x61, 0x70, 0x69, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x75, 0x73, 0x65, 0x43, + 0x6f, 0x61, 0x6c, 0x65, 0x73, 0x63, 0x65, 0x41, 0x70, 0x69, 0x12, 0x58, 0x0a, 0x29, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x6e, 0x5f, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x25, 0x6d, + 0x65, 0x64, 0x69, 0x61, 0x6e, 0x4c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x4d, 0x69, + 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x70, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, + 0x3f, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x2f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, + 0x22, 0x1c, 0x0a, 0x04, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x73, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x73, 0x65, 0x74, 0x22, 0x75, + 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x72, 0x67, 0x73, 0x12, 0x32, 0x0a, 0x05, + 0x73, 0x65, 0x74, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x05, 0x73, 0x65, 0x74, 0x75, 0x70, + 0x12, 0x28, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x61, + 0x72, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x72, + 0x67, 0x74, 0x79, 0x70, 0x65, 0x22, 0xc0, 0x04, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x39, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x45, 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x30, 0x0a, 0x14, + 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x68, 0x72, + 0x65, 0x61, 0x64, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x61, 0x73, 0x79, 0x6e, + 0x63, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x63, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x42, 0x0a, + 0x0e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0a, + 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f, 0x72, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x28, + 0x0a, 0x10, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, + 0x70, 0x69, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x70, 0x69, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x68, 0x72, 0x65, + 0x61, 0x64, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x71, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x50, 0x65, 0x72, 0x43, 0x71, 0x12, 0x2f, + 0x0a, 0x13, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x3c, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, + 0xea, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x41, 0x72, 0x67, + 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x41, 0x72, 0x67, 0x73, 0x12, 0x29, 0x0a, + 0x10, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, + 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x75, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x41, 0x72, 0x67, 0x73, 0x12, 0x32, 0x0a, 0x05, 0x73, 0x65, 0x74, 0x75, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x48, 0x00, 0x52, 0x05, 0x73, 0x65, 0x74, 0x75, 0x70, 0x12, 0x28, 0x0a, 0x04, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x48, 0x00, 0x52, 0x04, + 0x6d, 0x61, 0x72, 0x6b, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x72, 0x67, 0x74, 0x79, 0x70, 0x65, 0x22, + 0x69, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x2f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x22, 0x0d, 0x0a, 0x0b, 0x43, 0x6f, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x24, 0x0a, 0x0c, 0x43, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x72, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x22, + 0x06, 0x0a, 0x04, 0x56, 0x6f, 0x69, 0x64, 0x22, 0xef, 0x02, 0x0a, 0x08, 0x53, 0x63, 0x65, 0x6e, + 0x61, 0x72, 0x69, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x75, 0x6d, + 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x6e, 0x75, 0x6d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x0d, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, + 0x75, 0x6d, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x6e, 0x75, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x25, 0x0a, 0x0e, + 0x77, 0x61, 0x72, 0x6d, 0x75, 0x70, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x77, 0x61, 0x72, 0x6d, 0x75, 0x70, 0x53, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, + 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, + 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, + 0x12, 0x37, 0x0a, 0x18, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, + 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x15, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x57, 0x6f, + 0x72, 0x6b, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x41, 0x0a, 0x09, 0x53, 0x63, 0x65, + 0x6e, 0x61, 0x72, 0x69, 0x6f, 0x73, 0x12, 0x34, 0x0a, 0x09, 0x73, 0x63, 0x65, 0x6e, 0x61, 0x72, + 0x69, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, + 0x6f, 0x52, 0x09, 0x73, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, 0x73, 0x22, 0xbb, 0x06, 0x0a, + 0x15, 0x53, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x71, 0x70, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x03, 0x71, 0x70, 0x73, 0x12, 0x2d, 0x0a, 0x13, 0x71, 0x70, 0x73, 0x5f, + 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x71, 0x70, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x2c, 0x0a, 0x12, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x28, 0x0a, + 0x10, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x74, 0x65, 0x6e, + 0x63, 0x79, 0x5f, 0x35, 0x30, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x61, 0x74, + 0x65, 0x6e, 0x63, 0x79, 0x35, 0x30, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, + 0x79, 0x5f, 0x39, 0x30, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x61, 0x74, 0x65, + 0x6e, 0x63, 0x79, 0x39, 0x30, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, + 0x5f, 0x39, 0x35, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x61, 0x74, 0x65, 0x6e, + 0x63, 0x79, 0x39, 0x35, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, + 0x39, 0x39, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, + 0x79, 0x39, 0x39, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x39, + 0x39, 0x39, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, + 0x79, 0x39, 0x39, 0x39, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x63, + 0x70, 0x75, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x70, 0x75, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x43, + 0x0a, 0x1e, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x5f, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x1b, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, + 0x75, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x01, 0x52, 0x17, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x12, 0x37, 0x0a, 0x18, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x6c, 0x73, + 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x15, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x6c, 0x73, 0x50, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x18, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x6c, 0x6c, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x6c, 0x73, 0x50, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x71, 0x75, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x70, 0x75, 0x5f, 0x73, 0x65, 0x63, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x01, 0x52, 0x16, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x51, 0x75, + 0x65, 0x72, 0x69, 0x65, 0x73, 0x50, 0x65, 0x72, 0x43, 0x70, 0x75, 0x53, 0x65, 0x63, 0x12, 0x3a, + 0x0a, 0x1a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, + 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x70, 0x75, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x12, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x16, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, + 0x73, 0x50, 0x65, 0x72, 0x43, 0x70, 0x75, 0x53, 0x65, 0x63, 0x22, 0xf6, 0x03, 0x0a, 0x0e, 0x53, + 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, + 0x08, 0x73, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, + 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, 0x52, 0x08, 0x73, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, + 0x6f, 0x12, 0x39, 0x0a, 0x09, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x67, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x09, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0c, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x0b, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x3c, 0x0a, 0x0c, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x0b, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x07, 0x73, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x63, 0x65, 0x6e, + 0x61, 0x72, 0x69, 0x6f, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x08, 0x52, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x08, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x73, 0x2a, 0x56, 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, + 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x43, 0x4c, 0x49, 0x45, + 0x4e, 0x54, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x5f, 0x43, 0x4c, + 0x49, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x41, 0x4c, 0x4c, 0x42, 0x41, + 0x43, 0x4b, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x2a, 0x70, 0x0a, 0x0a, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x59, 0x4e, + 0x43, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x53, + 0x59, 0x4e, 0x43, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, + 0x41, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x49, 0x43, 0x5f, 0x53, 0x45, + 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x5f, + 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x41, 0x4c, 0x4c, + 0x42, 0x41, 0x43, 0x4b, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x04, 0x2a, 0x72, 0x0a, + 0x07, 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x4e, 0x41, 0x52, + 0x59, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4d, 0x49, 0x4e, 0x47, + 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4d, 0x49, 0x4e, 0x47, 0x5f, + 0x46, 0x52, 0x4f, 0x4d, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x19, 0x0a, + 0x15, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4d, 0x49, 0x4e, 0x47, 0x5f, 0x46, 0x52, 0x4f, 0x4d, 0x5f, + 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x54, 0x52, 0x45, + 0x41, 0x4d, 0x49, 0x4e, 0x47, 0x5f, 0x42, 0x4f, 0x54, 0x48, 0x5f, 0x57, 0x41, 0x59, 0x53, 0x10, + 0x04, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_grpc_testing_control_proto_rawDescOnce sync.Once + file_grpc_testing_control_proto_rawDescData = file_grpc_testing_control_proto_rawDesc +) + +func file_grpc_testing_control_proto_rawDescGZIP() []byte { + file_grpc_testing_control_proto_rawDescOnce.Do(func() { + file_grpc_testing_control_proto_rawDescData = protoimpl.X.CompressGZIP(file_grpc_testing_control_proto_rawDescData) + }) + return file_grpc_testing_control_proto_rawDescData +} + +var file_grpc_testing_control_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_grpc_testing_control_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_grpc_testing_control_proto_goTypes = []interface{}{ + (ClientType)(0), // 0: grpc.testing.ClientType + (ServerType)(0), // 1: grpc.testing.ServerType + (RpcType)(0), // 2: grpc.testing.RpcType + (*PoissonParams)(nil), // 3: grpc.testing.PoissonParams + (*ClosedLoopParams)(nil), // 4: grpc.testing.ClosedLoopParams + (*LoadParams)(nil), // 5: grpc.testing.LoadParams + (*SecurityParams)(nil), // 6: grpc.testing.SecurityParams + (*ChannelArg)(nil), // 7: grpc.testing.ChannelArg + (*ClientConfig)(nil), // 8: grpc.testing.ClientConfig + (*ClientStatus)(nil), // 9: grpc.testing.ClientStatus + (*Mark)(nil), // 10: grpc.testing.Mark + (*ClientArgs)(nil), // 11: grpc.testing.ClientArgs + (*ServerConfig)(nil), // 12: grpc.testing.ServerConfig + (*ServerArgs)(nil), // 13: grpc.testing.ServerArgs + (*ServerStatus)(nil), // 14: grpc.testing.ServerStatus + (*CoreRequest)(nil), // 15: grpc.testing.CoreRequest + (*CoreResponse)(nil), // 16: grpc.testing.CoreResponse + (*Void)(nil), // 17: grpc.testing.Void + (*Scenario)(nil), // 18: grpc.testing.Scenario + (*Scenarios)(nil), // 19: grpc.testing.Scenarios + (*ScenarioResultSummary)(nil), // 20: grpc.testing.ScenarioResultSummary + (*ScenarioResult)(nil), // 21: grpc.testing.ScenarioResult + (*PayloadConfig)(nil), // 22: grpc.testing.PayloadConfig + (*HistogramParams)(nil), // 23: grpc.testing.HistogramParams + (*ClientStats)(nil), // 24: grpc.testing.ClientStats + (*ServerStats)(nil), // 25: grpc.testing.ServerStats + (*HistogramData)(nil), // 26: grpc.testing.HistogramData + (*RequestResultCount)(nil), // 27: grpc.testing.RequestResultCount +} +var file_grpc_testing_control_proto_depIdxs = []int32{ + 4, // 0: grpc.testing.LoadParams.closed_loop:type_name -> grpc.testing.ClosedLoopParams + 3, // 1: grpc.testing.LoadParams.poisson:type_name -> grpc.testing.PoissonParams + 0, // 2: grpc.testing.ClientConfig.client_type:type_name -> grpc.testing.ClientType + 6, // 3: grpc.testing.ClientConfig.security_params:type_name -> grpc.testing.SecurityParams + 2, // 4: grpc.testing.ClientConfig.rpc_type:type_name -> grpc.testing.RpcType + 5, // 5: grpc.testing.ClientConfig.load_params:type_name -> grpc.testing.LoadParams + 22, // 6: grpc.testing.ClientConfig.payload_config:type_name -> grpc.testing.PayloadConfig + 23, // 7: grpc.testing.ClientConfig.histogram_params:type_name -> grpc.testing.HistogramParams + 7, // 8: grpc.testing.ClientConfig.channel_args:type_name -> grpc.testing.ChannelArg + 24, // 9: grpc.testing.ClientStatus.stats:type_name -> grpc.testing.ClientStats + 8, // 10: grpc.testing.ClientArgs.setup:type_name -> grpc.testing.ClientConfig + 10, // 11: grpc.testing.ClientArgs.mark:type_name -> grpc.testing.Mark + 1, // 12: grpc.testing.ServerConfig.server_type:type_name -> grpc.testing.ServerType + 6, // 13: grpc.testing.ServerConfig.security_params:type_name -> grpc.testing.SecurityParams + 22, // 14: grpc.testing.ServerConfig.payload_config:type_name -> grpc.testing.PayloadConfig + 7, // 15: grpc.testing.ServerConfig.channel_args:type_name -> grpc.testing.ChannelArg + 12, // 16: grpc.testing.ServerArgs.setup:type_name -> grpc.testing.ServerConfig + 10, // 17: grpc.testing.ServerArgs.mark:type_name -> grpc.testing.Mark + 25, // 18: grpc.testing.ServerStatus.stats:type_name -> grpc.testing.ServerStats + 8, // 19: grpc.testing.Scenario.client_config:type_name -> grpc.testing.ClientConfig + 12, // 20: grpc.testing.Scenario.server_config:type_name -> grpc.testing.ServerConfig + 18, // 21: grpc.testing.Scenarios.scenarios:type_name -> grpc.testing.Scenario + 18, // 22: grpc.testing.ScenarioResult.scenario:type_name -> grpc.testing.Scenario + 26, // 23: grpc.testing.ScenarioResult.latencies:type_name -> grpc.testing.HistogramData + 24, // 24: grpc.testing.ScenarioResult.client_stats:type_name -> grpc.testing.ClientStats + 25, // 25: grpc.testing.ScenarioResult.server_stats:type_name -> grpc.testing.ServerStats + 20, // 26: grpc.testing.ScenarioResult.summary:type_name -> grpc.testing.ScenarioResultSummary + 27, // 27: grpc.testing.ScenarioResult.request_results:type_name -> grpc.testing.RequestResultCount + 28, // [28:28] is the sub-list for method output_type + 28, // [28:28] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name +} + +func init() { file_grpc_testing_control_proto_init() } +func file_grpc_testing_control_proto_init() { + if File_grpc_testing_control_proto != nil { + return + } + file_grpc_testing_payloads_proto_init() + file_grpc_testing_stats_proto_init() + if !protoimpl.UnsafeEnabled { + file_grpc_testing_control_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PoissonParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClosedLoopParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoadParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SecurityParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelArg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mark); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServerConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServerArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServerStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CoreRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CoreResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Void); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Scenario); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Scenarios); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScenarioResultSummary); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_control_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScenarioResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_grpc_testing_control_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*LoadParams_ClosedLoop)(nil), + (*LoadParams_Poisson)(nil), + } + file_grpc_testing_control_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*ChannelArg_StrValue)(nil), + (*ChannelArg_IntValue)(nil), + } + file_grpc_testing_control_proto_msgTypes[8].OneofWrappers = []interface{}{ + (*ClientArgs_Setup)(nil), + (*ClientArgs_Mark)(nil), + } + file_grpc_testing_control_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*ServerArgs_Setup)(nil), + (*ServerArgs_Mark)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_grpc_testing_control_proto_rawDesc, + NumEnums: 3, + NumMessages: 19, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_grpc_testing_control_proto_goTypes, + DependencyIndexes: file_grpc_testing_control_proto_depIdxs, + EnumInfos: file_grpc_testing_control_proto_enumTypes, + MessageInfos: file_grpc_testing_control_proto_msgTypes, + }.Build() + File_grpc_testing_control_proto = out.File + file_grpc_testing_control_proto_rawDesc = nil + file_grpc_testing_control_proto_goTypes = nil + file_grpc_testing_control_proto_depIdxs = nil +} diff --git a/interop/grpc_testing/core/stats.pb.go b/interop/grpc_testing/core/stats.pb.go new file mode 100644 index 000000000000..e5652dc78cc3 --- /dev/null +++ b/interop/grpc_testing/core/stats.pb.go @@ -0,0 +1,412 @@ +// Copyright 2017 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: grpc/core/stats.proto + +package grpc_core + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Bucket struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start float64 `protobuf:"fixed64,1,opt,name=start,proto3" json:"start,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *Bucket) Reset() { + *x = Bucket{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_core_stats_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Bucket) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bucket) ProtoMessage() {} + +func (x *Bucket) ProtoReflect() protoreflect.Message { + mi := &file_grpc_core_stats_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bucket.ProtoReflect.Descriptor instead. +func (*Bucket) Descriptor() ([]byte, []int) { + return file_grpc_core_stats_proto_rawDescGZIP(), []int{0} +} + +func (x *Bucket) GetStart() float64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *Bucket) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +type Histogram struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Buckets []*Bucket `protobuf:"bytes,1,rep,name=buckets,proto3" json:"buckets,omitempty"` +} + +func (x *Histogram) Reset() { + *x = Histogram{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_core_stats_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Histogram) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Histogram) ProtoMessage() {} + +func (x *Histogram) ProtoReflect() protoreflect.Message { + mi := &file_grpc_core_stats_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Histogram.ProtoReflect.Descriptor instead. +func (*Histogram) Descriptor() ([]byte, []int) { + return file_grpc_core_stats_proto_rawDescGZIP(), []int{1} +} + +func (x *Histogram) GetBuckets() []*Bucket { + if x != nil { + return x.Buckets + } + return nil +} + +type Metric struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Types that are assignable to Value: + // *Metric_Count + // *Metric_Histogram + Value isMetric_Value `protobuf_oneof:"value"` +} + +func (x *Metric) Reset() { + *x = Metric{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_core_stats_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metric) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metric) ProtoMessage() {} + +func (x *Metric) ProtoReflect() protoreflect.Message { + mi := &file_grpc_core_stats_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Metric.ProtoReflect.Descriptor instead. +func (*Metric) Descriptor() ([]byte, []int) { + return file_grpc_core_stats_proto_rawDescGZIP(), []int{2} +} + +func (x *Metric) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (m *Metric) GetValue() isMetric_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *Metric) GetCount() uint64 { + if x, ok := x.GetValue().(*Metric_Count); ok { + return x.Count + } + return 0 +} + +func (x *Metric) GetHistogram() *Histogram { + if x, ok := x.GetValue().(*Metric_Histogram); ok { + return x.Histogram + } + return nil +} + +type isMetric_Value interface { + isMetric_Value() +} + +type Metric_Count struct { + Count uint64 `protobuf:"varint,10,opt,name=count,proto3,oneof"` +} + +type Metric_Histogram struct { + Histogram *Histogram `protobuf:"bytes,11,opt,name=histogram,proto3,oneof"` +} + +func (*Metric_Count) isMetric_Value() {} + +func (*Metric_Histogram) isMetric_Value() {} + +type Stats struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Metrics []*Metric `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"` +} + +func (x *Stats) Reset() { + *x = Stats{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_core_stats_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Stats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Stats) ProtoMessage() {} + +func (x *Stats) ProtoReflect() protoreflect.Message { + mi := &file_grpc_core_stats_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Stats.ProtoReflect.Descriptor instead. +func (*Stats) Descriptor() ([]byte, []int) { + return file_grpc_core_stats_proto_rawDescGZIP(), []int{3} +} + +func (x *Stats) GetMetrics() []*Metric { + if x != nil { + return x.Metrics + } + return nil +} + +var File_grpc_core_stats_proto protoreflect.FileDescriptor + +var file_grpc_core_stats_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x74, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x22, 0x34, 0x0a, 0x06, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x38, 0x0a, 0x09, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x2b, 0x0a, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x73, 0x22, 0x73, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x48, + 0x00, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x09, 0x68, 0x69, 0x73, 0x74, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, + 0x6d, 0x48, 0x00, 0x52, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x42, 0x07, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x34, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, + 0x12, 0x2b, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_grpc_core_stats_proto_rawDescOnce sync.Once + file_grpc_core_stats_proto_rawDescData = file_grpc_core_stats_proto_rawDesc +) + +func file_grpc_core_stats_proto_rawDescGZIP() []byte { + file_grpc_core_stats_proto_rawDescOnce.Do(func() { + file_grpc_core_stats_proto_rawDescData = protoimpl.X.CompressGZIP(file_grpc_core_stats_proto_rawDescData) + }) + return file_grpc_core_stats_proto_rawDescData +} + +var file_grpc_core_stats_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_grpc_core_stats_proto_goTypes = []interface{}{ + (*Bucket)(nil), // 0: grpc.core.Bucket + (*Histogram)(nil), // 1: grpc.core.Histogram + (*Metric)(nil), // 2: grpc.core.Metric + (*Stats)(nil), // 3: grpc.core.Stats +} +var file_grpc_core_stats_proto_depIdxs = []int32{ + 0, // 0: grpc.core.Histogram.buckets:type_name -> grpc.core.Bucket + 1, // 1: grpc.core.Metric.histogram:type_name -> grpc.core.Histogram + 2, // 2: grpc.core.Stats.metrics:type_name -> grpc.core.Metric + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_grpc_core_stats_proto_init() } +func file_grpc_core_stats_proto_init() { + if File_grpc_core_stats_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_grpc_core_stats_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Bucket); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_core_stats_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Histogram); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_core_stats_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metric); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_core_stats_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Stats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_grpc_core_stats_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*Metric_Count)(nil), + (*Metric_Histogram)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_grpc_core_stats_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_grpc_core_stats_proto_goTypes, + DependencyIndexes: file_grpc_core_stats_proto_depIdxs, + MessageInfos: file_grpc_core_stats_proto_msgTypes, + }.Build() + File_grpc_core_stats_proto = out.File + file_grpc_core_stats_proto_rawDesc = nil + file_grpc_core_stats_proto_goTypes = nil + file_grpc_core_stats_proto_depIdxs = nil +} diff --git a/interop/grpc_testing/empty.pb.go b/interop/grpc_testing/empty.pb.go new file mode 100644 index 000000000000..5378d2c58d0f --- /dev/null +++ b/interop/grpc_testing/empty.pb.go @@ -0,0 +1,158 @@ +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: grpc/testing/empty.proto + +package grpc_testing + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// An empty message that you can re-use to avoid defining duplicated empty +// messages in your project. A typical example is to use it as argument or the +// return value of a service API. For instance: +// +// service Foo { +// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { }; +// }; +// +type Empty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_empty_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_empty_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_grpc_testing_empty_proto_rawDescGZIP(), []int{0} +} + +var File_grpc_testing_empty_proto protoreflect.FileDescriptor + +var file_grpc_testing_empty_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_grpc_testing_empty_proto_rawDescOnce sync.Once + file_grpc_testing_empty_proto_rawDescData = file_grpc_testing_empty_proto_rawDesc +) + +func file_grpc_testing_empty_proto_rawDescGZIP() []byte { + file_grpc_testing_empty_proto_rawDescOnce.Do(func() { + file_grpc_testing_empty_proto_rawDescData = protoimpl.X.CompressGZIP(file_grpc_testing_empty_proto_rawDescData) + }) + return file_grpc_testing_empty_proto_rawDescData +} + +var file_grpc_testing_empty_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_grpc_testing_empty_proto_goTypes = []interface{}{ + (*Empty)(nil), // 0: grpc.testing.Empty +} +var file_grpc_testing_empty_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_grpc_testing_empty_proto_init() } +func file_grpc_testing_empty_proto_init() { + if File_grpc_testing_empty_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_grpc_testing_empty_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_grpc_testing_empty_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_grpc_testing_empty_proto_goTypes, + DependencyIndexes: file_grpc_testing_empty_proto_depIdxs, + MessageInfos: file_grpc_testing_empty_proto_msgTypes, + }.Build() + File_grpc_testing_empty_proto = out.File + file_grpc_testing_empty_proto_rawDesc = nil + file_grpc_testing_empty_proto_goTypes = nil + file_grpc_testing_empty_proto_depIdxs = nil +} diff --git a/interop/grpc_testing/messages.pb.go b/interop/grpc_testing/messages.pb.go new file mode 100644 index 000000000000..fb141c57df04 --- /dev/null +++ b/interop/grpc_testing/messages.pb.go @@ -0,0 +1,2035 @@ +// Copyright 2015-2016 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Message definitions to be used by integration test service definitions. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: grpc/testing/messages.proto + +package grpc_testing + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// The type of payload that should be returned. +type PayloadType int32 + +const ( + // Compressable text format. + PayloadType_COMPRESSABLE PayloadType = 0 +) + +// Enum value maps for PayloadType. +var ( + PayloadType_name = map[int32]string{ + 0: "COMPRESSABLE", + } + PayloadType_value = map[string]int32{ + "COMPRESSABLE": 0, + } +) + +func (x PayloadType) Enum() *PayloadType { + p := new(PayloadType) + *p = x + return p +} + +func (x PayloadType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PayloadType) Descriptor() protoreflect.EnumDescriptor { + return file_grpc_testing_messages_proto_enumTypes[0].Descriptor() +} + +func (PayloadType) Type() protoreflect.EnumType { + return &file_grpc_testing_messages_proto_enumTypes[0] +} + +func (x PayloadType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PayloadType.Descriptor instead. +func (PayloadType) EnumDescriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{0} +} + +// The type of route that a client took to reach a server w.r.t. gRPCLB. +// The server must fill in "fallback" if it detects that the RPC reached +// the server via the "gRPCLB fallback" path, and "backend" if it detects +// that the RPC reached the server via "gRPCLB backend" path (i.e. if it got +// the address of this server from the gRPCLB server BalanceLoad RPC). Exactly +// how this detection is done is context and server dependent. +type GrpclbRouteType int32 + +const ( + // Server didn't detect the route that a client took to reach it. + GrpclbRouteType_GRPCLB_ROUTE_TYPE_UNKNOWN GrpclbRouteType = 0 + // Indicates that a client reached a server via gRPCLB fallback. + GrpclbRouteType_GRPCLB_ROUTE_TYPE_FALLBACK GrpclbRouteType = 1 + // Indicates that a client reached a server as a gRPCLB-given backend. + GrpclbRouteType_GRPCLB_ROUTE_TYPE_BACKEND GrpclbRouteType = 2 +) + +// Enum value maps for GrpclbRouteType. +var ( + GrpclbRouteType_name = map[int32]string{ + 0: "GRPCLB_ROUTE_TYPE_UNKNOWN", + 1: "GRPCLB_ROUTE_TYPE_FALLBACK", + 2: "GRPCLB_ROUTE_TYPE_BACKEND", + } + GrpclbRouteType_value = map[string]int32{ + "GRPCLB_ROUTE_TYPE_UNKNOWN": 0, + "GRPCLB_ROUTE_TYPE_FALLBACK": 1, + "GRPCLB_ROUTE_TYPE_BACKEND": 2, + } +) + +func (x GrpclbRouteType) Enum() *GrpclbRouteType { + p := new(GrpclbRouteType) + *p = x + return p +} + +func (x GrpclbRouteType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GrpclbRouteType) Descriptor() protoreflect.EnumDescriptor { + return file_grpc_testing_messages_proto_enumTypes[1].Descriptor() +} + +func (GrpclbRouteType) Type() protoreflect.EnumType { + return &file_grpc_testing_messages_proto_enumTypes[1] +} + +func (x GrpclbRouteType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GrpclbRouteType.Descriptor instead. +func (GrpclbRouteType) EnumDescriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{1} +} + +// Type of RPCs to send. +type ClientConfigureRequest_RpcType int32 + +const ( + ClientConfigureRequest_EMPTY_CALL ClientConfigureRequest_RpcType = 0 + ClientConfigureRequest_UNARY_CALL ClientConfigureRequest_RpcType = 1 +) + +// Enum value maps for ClientConfigureRequest_RpcType. +var ( + ClientConfigureRequest_RpcType_name = map[int32]string{ + 0: "EMPTY_CALL", + 1: "UNARY_CALL", + } + ClientConfigureRequest_RpcType_value = map[string]int32{ + "EMPTY_CALL": 0, + "UNARY_CALL": 1, + } +) + +func (x ClientConfigureRequest_RpcType) Enum() *ClientConfigureRequest_RpcType { + p := new(ClientConfigureRequest_RpcType) + *p = x + return p +} + +func (x ClientConfigureRequest_RpcType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ClientConfigureRequest_RpcType) Descriptor() protoreflect.EnumDescriptor { + return file_grpc_testing_messages_proto_enumTypes[2].Descriptor() +} + +func (ClientConfigureRequest_RpcType) Type() protoreflect.EnumType { + return &file_grpc_testing_messages_proto_enumTypes[2] +} + +func (x ClientConfigureRequest_RpcType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ClientConfigureRequest_RpcType.Descriptor instead. +func (ClientConfigureRequest_RpcType) EnumDescriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{16, 0} +} + +// TODO(dgq): Go back to using well-known types once +// https://github.com/grpc/grpc/issues/6980 has been fixed. +// import "google/protobuf/wrappers.proto"; +type BoolValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The bool value. + Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *BoolValue) Reset() { + *x = BoolValue{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BoolValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BoolValue) ProtoMessage() {} + +func (x *BoolValue) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BoolValue.ProtoReflect.Descriptor instead. +func (*BoolValue) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{0} +} + +func (x *BoolValue) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +// A block of data, to simply increase gRPC message size. +type Payload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The type of data in body. + Type PayloadType `protobuf:"varint,1,opt,name=type,proto3,enum=grpc.testing.PayloadType" json:"type,omitempty"` + // Primary contents of payload. + Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` +} + +func (x *Payload) Reset() { + *x = Payload{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Payload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Payload) ProtoMessage() {} + +func (x *Payload) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Payload.ProtoReflect.Descriptor instead. +func (*Payload) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{1} +} + +func (x *Payload) GetType() PayloadType { + if x != nil { + return x.Type + } + return PayloadType_COMPRESSABLE +} + +func (x *Payload) GetBody() []byte { + if x != nil { + return x.Body + } + return nil +} + +// A protobuf representation for grpc status. This is used by test +// clients to specify a status that the server should attempt to return. +type EchoStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *EchoStatus) Reset() { + *x = EchoStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EchoStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EchoStatus) ProtoMessage() {} + +func (x *EchoStatus) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EchoStatus.ProtoReflect.Descriptor instead. +func (*EchoStatus) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{2} +} + +func (x *EchoStatus) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *EchoStatus) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// Unary request. +type SimpleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Desired payload type in the response from the server. + // If response_type is RANDOM, server randomly chooses one from other formats. + ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,proto3,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` + // Desired payload size in the response from the server. + ResponseSize int32 `protobuf:"varint,2,opt,name=response_size,json=responseSize,proto3" json:"response_size,omitempty"` + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + // Whether SimpleResponse should include username. + FillUsername bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername,proto3" json:"fill_username,omitempty"` + // Whether SimpleResponse should include OAuth scope. + FillOauthScope bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope,proto3" json:"fill_oauth_scope,omitempty"` + // Whether to request the server to compress the response. This field is + // "nullable" in order to interoperate seamlessly with clients not able to + // implement the full compression tests by introspecting the call to verify + // the response's compression status. + ResponseCompressed *BoolValue `protobuf:"bytes,6,opt,name=response_compressed,json=responseCompressed,proto3" json:"response_compressed,omitempty"` + // Whether server should return a given status + ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + // Whether the server should expect this request to be compressed. + ExpectCompressed *BoolValue `protobuf:"bytes,8,opt,name=expect_compressed,json=expectCompressed,proto3" json:"expect_compressed,omitempty"` + // Whether SimpleResponse should include server_id. + FillServerId bool `protobuf:"varint,9,opt,name=fill_server_id,json=fillServerId,proto3" json:"fill_server_id,omitempty"` + // Whether SimpleResponse should include grpclb_route_type. + FillGrpclbRouteType bool `protobuf:"varint,10,opt,name=fill_grpclb_route_type,json=fillGrpclbRouteType,proto3" json:"fill_grpclb_route_type,omitempty"` +} + +func (x *SimpleRequest) Reset() { + *x = SimpleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SimpleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SimpleRequest) ProtoMessage() {} + +func (x *SimpleRequest) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SimpleRequest.ProtoReflect.Descriptor instead. +func (*SimpleRequest) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{3} +} + +func (x *SimpleRequest) GetResponseType() PayloadType { + if x != nil { + return x.ResponseType + } + return PayloadType_COMPRESSABLE +} + +func (x *SimpleRequest) GetResponseSize() int32 { + if x != nil { + return x.ResponseSize + } + return 0 +} + +func (x *SimpleRequest) GetPayload() *Payload { + if x != nil { + return x.Payload + } + return nil +} + +func (x *SimpleRequest) GetFillUsername() bool { + if x != nil { + return x.FillUsername + } + return false +} + +func (x *SimpleRequest) GetFillOauthScope() bool { + if x != nil { + return x.FillOauthScope + } + return false +} + +func (x *SimpleRequest) GetResponseCompressed() *BoolValue { + if x != nil { + return x.ResponseCompressed + } + return nil +} + +func (x *SimpleRequest) GetResponseStatus() *EchoStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +func (x *SimpleRequest) GetExpectCompressed() *BoolValue { + if x != nil { + return x.ExpectCompressed + } + return nil +} + +func (x *SimpleRequest) GetFillServerId() bool { + if x != nil { + return x.FillServerId + } + return false +} + +func (x *SimpleRequest) GetFillGrpclbRouteType() bool { + if x != nil { + return x.FillGrpclbRouteType + } + return false +} + +// Unary response, as configured by the request. +type SimpleResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Payload to increase message size. + Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // The user the request came from, for verifying authentication was + // successful when the client expected it. + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + // OAuth scope. + OauthScope string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope,proto3" json:"oauth_scope,omitempty"` + // Server ID. This must be unique among different server instances, + // but the same across all RPC's made to a particular server instance. + ServerId string `protobuf:"bytes,4,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` + // gRPCLB Path. + GrpclbRouteType GrpclbRouteType `protobuf:"varint,5,opt,name=grpclb_route_type,json=grpclbRouteType,proto3,enum=grpc.testing.GrpclbRouteType" json:"grpclb_route_type,omitempty"` + // Server hostname. + Hostname string `protobuf:"bytes,6,opt,name=hostname,proto3" json:"hostname,omitempty"` +} + +func (x *SimpleResponse) Reset() { + *x = SimpleResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SimpleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SimpleResponse) ProtoMessage() {} + +func (x *SimpleResponse) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SimpleResponse.ProtoReflect.Descriptor instead. +func (*SimpleResponse) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{4} +} + +func (x *SimpleResponse) GetPayload() *Payload { + if x != nil { + return x.Payload + } + return nil +} + +func (x *SimpleResponse) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *SimpleResponse) GetOauthScope() string { + if x != nil { + return x.OauthScope + } + return "" +} + +func (x *SimpleResponse) GetServerId() string { + if x != nil { + return x.ServerId + } + return "" +} + +func (x *SimpleResponse) GetGrpclbRouteType() GrpclbRouteType { + if x != nil { + return x.GrpclbRouteType + } + return GrpclbRouteType_GRPCLB_ROUTE_TYPE_UNKNOWN +} + +func (x *SimpleResponse) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" +} + +// Client-streaming request. +type StreamingInputCallRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // Whether the server should expect this request to be compressed. This field + // is "nullable" in order to interoperate seamlessly with servers not able to + // implement the full compression tests by introspecting the call to verify + // the request's compression status. + ExpectCompressed *BoolValue `protobuf:"bytes,2,opt,name=expect_compressed,json=expectCompressed,proto3" json:"expect_compressed,omitempty"` +} + +func (x *StreamingInputCallRequest) Reset() { + *x = StreamingInputCallRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamingInputCallRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamingInputCallRequest) ProtoMessage() {} + +func (x *StreamingInputCallRequest) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamingInputCallRequest.ProtoReflect.Descriptor instead. +func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{5} +} + +func (x *StreamingInputCallRequest) GetPayload() *Payload { + if x != nil { + return x.Payload + } + return nil +} + +func (x *StreamingInputCallRequest) GetExpectCompressed() *BoolValue { + if x != nil { + return x.ExpectCompressed + } + return nil +} + +// Client-streaming response. +type StreamingInputCallResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Aggregated size of payloads received from the client. + AggregatedPayloadSize int32 `protobuf:"varint,1,opt,name=aggregated_payload_size,json=aggregatedPayloadSize,proto3" json:"aggregated_payload_size,omitempty"` +} + +func (x *StreamingInputCallResponse) Reset() { + *x = StreamingInputCallResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamingInputCallResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamingInputCallResponse) ProtoMessage() {} + +func (x *StreamingInputCallResponse) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamingInputCallResponse.ProtoReflect.Descriptor instead. +func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{6} +} + +func (x *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 { + if x != nil { + return x.AggregatedPayloadSize + } + return 0 +} + +// Configuration for a particular response. +type ResponseParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Desired payload sizes in responses from the server. + Size int32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` + // Desired interval between consecutive responses in the response stream in + // microseconds. + IntervalUs int32 `protobuf:"varint,2,opt,name=interval_us,json=intervalUs,proto3" json:"interval_us,omitempty"` + // Whether to request the server to compress the response. This field is + // "nullable" in order to interoperate seamlessly with clients not able to + // implement the full compression tests by introspecting the call to verify + // the response's compression status. + Compressed *BoolValue `protobuf:"bytes,3,opt,name=compressed,proto3" json:"compressed,omitempty"` +} + +func (x *ResponseParameters) Reset() { + *x = ResponseParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResponseParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResponseParameters) ProtoMessage() {} + +func (x *ResponseParameters) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResponseParameters.ProtoReflect.Descriptor instead. +func (*ResponseParameters) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{7} +} + +func (x *ResponseParameters) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *ResponseParameters) GetIntervalUs() int32 { + if x != nil { + return x.IntervalUs + } + return 0 +} + +func (x *ResponseParameters) GetCompressed() *BoolValue { + if x != nil { + return x.Compressed + } + return nil +} + +// Server-streaming request. +type StreamingOutputCallRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Desired payload type in the response from the server. + // If response_type is RANDOM, the payload from each response in the stream + // might be of different types. This is to simulate a mixed type of payload + // stream. + ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,proto3,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` + // Configuration for each expected response message. + ResponseParameters []*ResponseParameters `protobuf:"bytes,2,rep,name=response_parameters,json=responseParameters,proto3" json:"response_parameters,omitempty"` + // Optional input payload sent along with the request. + Payload *Payload `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + // Whether server should return a given status + ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` +} + +func (x *StreamingOutputCallRequest) Reset() { + *x = StreamingOutputCallRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamingOutputCallRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamingOutputCallRequest) ProtoMessage() {} + +func (x *StreamingOutputCallRequest) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamingOutputCallRequest.ProtoReflect.Descriptor instead. +func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{8} +} + +func (x *StreamingOutputCallRequest) GetResponseType() PayloadType { + if x != nil { + return x.ResponseType + } + return PayloadType_COMPRESSABLE +} + +func (x *StreamingOutputCallRequest) GetResponseParameters() []*ResponseParameters { + if x != nil { + return x.ResponseParameters + } + return nil +} + +func (x *StreamingOutputCallRequest) GetPayload() *Payload { + if x != nil { + return x.Payload + } + return nil +} + +func (x *StreamingOutputCallRequest) GetResponseStatus() *EchoStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +// Server-streaming response, as configured by the request and parameters. +type StreamingOutputCallResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Payload to increase response size. + Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *StreamingOutputCallResponse) Reset() { + *x = StreamingOutputCallResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamingOutputCallResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamingOutputCallResponse) ProtoMessage() {} + +func (x *StreamingOutputCallResponse) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamingOutputCallResponse.ProtoReflect.Descriptor instead. +func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{9} +} + +func (x *StreamingOutputCallResponse) GetPayload() *Payload { + if x != nil { + return x.Payload + } + return nil +} + +// For reconnect interop test only. +// Client tells server what reconnection parameters it used. +type ReconnectParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MaxReconnectBackoffMs int32 `protobuf:"varint,1,opt,name=max_reconnect_backoff_ms,json=maxReconnectBackoffMs,proto3" json:"max_reconnect_backoff_ms,omitempty"` +} + +func (x *ReconnectParams) Reset() { + *x = ReconnectParams{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReconnectParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReconnectParams) ProtoMessage() {} + +func (x *ReconnectParams) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReconnectParams.ProtoReflect.Descriptor instead. +func (*ReconnectParams) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{10} +} + +func (x *ReconnectParams) GetMaxReconnectBackoffMs() int32 { + if x != nil { + return x.MaxReconnectBackoffMs + } + return 0 +} + +// For reconnect interop test only. +// Server tells client whether its reconnects are following the spec and the +// reconnect backoffs it saw. +type ReconnectInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Passed bool `protobuf:"varint,1,opt,name=passed,proto3" json:"passed,omitempty"` + BackoffMs []int32 `protobuf:"varint,2,rep,packed,name=backoff_ms,json=backoffMs,proto3" json:"backoff_ms,omitempty"` +} + +func (x *ReconnectInfo) Reset() { + *x = ReconnectInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReconnectInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReconnectInfo) ProtoMessage() {} + +func (x *ReconnectInfo) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReconnectInfo.ProtoReflect.Descriptor instead. +func (*ReconnectInfo) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{11} +} + +func (x *ReconnectInfo) GetPassed() bool { + if x != nil { + return x.Passed + } + return false +} + +func (x *ReconnectInfo) GetBackoffMs() []int32 { + if x != nil { + return x.BackoffMs + } + return nil +} + +type LoadBalancerStatsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Request stats for the next num_rpcs sent by client. + NumRpcs int32 `protobuf:"varint,1,opt,name=num_rpcs,json=numRpcs,proto3" json:"num_rpcs,omitempty"` + // If num_rpcs have not completed within timeout_sec, return partial results. + TimeoutSec int32 `protobuf:"varint,2,opt,name=timeout_sec,json=timeoutSec,proto3" json:"timeout_sec,omitempty"` +} + +func (x *LoadBalancerStatsRequest) Reset() { + *x = LoadBalancerStatsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoadBalancerStatsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadBalancerStatsRequest) ProtoMessage() {} + +func (x *LoadBalancerStatsRequest) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadBalancerStatsRequest.ProtoReflect.Descriptor instead. +func (*LoadBalancerStatsRequest) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{12} +} + +func (x *LoadBalancerStatsRequest) GetNumRpcs() int32 { + if x != nil { + return x.NumRpcs + } + return 0 +} + +func (x *LoadBalancerStatsRequest) GetTimeoutSec() int32 { + if x != nil { + return x.TimeoutSec + } + return 0 +} + +type LoadBalancerStatsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The number of completed RPCs for each peer. + RpcsByPeer map[string]int32 `protobuf:"bytes,1,rep,name=rpcs_by_peer,json=rpcsByPeer,proto3" json:"rpcs_by_peer,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + // The number of RPCs that failed to record a remote peer. + NumFailures int32 `protobuf:"varint,2,opt,name=num_failures,json=numFailures,proto3" json:"num_failures,omitempty"` + RpcsByMethod map[string]*LoadBalancerStatsResponse_RpcsByPeer `protobuf:"bytes,3,rep,name=rpcs_by_method,json=rpcsByMethod,proto3" json:"rpcs_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *LoadBalancerStatsResponse) Reset() { + *x = LoadBalancerStatsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoadBalancerStatsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadBalancerStatsResponse) ProtoMessage() {} + +func (x *LoadBalancerStatsResponse) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadBalancerStatsResponse.ProtoReflect.Descriptor instead. +func (*LoadBalancerStatsResponse) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{13} +} + +func (x *LoadBalancerStatsResponse) GetRpcsByPeer() map[string]int32 { + if x != nil { + return x.RpcsByPeer + } + return nil +} + +func (x *LoadBalancerStatsResponse) GetNumFailures() int32 { + if x != nil { + return x.NumFailures + } + return 0 +} + +func (x *LoadBalancerStatsResponse) GetRpcsByMethod() map[string]*LoadBalancerStatsResponse_RpcsByPeer { + if x != nil { + return x.RpcsByMethod + } + return nil +} + +// Request for retrieving a test client's accumulated stats. +type LoadBalancerAccumulatedStatsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LoadBalancerAccumulatedStatsRequest) Reset() { + *x = LoadBalancerAccumulatedStatsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoadBalancerAccumulatedStatsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadBalancerAccumulatedStatsRequest) ProtoMessage() {} + +func (x *LoadBalancerAccumulatedStatsRequest) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadBalancerAccumulatedStatsRequest.ProtoReflect.Descriptor instead. +func (*LoadBalancerAccumulatedStatsRequest) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{14} +} + +// Accumulated stats for RPCs sent by a test client. +type LoadBalancerAccumulatedStatsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The total number of RPCs have ever issued for each type. + NumRpcsStartedByMethod map[string]int32 `protobuf:"bytes,1,rep,name=num_rpcs_started_by_method,json=numRpcsStartedByMethod,proto3" json:"num_rpcs_started_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + // The total number of RPCs have ever completed successfully for each type. + NumRpcsSucceededByMethod map[string]int32 `protobuf:"bytes,2,rep,name=num_rpcs_succeeded_by_method,json=numRpcsSucceededByMethod,proto3" json:"num_rpcs_succeeded_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + // The total number of RPCs have ever failed for each type. + NumRpcsFailedByMethod map[string]int32 `protobuf:"bytes,3,rep,name=num_rpcs_failed_by_method,json=numRpcsFailedByMethod,proto3" json:"num_rpcs_failed_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *LoadBalancerAccumulatedStatsResponse) Reset() { + *x = LoadBalancerAccumulatedStatsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoadBalancerAccumulatedStatsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadBalancerAccumulatedStatsResponse) ProtoMessage() {} + +func (x *LoadBalancerAccumulatedStatsResponse) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadBalancerAccumulatedStatsResponse.ProtoReflect.Descriptor instead. +func (*LoadBalancerAccumulatedStatsResponse) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{15} +} + +func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsStartedByMethod() map[string]int32 { + if x != nil { + return x.NumRpcsStartedByMethod + } + return nil +} + +func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsSucceededByMethod() map[string]int32 { + if x != nil { + return x.NumRpcsSucceededByMethod + } + return nil +} + +func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsFailedByMethod() map[string]int32 { + if x != nil { + return x.NumRpcsFailedByMethod + } + return nil +} + +// Configurations for a test client. +type ClientConfigureRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The types of RPCs the client sends. + Types []ClientConfigureRequest_RpcType `protobuf:"varint,1,rep,packed,name=types,proto3,enum=grpc.testing.ClientConfigureRequest_RpcType" json:"types,omitempty"` + // The collection of custom metadata to be attached to RPCs sent by the client. + Metadata []*ClientConfigureRequest_Metadata `protobuf:"bytes,2,rep,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *ClientConfigureRequest) Reset() { + *x = ClientConfigureRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientConfigureRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientConfigureRequest) ProtoMessage() {} + +func (x *ClientConfigureRequest) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientConfigureRequest.ProtoReflect.Descriptor instead. +func (*ClientConfigureRequest) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{16} +} + +func (x *ClientConfigureRequest) GetTypes() []ClientConfigureRequest_RpcType { + if x != nil { + return x.Types + } + return nil +} + +func (x *ClientConfigureRequest) GetMetadata() []*ClientConfigureRequest_Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +// Response for updating a test client's configuration. +type ClientConfigureResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ClientConfigureResponse) Reset() { + *x = ClientConfigureResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientConfigureResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientConfigureResponse) ProtoMessage() {} + +func (x *ClientConfigureResponse) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientConfigureResponse.ProtoReflect.Descriptor instead. +func (*ClientConfigureResponse) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{17} +} + +type LoadBalancerStatsResponse_RpcsByPeer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The number of completed RPCs for each peer. + RpcsByPeer map[string]int32 `protobuf:"bytes,1,rep,name=rpcs_by_peer,json=rpcsByPeer,proto3" json:"rpcs_by_peer,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *LoadBalancerStatsResponse_RpcsByPeer) Reset() { + *x = LoadBalancerStatsResponse_RpcsByPeer{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoadBalancerStatsResponse_RpcsByPeer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadBalancerStatsResponse_RpcsByPeer) ProtoMessage() {} + +func (x *LoadBalancerStatsResponse_RpcsByPeer) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadBalancerStatsResponse_RpcsByPeer.ProtoReflect.Descriptor instead. +func (*LoadBalancerStatsResponse_RpcsByPeer) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *LoadBalancerStatsResponse_RpcsByPeer) GetRpcsByPeer() map[string]int32 { + if x != nil { + return x.RpcsByPeer + } + return nil +} + +// Metadata to be attached for the given type of RPCs. +type ClientConfigureRequest_Metadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type ClientConfigureRequest_RpcType `protobuf:"varint,1,opt,name=type,proto3,enum=grpc.testing.ClientConfigureRequest_RpcType" json:"type,omitempty"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *ClientConfigureRequest_Metadata) Reset() { + *x = ClientConfigureRequest_Metadata{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientConfigureRequest_Metadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientConfigureRequest_Metadata) ProtoMessage() {} + +func (x *ClientConfigureRequest_Metadata) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientConfigureRequest_Metadata.ProtoReflect.Descriptor instead. +func (*ClientConfigureRequest_Metadata) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{16, 0} +} + +func (x *ClientConfigureRequest_Metadata) GetType() ClientConfigureRequest_RpcType { + if x != nil { + return x.Type + } + return ClientConfigureRequest_EMPTY_CALL +} + +func (x *ClientConfigureRequest_Metadata) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ClientConfigureRequest_Metadata) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_grpc_testing_messages_proto protoreflect.FileDescriptor + +var file_grpc_testing_messages_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x21, 0x0a, 0x09, 0x42, + 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4c, + 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x3a, 0x0a, 0x0a, + 0x45, 0x63, 0x68, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa2, 0x04, 0x0a, 0x0d, 0x53, 0x69, 0x6d, + 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x2f, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x69, 0x6c, 0x6c, 0x55, 0x73, 0x65, + 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x66, 0x69, 0x6c, 0x6c, 0x5f, 0x6f, 0x61, + 0x75, 0x74, 0x68, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0e, 0x66, 0x69, 0x6c, 0x6c, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, + 0x48, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, + 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x12, 0x41, 0x0a, 0x0f, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x44, 0x0a, 0x11, + 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x10, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x66, 0x69, 0x6c, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x69, 0x6c, 0x6c, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x16, 0x66, 0x69, 0x6c, 0x6c, + 0x5f, 0x67, 0x72, 0x70, 0x63, 0x6c, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x66, 0x69, 0x6c, 0x6c, 0x47, 0x72, + 0x70, 0x63, 0x6c, 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x82, 0x02, + 0x0a, 0x0e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x11, 0x67, + 0x72, 0x70, 0x63, 0x6c, 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x6c, 0x62, 0x52, 0x6f, 0x75, 0x74, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0f, 0x67, 0x72, 0x70, 0x63, 0x6c, 0x62, 0x52, 0x6f, 0x75, + 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x19, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, + 0x49, 0x6e, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x12, 0x44, 0x0a, 0x11, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6d, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0x54, 0x0a, 0x1a, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x82, 0x01, + 0x0a, 0x12, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x76, 0x61, 0x6c, 0x5f, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x55, 0x73, 0x12, 0x37, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x6f, 0x6f, + 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x64, 0x22, 0xa3, 0x02, 0x0a, 0x1a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, + 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x51, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x73, 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x41, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x63, + 0x68, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4e, 0x0a, 0x1b, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x4a, 0x0a, 0x0f, 0x52, 0x65, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x6d, + 0x61, 0x78, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x62, 0x61, 0x63, + 0x6b, 0x6f, 0x66, 0x66, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x6d, + 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x6f, + 0x66, 0x66, 0x4d, 0x73, 0x22, 0x46, 0x0a, 0x0d, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x73, 0x73, 0x65, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x61, 0x73, 0x73, 0x65, 0x64, 0x12, 0x1d, 0x0a, + 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x05, 0x52, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x4d, 0x73, 0x22, 0x56, 0x0a, 0x18, + 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x75, 0x6d, 0x5f, + 0x72, 0x70, 0x63, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x52, + 0x70, 0x63, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, + 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x53, 0x65, 0x63, 0x22, 0xe2, 0x04, 0x0a, 0x19, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0c, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x65, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0a, 0x72, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, 0x65, 0x72, 0x12, 0x21, 0x0a, + 0x0c, 0x6e, 0x75, 0x6d, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, + 0x12, 0x5f, 0x0a, 0x0e, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x70, 0x63, 0x73, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x1a, 0xb1, 0x01, 0x0a, 0x0a, 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, 0x65, 0x72, + 0x12, 0x64, 0x0a, 0x0c, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x65, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, 0x65, 0x72, 0x2e, 0x52, 0x70, 0x63, 0x73, 0x42, + 0x79, 0x50, 0x65, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x72, 0x70, 0x63, 0x73, + 0x42, 0x79, 0x50, 0x65, 0x65, 0x72, 0x1a, 0x3d, 0x0a, 0x0f, 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, + 0x50, 0x65, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3d, 0x0a, 0x0f, 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, + 0x65, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x73, 0x0a, 0x11, 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x48, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, 0x65, 0x72, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x25, 0x0a, 0x23, 0x4c, 0x6f, 0x61, + 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, + 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0xb2, 0x05, 0x0a, 0x24, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x1a, 0x6e, 0x75, + 0x6d, 0x5f, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x62, + 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4e, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, + 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, + 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, + 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x16, + 0x6e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x42, 0x79, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x90, 0x01, 0x0a, 0x1c, 0x6e, 0x75, 0x6d, 0x5f, 0x72, + 0x70, 0x63, 0x73, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x79, + 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x50, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, + 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, + 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, + 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x18, 0x6e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, + 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x87, 0x01, 0x0a, 0x19, 0x6e, 0x75, + 0x6d, 0x5f, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x62, 0x79, + 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4d, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, + 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, + 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, + 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x15, 0x6e, 0x75, + 0x6d, 0x52, 0x70, 0x63, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x1a, 0x49, 0x0a, 0x1b, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4b, + 0x0a, 0x1d, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, + 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x48, 0x0a, 0x1a, 0x4e, + 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc8, 0x02, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x42, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, + 0x2c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x12, 0x49, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, + 0x74, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x29, 0x0a, 0x07, 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x5f, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x00, + 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x01, + 0x22, 0x19, 0x0a, 0x17, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x1f, 0x0a, 0x0b, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x43, 0x4f, + 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x00, 0x2a, 0x6f, 0x0a, 0x0f, + 0x47, 0x72, 0x70, 0x63, 0x6c, 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1d, 0x0a, 0x19, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x1e, + 0x0a, 0x1a, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x46, 0x41, 0x4c, 0x4c, 0x42, 0x41, 0x43, 0x4b, 0x10, 0x01, 0x12, 0x1d, + 0x0a, 0x19, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x10, 0x02, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_grpc_testing_messages_proto_rawDescOnce sync.Once + file_grpc_testing_messages_proto_rawDescData = file_grpc_testing_messages_proto_rawDesc +) + +func file_grpc_testing_messages_proto_rawDescGZIP() []byte { + file_grpc_testing_messages_proto_rawDescOnce.Do(func() { + file_grpc_testing_messages_proto_rawDescData = protoimpl.X.CompressGZIP(file_grpc_testing_messages_proto_rawDescData) + }) + return file_grpc_testing_messages_proto_rawDescData +} + +var file_grpc_testing_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_grpc_testing_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_grpc_testing_messages_proto_goTypes = []interface{}{ + (PayloadType)(0), // 0: grpc.testing.PayloadType + (GrpclbRouteType)(0), // 1: grpc.testing.GrpclbRouteType + (ClientConfigureRequest_RpcType)(0), // 2: grpc.testing.ClientConfigureRequest.RpcType + (*BoolValue)(nil), // 3: grpc.testing.BoolValue + (*Payload)(nil), // 4: grpc.testing.Payload + (*EchoStatus)(nil), // 5: grpc.testing.EchoStatus + (*SimpleRequest)(nil), // 6: grpc.testing.SimpleRequest + (*SimpleResponse)(nil), // 7: grpc.testing.SimpleResponse + (*StreamingInputCallRequest)(nil), // 8: grpc.testing.StreamingInputCallRequest + (*StreamingInputCallResponse)(nil), // 9: grpc.testing.StreamingInputCallResponse + (*ResponseParameters)(nil), // 10: grpc.testing.ResponseParameters + (*StreamingOutputCallRequest)(nil), // 11: grpc.testing.StreamingOutputCallRequest + (*StreamingOutputCallResponse)(nil), // 12: grpc.testing.StreamingOutputCallResponse + (*ReconnectParams)(nil), // 13: grpc.testing.ReconnectParams + (*ReconnectInfo)(nil), // 14: grpc.testing.ReconnectInfo + (*LoadBalancerStatsRequest)(nil), // 15: grpc.testing.LoadBalancerStatsRequest + (*LoadBalancerStatsResponse)(nil), // 16: grpc.testing.LoadBalancerStatsResponse + (*LoadBalancerAccumulatedStatsRequest)(nil), // 17: grpc.testing.LoadBalancerAccumulatedStatsRequest + (*LoadBalancerAccumulatedStatsResponse)(nil), // 18: grpc.testing.LoadBalancerAccumulatedStatsResponse + (*ClientConfigureRequest)(nil), // 19: grpc.testing.ClientConfigureRequest + (*ClientConfigureResponse)(nil), // 20: grpc.testing.ClientConfigureResponse + (*LoadBalancerStatsResponse_RpcsByPeer)(nil), // 21: grpc.testing.LoadBalancerStatsResponse.RpcsByPeer + nil, // 22: grpc.testing.LoadBalancerStatsResponse.RpcsByPeerEntry + nil, // 23: grpc.testing.LoadBalancerStatsResponse.RpcsByMethodEntry + nil, // 24: grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.RpcsByPeerEntry + nil, // 25: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsStartedByMethodEntry + nil, // 26: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsSucceededByMethodEntry + nil, // 27: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsFailedByMethodEntry + (*ClientConfigureRequest_Metadata)(nil), // 28: grpc.testing.ClientConfigureRequest.Metadata +} +var file_grpc_testing_messages_proto_depIdxs = []int32{ + 0, // 0: grpc.testing.Payload.type:type_name -> grpc.testing.PayloadType + 0, // 1: grpc.testing.SimpleRequest.response_type:type_name -> grpc.testing.PayloadType + 4, // 2: grpc.testing.SimpleRequest.payload:type_name -> grpc.testing.Payload + 3, // 3: grpc.testing.SimpleRequest.response_compressed:type_name -> grpc.testing.BoolValue + 5, // 4: grpc.testing.SimpleRequest.response_status:type_name -> grpc.testing.EchoStatus + 3, // 5: grpc.testing.SimpleRequest.expect_compressed:type_name -> grpc.testing.BoolValue + 4, // 6: grpc.testing.SimpleResponse.payload:type_name -> grpc.testing.Payload + 1, // 7: grpc.testing.SimpleResponse.grpclb_route_type:type_name -> grpc.testing.GrpclbRouteType + 4, // 8: grpc.testing.StreamingInputCallRequest.payload:type_name -> grpc.testing.Payload + 3, // 9: grpc.testing.StreamingInputCallRequest.expect_compressed:type_name -> grpc.testing.BoolValue + 3, // 10: grpc.testing.ResponseParameters.compressed:type_name -> grpc.testing.BoolValue + 0, // 11: grpc.testing.StreamingOutputCallRequest.response_type:type_name -> grpc.testing.PayloadType + 10, // 12: grpc.testing.StreamingOutputCallRequest.response_parameters:type_name -> grpc.testing.ResponseParameters + 4, // 13: grpc.testing.StreamingOutputCallRequest.payload:type_name -> grpc.testing.Payload + 5, // 14: grpc.testing.StreamingOutputCallRequest.response_status:type_name -> grpc.testing.EchoStatus + 4, // 15: grpc.testing.StreamingOutputCallResponse.payload:type_name -> grpc.testing.Payload + 22, // 16: grpc.testing.LoadBalancerStatsResponse.rpcs_by_peer:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByPeerEntry + 23, // 17: grpc.testing.LoadBalancerStatsResponse.rpcs_by_method:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByMethodEntry + 25, // 18: grpc.testing.LoadBalancerAccumulatedStatsResponse.num_rpcs_started_by_method:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsStartedByMethodEntry + 26, // 19: grpc.testing.LoadBalancerAccumulatedStatsResponse.num_rpcs_succeeded_by_method:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsSucceededByMethodEntry + 27, // 20: grpc.testing.LoadBalancerAccumulatedStatsResponse.num_rpcs_failed_by_method:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsFailedByMethodEntry + 2, // 21: grpc.testing.ClientConfigureRequest.types:type_name -> grpc.testing.ClientConfigureRequest.RpcType + 28, // 22: grpc.testing.ClientConfigureRequest.metadata:type_name -> grpc.testing.ClientConfigureRequest.Metadata + 24, // 23: grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.rpcs_by_peer:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.RpcsByPeerEntry + 21, // 24: grpc.testing.LoadBalancerStatsResponse.RpcsByMethodEntry.value:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByPeer + 2, // 25: grpc.testing.ClientConfigureRequest.Metadata.type:type_name -> grpc.testing.ClientConfigureRequest.RpcType + 26, // [26:26] is the sub-list for method output_type + 26, // [26:26] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name +} + +func init() { file_grpc_testing_messages_proto_init() } +func file_grpc_testing_messages_proto_init() { + if File_grpc_testing_messages_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_grpc_testing_messages_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BoolValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Payload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EchoStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SimpleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SimpleResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamingInputCallRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamingInputCallResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResponseParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamingOutputCallRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamingOutputCallResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReconnectParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReconnectInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoadBalancerStatsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoadBalancerStatsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoadBalancerAccumulatedStatsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoadBalancerAccumulatedStatsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientConfigureRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientConfigureResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoadBalancerStatsResponse_RpcsByPeer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientConfigureRequest_Metadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_grpc_testing_messages_proto_rawDesc, + NumEnums: 3, + NumMessages: 26, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_grpc_testing_messages_proto_goTypes, + DependencyIndexes: file_grpc_testing_messages_proto_depIdxs, + EnumInfos: file_grpc_testing_messages_proto_enumTypes, + MessageInfos: file_grpc_testing_messages_proto_msgTypes, + }.Build() + File_grpc_testing_messages_proto = out.File + file_grpc_testing_messages_proto_rawDesc = nil + file_grpc_testing_messages_proto_goTypes = nil + file_grpc_testing_messages_proto_depIdxs = nil +} diff --git a/benchmark/grpc_testing/payloads.pb.go b/interop/grpc_testing/payloads.pb.go similarity index 59% rename from benchmark/grpc_testing/payloads.pb.go rename to interop/grpc_testing/payloads.pb.go index f8a3edbd854f..b85a289c1532 100644 --- a/benchmark/grpc_testing/payloads.pb.go +++ b/interop/grpc_testing/payloads.pb.go @@ -1,4 +1,4 @@ -// Copyright 2016 gRPC authors. +// Copyright 2015 gRPC authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ // versions: // protoc-gen-go v1.25.0 // protoc v3.14.0 -// source: benchmark/grpc_testing/payloads.proto +// source: grpc/testing/payloads.proto package grpc_testing @@ -51,7 +51,7 @@ type ByteBufferParams struct { func (x *ByteBufferParams) Reset() { *x = ByteBufferParams{} if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_payloads_proto_msgTypes[0] + mi := &file_grpc_testing_payloads_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -64,7 +64,7 @@ func (x *ByteBufferParams) String() string { func (*ByteBufferParams) ProtoMessage() {} func (x *ByteBufferParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_payloads_proto_msgTypes[0] + mi := &file_grpc_testing_payloads_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -77,7 +77,7 @@ func (x *ByteBufferParams) ProtoReflect() protoreflect.Message { // Deprecated: Use ByteBufferParams.ProtoReflect.Descriptor instead. func (*ByteBufferParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_payloads_proto_rawDescGZIP(), []int{0} + return file_grpc_testing_payloads_proto_rawDescGZIP(), []int{0} } func (x *ByteBufferParams) GetReqSize() int32 { @@ -106,7 +106,7 @@ type SimpleProtoParams struct { func (x *SimpleProtoParams) Reset() { *x = SimpleProtoParams{} if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_payloads_proto_msgTypes[1] + mi := &file_grpc_testing_payloads_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -119,7 +119,7 @@ func (x *SimpleProtoParams) String() string { func (*SimpleProtoParams) ProtoMessage() {} func (x *SimpleProtoParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_payloads_proto_msgTypes[1] + mi := &file_grpc_testing_payloads_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -132,7 +132,7 @@ func (x *SimpleProtoParams) ProtoReflect() protoreflect.Message { // Deprecated: Use SimpleProtoParams.ProtoReflect.Descriptor instead. func (*SimpleProtoParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_payloads_proto_rawDescGZIP(), []int{1} + return file_grpc_testing_payloads_proto_rawDescGZIP(), []int{1} } func (x *SimpleProtoParams) GetReqSize() int32 { @@ -158,7 +158,7 @@ type ComplexProtoParams struct { func (x *ComplexProtoParams) Reset() { *x = ComplexProtoParams{} if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_payloads_proto_msgTypes[2] + mi := &file_grpc_testing_payloads_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -171,7 +171,7 @@ func (x *ComplexProtoParams) String() string { func (*ComplexProtoParams) ProtoMessage() {} func (x *ComplexProtoParams) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_payloads_proto_msgTypes[2] + mi := &file_grpc_testing_payloads_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -184,7 +184,7 @@ func (x *ComplexProtoParams) ProtoReflect() protoreflect.Message { // Deprecated: Use ComplexProtoParams.ProtoReflect.Descriptor instead. func (*ComplexProtoParams) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_payloads_proto_rawDescGZIP(), []int{2} + return file_grpc_testing_payloads_proto_rawDescGZIP(), []int{2} } type PayloadConfig struct { @@ -202,7 +202,7 @@ type PayloadConfig struct { func (x *PayloadConfig) Reset() { *x = PayloadConfig{} if protoimpl.UnsafeEnabled { - mi := &file_benchmark_grpc_testing_payloads_proto_msgTypes[3] + mi := &file_grpc_testing_payloads_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -215,7 +215,7 @@ func (x *PayloadConfig) String() string { func (*PayloadConfig) ProtoMessage() {} func (x *PayloadConfig) ProtoReflect() protoreflect.Message { - mi := &file_benchmark_grpc_testing_payloads_proto_msgTypes[3] + mi := &file_grpc_testing_payloads_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -228,7 +228,7 @@ func (x *PayloadConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use PayloadConfig.ProtoReflect.Descriptor instead. func (*PayloadConfig) Descriptor() ([]byte, []int) { - return file_benchmark_grpc_testing_payloads_proto_rawDescGZIP(), []int{3} + return file_grpc_testing_payloads_proto_rawDescGZIP(), []int{3} } func (m *PayloadConfig) GetPayload() isPayloadConfig_Payload { @@ -281,65 +281,61 @@ func (*PayloadConfig_SimpleParams) isPayloadConfig_Payload() {} func (*PayloadConfig_ComplexParams) isPayloadConfig_Payload() {} -var File_benchmark_grpc_testing_payloads_proto protoreflect.FileDescriptor - -var file_benchmark_grpc_testing_payloads_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x4a, 0x0a, 0x10, 0x42, 0x79, 0x74, 0x65, 0x42, 0x75, 0x66, - 0x66, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x71, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x71, - 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x53, 0x69, 0x7a, - 0x65, 0x22, 0x4b, 0x0a, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x71, 0x53, 0x69, 0x7a, - 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x14, - 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x22, 0xf6, 0x01, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x47, 0x0a, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x75, - 0x66, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x79, - 0x74, 0x65, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, - 0x52, 0x0d, 0x62, 0x79, 0x74, 0x65, 0x62, 0x75, 0x66, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x46, 0x0a, 0x0d, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x49, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, - 0x65, 0x78, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x2f, 0x5a, - 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, - 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, - 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_grpc_testing_payloads_proto protoreflect.FileDescriptor + +var file_grpc_testing_payloads_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x4a, 0x0a, 0x10, 0x42, + 0x79, 0x74, 0x65, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x19, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x72, 0x65, 0x71, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, + 0x73, 0x70, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, + 0x65, 0x73, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x4b, 0x0a, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x19, 0x0a, 0x08, + 0x72, 0x65, 0x71, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x72, 0x65, 0x71, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x53, 0x69, 0x7a, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xf6, 0x01, 0x0a, 0x0d, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x47, 0x0a, 0x0e, + 0x62, 0x79, 0x74, 0x65, 0x62, 0x75, 0x66, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x0d, 0x62, 0x79, 0x74, 0x65, 0x62, 0x75, 0x66, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x46, 0x0a, 0x0d, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, + 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, + 0x0c, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x49, 0x0a, + 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x78, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_benchmark_grpc_testing_payloads_proto_rawDescOnce sync.Once - file_benchmark_grpc_testing_payloads_proto_rawDescData = file_benchmark_grpc_testing_payloads_proto_rawDesc + file_grpc_testing_payloads_proto_rawDescOnce sync.Once + file_grpc_testing_payloads_proto_rawDescData = file_grpc_testing_payloads_proto_rawDesc ) -func file_benchmark_grpc_testing_payloads_proto_rawDescGZIP() []byte { - file_benchmark_grpc_testing_payloads_proto_rawDescOnce.Do(func() { - file_benchmark_grpc_testing_payloads_proto_rawDescData = protoimpl.X.CompressGZIP(file_benchmark_grpc_testing_payloads_proto_rawDescData) +func file_grpc_testing_payloads_proto_rawDescGZIP() []byte { + file_grpc_testing_payloads_proto_rawDescOnce.Do(func() { + file_grpc_testing_payloads_proto_rawDescData = protoimpl.X.CompressGZIP(file_grpc_testing_payloads_proto_rawDescData) }) - return file_benchmark_grpc_testing_payloads_proto_rawDescData + return file_grpc_testing_payloads_proto_rawDescData } -var file_benchmark_grpc_testing_payloads_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_benchmark_grpc_testing_payloads_proto_goTypes = []interface{}{ +var file_grpc_testing_payloads_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_grpc_testing_payloads_proto_goTypes = []interface{}{ (*ByteBufferParams)(nil), // 0: grpc.testing.ByteBufferParams (*SimpleProtoParams)(nil), // 1: grpc.testing.SimpleProtoParams (*ComplexProtoParams)(nil), // 2: grpc.testing.ComplexProtoParams (*PayloadConfig)(nil), // 3: grpc.testing.PayloadConfig } -var file_benchmark_grpc_testing_payloads_proto_depIdxs = []int32{ +var file_grpc_testing_payloads_proto_depIdxs = []int32{ 0, // 0: grpc.testing.PayloadConfig.bytebuf_params:type_name -> grpc.testing.ByteBufferParams 1, // 1: grpc.testing.PayloadConfig.simple_params:type_name -> grpc.testing.SimpleProtoParams 2, // 2: grpc.testing.PayloadConfig.complex_params:type_name -> grpc.testing.ComplexProtoParams @@ -350,13 +346,13 @@ var file_benchmark_grpc_testing_payloads_proto_depIdxs = []int32{ 0, // [0:3] is the sub-list for field type_name } -func init() { file_benchmark_grpc_testing_payloads_proto_init() } -func file_benchmark_grpc_testing_payloads_proto_init() { - if File_benchmark_grpc_testing_payloads_proto != nil { +func init() { file_grpc_testing_payloads_proto_init() } +func file_grpc_testing_payloads_proto_init() { + if File_grpc_testing_payloads_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_benchmark_grpc_testing_payloads_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_grpc_testing_payloads_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ByteBufferParams); i { case 0: return &v.state @@ -368,7 +364,7 @@ func file_benchmark_grpc_testing_payloads_proto_init() { return nil } } - file_benchmark_grpc_testing_payloads_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_grpc_testing_payloads_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SimpleProtoParams); i { case 0: return &v.state @@ -380,7 +376,7 @@ func file_benchmark_grpc_testing_payloads_proto_init() { return nil } } - file_benchmark_grpc_testing_payloads_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_grpc_testing_payloads_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ComplexProtoParams); i { case 0: return &v.state @@ -392,7 +388,7 @@ func file_benchmark_grpc_testing_payloads_proto_init() { return nil } } - file_benchmark_grpc_testing_payloads_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_grpc_testing_payloads_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PayloadConfig); i { case 0: return &v.state @@ -405,7 +401,7 @@ func file_benchmark_grpc_testing_payloads_proto_init() { } } } - file_benchmark_grpc_testing_payloads_proto_msgTypes[3].OneofWrappers = []interface{}{ + file_grpc_testing_payloads_proto_msgTypes[3].OneofWrappers = []interface{}{ (*PayloadConfig_BytebufParams)(nil), (*PayloadConfig_SimpleParams)(nil), (*PayloadConfig_ComplexParams)(nil), @@ -414,18 +410,18 @@ func file_benchmark_grpc_testing_payloads_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_benchmark_grpc_testing_payloads_proto_rawDesc, + RawDescriptor: file_grpc_testing_payloads_proto_rawDesc, NumEnums: 0, NumMessages: 4, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_benchmark_grpc_testing_payloads_proto_goTypes, - DependencyIndexes: file_benchmark_grpc_testing_payloads_proto_depIdxs, - MessageInfos: file_benchmark_grpc_testing_payloads_proto_msgTypes, + GoTypes: file_grpc_testing_payloads_proto_goTypes, + DependencyIndexes: file_grpc_testing_payloads_proto_depIdxs, + MessageInfos: file_grpc_testing_payloads_proto_msgTypes, }.Build() - File_benchmark_grpc_testing_payloads_proto = out.File - file_benchmark_grpc_testing_payloads_proto_rawDesc = nil - file_benchmark_grpc_testing_payloads_proto_goTypes = nil - file_benchmark_grpc_testing_payloads_proto_depIdxs = nil + File_grpc_testing_payloads_proto = out.File + file_grpc_testing_payloads_proto_rawDesc = nil + file_grpc_testing_payloads_proto_goTypes = nil + file_grpc_testing_payloads_proto_depIdxs = nil } diff --git a/interop/grpc_testing/report_qps_scenario_service.pb.go b/interop/grpc_testing/report_qps_scenario_service.pb.go new file mode 100644 index 000000000000..0f4de5984942 --- /dev/null +++ b/interop/grpc_testing/report_qps_scenario_service.pb.go @@ -0,0 +1,99 @@ +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: grpc/testing/report_qps_scenario_service.proto + +package grpc_testing + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +var File_grpc_testing_report_qps_scenario_service_proto protoreflect.FileDescriptor + +var file_grpc_testing_report_qps_scenario_service_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x71, 0x70, 0x73, 0x5f, 0x73, 0x63, 0x65, 0x6e, 0x61, 0x72, + 0x69, 0x6f, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x1a, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x5e, 0x0a, 0x18, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x51, 0x70, 0x73, 0x53, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x42, 0x0a, 0x0e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x53, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x6f, 0x69, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var file_grpc_testing_report_qps_scenario_service_proto_goTypes = []interface{}{ + (*ScenarioResult)(nil), // 0: grpc.testing.ScenarioResult + (*Void)(nil), // 1: grpc.testing.Void +} +var file_grpc_testing_report_qps_scenario_service_proto_depIdxs = []int32{ + 0, // 0: grpc.testing.ReportQpsScenarioService.ReportScenario:input_type -> grpc.testing.ScenarioResult + 1, // 1: grpc.testing.ReportQpsScenarioService.ReportScenario:output_type -> grpc.testing.Void + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_grpc_testing_report_qps_scenario_service_proto_init() } +func file_grpc_testing_report_qps_scenario_service_proto_init() { + if File_grpc_testing_report_qps_scenario_service_proto != nil { + return + } + file_grpc_testing_control_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_grpc_testing_report_qps_scenario_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_grpc_testing_report_qps_scenario_service_proto_goTypes, + DependencyIndexes: file_grpc_testing_report_qps_scenario_service_proto_depIdxs, + }.Build() + File_grpc_testing_report_qps_scenario_service_proto = out.File + file_grpc_testing_report_qps_scenario_service_proto_rawDesc = nil + file_grpc_testing_report_qps_scenario_service_proto_goTypes = nil + file_grpc_testing_report_qps_scenario_service_proto_depIdxs = nil +} diff --git a/interop/grpc_testing/report_qps_scenario_service_grpc.pb.go b/interop/grpc_testing/report_qps_scenario_service_grpc.pb.go new file mode 100644 index 000000000000..fb6c22a00d09 --- /dev/null +++ b/interop/grpc_testing/report_qps_scenario_service_grpc.pb.go @@ -0,0 +1,103 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package grpc_testing + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion7 + +// ReportQpsScenarioServiceClient is the client API for ReportQpsScenarioService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ReportQpsScenarioServiceClient interface { + // Report results of a QPS test benchmark scenario. + ReportScenario(ctx context.Context, in *ScenarioResult, opts ...grpc.CallOption) (*Void, error) +} + +type reportQpsScenarioServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewReportQpsScenarioServiceClient(cc grpc.ClientConnInterface) ReportQpsScenarioServiceClient { + return &reportQpsScenarioServiceClient{cc} +} + +func (c *reportQpsScenarioServiceClient) ReportScenario(ctx context.Context, in *ScenarioResult, opts ...grpc.CallOption) (*Void, error) { + out := new(Void) + err := c.cc.Invoke(ctx, "/grpc.testing.ReportQpsScenarioService/ReportScenario", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ReportQpsScenarioServiceServer is the server API for ReportQpsScenarioService service. +// All implementations must embed UnimplementedReportQpsScenarioServiceServer +// for forward compatibility +type ReportQpsScenarioServiceServer interface { + // Report results of a QPS test benchmark scenario. + ReportScenario(context.Context, *ScenarioResult) (*Void, error) + mustEmbedUnimplementedReportQpsScenarioServiceServer() +} + +// UnimplementedReportQpsScenarioServiceServer must be embedded to have forward compatible implementations. +type UnimplementedReportQpsScenarioServiceServer struct { +} + +func (UnimplementedReportQpsScenarioServiceServer) ReportScenario(context.Context, *ScenarioResult) (*Void, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReportScenario not implemented") +} +func (UnimplementedReportQpsScenarioServiceServer) mustEmbedUnimplementedReportQpsScenarioServiceServer() { +} + +// UnsafeReportQpsScenarioServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ReportQpsScenarioServiceServer will +// result in compilation errors. +type UnsafeReportQpsScenarioServiceServer interface { + mustEmbedUnimplementedReportQpsScenarioServiceServer() +} + +func RegisterReportQpsScenarioServiceServer(s grpc.ServiceRegistrar, srv ReportQpsScenarioServiceServer) { + s.RegisterService(&ReportQpsScenarioService_ServiceDesc, srv) +} + +func _ReportQpsScenarioService_ReportScenario_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ScenarioResult) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReportQpsScenarioServiceServer).ReportScenario(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.ReportQpsScenarioService/ReportScenario", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReportQpsScenarioServiceServer).ReportScenario(ctx, req.(*ScenarioResult)) + } + return interceptor(ctx, in, info, handler) +} + +// ReportQpsScenarioService_ServiceDesc is the grpc.ServiceDesc for ReportQpsScenarioService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ReportQpsScenarioService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.ReportQpsScenarioService", + HandlerType: (*ReportQpsScenarioServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ReportScenario", + Handler: _ReportQpsScenarioService_ReportScenario_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "grpc/testing/report_qps_scenario_service.proto", +} diff --git a/interop/grpc_testing/stats.pb.go b/interop/grpc_testing/stats.pb.go new file mode 100644 index 000000000000..3ff0ccd80b28 --- /dev/null +++ b/interop/grpc_testing/stats.pb.go @@ -0,0 +1,632 @@ +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: grpc/testing/stats.proto + +package grpc_testing + +import ( + proto "github.com/golang/protobuf/proto" + core "google.golang.org/grpc/interop/grpc_testing/core" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type ServerStats struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // wall clock time change in seconds since last reset + TimeElapsed float64 `protobuf:"fixed64,1,opt,name=time_elapsed,json=timeElapsed,proto3" json:"time_elapsed,omitempty"` + // change in user time (in seconds) used by the server since last reset + TimeUser float64 `protobuf:"fixed64,2,opt,name=time_user,json=timeUser,proto3" json:"time_user,omitempty"` + // change in server time (in seconds) used by the server process and all + // threads since last reset + TimeSystem float64 `protobuf:"fixed64,3,opt,name=time_system,json=timeSystem,proto3" json:"time_system,omitempty"` + // change in total cpu time of the server (data from proc/stat) + TotalCpuTime uint64 `protobuf:"varint,4,opt,name=total_cpu_time,json=totalCpuTime,proto3" json:"total_cpu_time,omitempty"` + // change in idle time of the server (data from proc/stat) + IdleCpuTime uint64 `protobuf:"varint,5,opt,name=idle_cpu_time,json=idleCpuTime,proto3" json:"idle_cpu_time,omitempty"` + // Number of polls called inside completion queue + CqPollCount uint64 `protobuf:"varint,6,opt,name=cq_poll_count,json=cqPollCount,proto3" json:"cq_poll_count,omitempty"` + // Core library stats + CoreStats *core.Stats `protobuf:"bytes,7,opt,name=core_stats,json=coreStats,proto3" json:"core_stats,omitempty"` +} + +func (x *ServerStats) Reset() { + *x = ServerStats{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_stats_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServerStats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServerStats) ProtoMessage() {} + +func (x *ServerStats) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_stats_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServerStats.ProtoReflect.Descriptor instead. +func (*ServerStats) Descriptor() ([]byte, []int) { + return file_grpc_testing_stats_proto_rawDescGZIP(), []int{0} +} + +func (x *ServerStats) GetTimeElapsed() float64 { + if x != nil { + return x.TimeElapsed + } + return 0 +} + +func (x *ServerStats) GetTimeUser() float64 { + if x != nil { + return x.TimeUser + } + return 0 +} + +func (x *ServerStats) GetTimeSystem() float64 { + if x != nil { + return x.TimeSystem + } + return 0 +} + +func (x *ServerStats) GetTotalCpuTime() uint64 { + if x != nil { + return x.TotalCpuTime + } + return 0 +} + +func (x *ServerStats) GetIdleCpuTime() uint64 { + if x != nil { + return x.IdleCpuTime + } + return 0 +} + +func (x *ServerStats) GetCqPollCount() uint64 { + if x != nil { + return x.CqPollCount + } + return 0 +} + +func (x *ServerStats) GetCoreStats() *core.Stats { + if x != nil { + return x.CoreStats + } + return nil +} + +// Histogram params based on grpc/support/histogram.c +type HistogramParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Resolution float64 `protobuf:"fixed64,1,opt,name=resolution,proto3" json:"resolution,omitempty"` // first bucket is [0, 1 + resolution) + MaxPossible float64 `protobuf:"fixed64,2,opt,name=max_possible,json=maxPossible,proto3" json:"max_possible,omitempty"` // use enough buckets to allow this value +} + +func (x *HistogramParams) Reset() { + *x = HistogramParams{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_stats_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HistogramParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistogramParams) ProtoMessage() {} + +func (x *HistogramParams) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_stats_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistogramParams.ProtoReflect.Descriptor instead. +func (*HistogramParams) Descriptor() ([]byte, []int) { + return file_grpc_testing_stats_proto_rawDescGZIP(), []int{1} +} + +func (x *HistogramParams) GetResolution() float64 { + if x != nil { + return x.Resolution + } + return 0 +} + +func (x *HistogramParams) GetMaxPossible() float64 { + if x != nil { + return x.MaxPossible + } + return 0 +} + +// Histogram data based on grpc/support/histogram.c +type HistogramData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bucket []uint32 `protobuf:"varint,1,rep,packed,name=bucket,proto3" json:"bucket,omitempty"` + MinSeen float64 `protobuf:"fixed64,2,opt,name=min_seen,json=minSeen,proto3" json:"min_seen,omitempty"` + MaxSeen float64 `protobuf:"fixed64,3,opt,name=max_seen,json=maxSeen,proto3" json:"max_seen,omitempty"` + Sum float64 `protobuf:"fixed64,4,opt,name=sum,proto3" json:"sum,omitempty"` + SumOfSquares float64 `protobuf:"fixed64,5,opt,name=sum_of_squares,json=sumOfSquares,proto3" json:"sum_of_squares,omitempty"` + Count float64 `protobuf:"fixed64,6,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *HistogramData) Reset() { + *x = HistogramData{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_stats_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HistogramData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistogramData) ProtoMessage() {} + +func (x *HistogramData) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_stats_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistogramData.ProtoReflect.Descriptor instead. +func (*HistogramData) Descriptor() ([]byte, []int) { + return file_grpc_testing_stats_proto_rawDescGZIP(), []int{2} +} + +func (x *HistogramData) GetBucket() []uint32 { + if x != nil { + return x.Bucket + } + return nil +} + +func (x *HistogramData) GetMinSeen() float64 { + if x != nil { + return x.MinSeen + } + return 0 +} + +func (x *HistogramData) GetMaxSeen() float64 { + if x != nil { + return x.MaxSeen + } + return 0 +} + +func (x *HistogramData) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +func (x *HistogramData) GetSumOfSquares() float64 { + if x != nil { + return x.SumOfSquares + } + return 0 +} + +func (x *HistogramData) GetCount() float64 { + if x != nil { + return x.Count + } + return 0 +} + +type RequestResultCount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *RequestResultCount) Reset() { + *x = RequestResultCount{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_stats_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestResultCount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestResultCount) ProtoMessage() {} + +func (x *RequestResultCount) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_stats_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequestResultCount.ProtoReflect.Descriptor instead. +func (*RequestResultCount) Descriptor() ([]byte, []int) { + return file_grpc_testing_stats_proto_rawDescGZIP(), []int{3} +} + +func (x *RequestResultCount) GetStatusCode() int32 { + if x != nil { + return x.StatusCode + } + return 0 +} + +func (x *RequestResultCount) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +type ClientStats struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Latency histogram. Data points are in nanoseconds. + Latencies *HistogramData `protobuf:"bytes,1,opt,name=latencies,proto3" json:"latencies,omitempty"` + // See ServerStats for details. + TimeElapsed float64 `protobuf:"fixed64,2,opt,name=time_elapsed,json=timeElapsed,proto3" json:"time_elapsed,omitempty"` + TimeUser float64 `protobuf:"fixed64,3,opt,name=time_user,json=timeUser,proto3" json:"time_user,omitempty"` + TimeSystem float64 `protobuf:"fixed64,4,opt,name=time_system,json=timeSystem,proto3" json:"time_system,omitempty"` + // Number of failed requests (one row per status code seen) + RequestResults []*RequestResultCount `protobuf:"bytes,5,rep,name=request_results,json=requestResults,proto3" json:"request_results,omitempty"` + // Number of polls called inside completion queue + CqPollCount uint64 `protobuf:"varint,6,opt,name=cq_poll_count,json=cqPollCount,proto3" json:"cq_poll_count,omitempty"` + // Core library stats + CoreStats *core.Stats `protobuf:"bytes,7,opt,name=core_stats,json=coreStats,proto3" json:"core_stats,omitempty"` +} + +func (x *ClientStats) Reset() { + *x = ClientStats{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_stats_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientStats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientStats) ProtoMessage() {} + +func (x *ClientStats) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_stats_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientStats.ProtoReflect.Descriptor instead. +func (*ClientStats) Descriptor() ([]byte, []int) { + return file_grpc_testing_stats_proto_rawDescGZIP(), []int{4} +} + +func (x *ClientStats) GetLatencies() *HistogramData { + if x != nil { + return x.Latencies + } + return nil +} + +func (x *ClientStats) GetTimeElapsed() float64 { + if x != nil { + return x.TimeElapsed + } + return 0 +} + +func (x *ClientStats) GetTimeUser() float64 { + if x != nil { + return x.TimeUser + } + return 0 +} + +func (x *ClientStats) GetTimeSystem() float64 { + if x != nil { + return x.TimeSystem + } + return 0 +} + +func (x *ClientStats) GetRequestResults() []*RequestResultCount { + if x != nil { + return x.RequestResults + } + return nil +} + +func (x *ClientStats) GetCqPollCount() uint64 { + if x != nil { + return x.CqPollCount + } + return 0 +} + +func (x *ClientStats) GetCoreStats() *core.Stats { + if x != nil { + return x.CoreStats + } + return nil +} + +var File_grpc_testing_stats_proto protoreflect.FileDescriptor + +var file_grpc_testing_stats_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x73, + 0x74, 0x61, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x15, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, + 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x8d, 0x02, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, + 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x65, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x45, 0x6c, 0x61, 0x70, 0x73, + 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x1f, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x70, 0x75, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, + 0x70, 0x75, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x63, + 0x70, 0x75, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x69, + 0x64, 0x6c, 0x65, 0x43, 0x70, 0x75, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x71, + 0x5f, 0x70, 0x6f, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0b, 0x63, 0x71, 0x50, 0x6f, 0x6c, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, + 0x0a, 0x0a, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x73, 0x52, 0x09, 0x63, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x22, + 0x54, 0x0a, 0x0f, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x50, 0x6f, 0x73, + 0x73, 0x69, 0x62, 0x6c, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x0d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, + 0x72, 0x61, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, + 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x65, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, + 0x78, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, + 0x78, 0x53, 0x65, 0x65, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x75, 0x6d, 0x5f, 0x6f, + 0x66, 0x5f, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x0c, 0x73, 0x75, 0x6d, 0x4f, 0x66, 0x53, 0x71, 0x75, 0x61, 0x72, 0x65, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x22, 0x4b, 0x0a, 0x12, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0xc9, 0x02, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, + 0x12, 0x39, 0x0a, 0x09, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x09, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x74, + 0x69, 0x6d, 0x65, 0x5f, 0x65, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x45, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x74, + 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x49, 0x0a, 0x0f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x71, 0x5f, 0x70, 0x6f, + 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x63, 0x71, 0x50, 0x6f, 0x6c, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x63, + 0x6f, 0x72, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x52, 0x09, 0x63, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_grpc_testing_stats_proto_rawDescOnce sync.Once + file_grpc_testing_stats_proto_rawDescData = file_grpc_testing_stats_proto_rawDesc +) + +func file_grpc_testing_stats_proto_rawDescGZIP() []byte { + file_grpc_testing_stats_proto_rawDescOnce.Do(func() { + file_grpc_testing_stats_proto_rawDescData = protoimpl.X.CompressGZIP(file_grpc_testing_stats_proto_rawDescData) + }) + return file_grpc_testing_stats_proto_rawDescData +} + +var file_grpc_testing_stats_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_grpc_testing_stats_proto_goTypes = []interface{}{ + (*ServerStats)(nil), // 0: grpc.testing.ServerStats + (*HistogramParams)(nil), // 1: grpc.testing.HistogramParams + (*HistogramData)(nil), // 2: grpc.testing.HistogramData + (*RequestResultCount)(nil), // 3: grpc.testing.RequestResultCount + (*ClientStats)(nil), // 4: grpc.testing.ClientStats + (*core.Stats)(nil), // 5: grpc.core.Stats +} +var file_grpc_testing_stats_proto_depIdxs = []int32{ + 5, // 0: grpc.testing.ServerStats.core_stats:type_name -> grpc.core.Stats + 2, // 1: grpc.testing.ClientStats.latencies:type_name -> grpc.testing.HistogramData + 3, // 2: grpc.testing.ClientStats.request_results:type_name -> grpc.testing.RequestResultCount + 5, // 3: grpc.testing.ClientStats.core_stats:type_name -> grpc.core.Stats + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_grpc_testing_stats_proto_init() } +func file_grpc_testing_stats_proto_init() { + if File_grpc_testing_stats_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_grpc_testing_stats_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServerStats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_stats_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HistogramParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_stats_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HistogramData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_stats_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestResultCount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_stats_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientStats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_grpc_testing_stats_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_grpc_testing_stats_proto_goTypes, + DependencyIndexes: file_grpc_testing_stats_proto_depIdxs, + MessageInfos: file_grpc_testing_stats_proto_msgTypes, + }.Build() + File_grpc_testing_stats_proto = out.File + file_grpc_testing_stats_proto_rawDesc = nil + file_grpc_testing_stats_proto_goTypes = nil + file_grpc_testing_stats_proto_depIdxs = nil +} diff --git a/interop/grpc_testing/test.pb.go b/interop/grpc_testing/test.pb.go index 8b4017a81fe9..50db0950b9c5 100644 --- a/interop/grpc_testing/test.pb.go +++ b/interop/grpc_testing/test.pb.go @@ -1,4 +1,4 @@ -// Copyright 2017 gRPC authors. +// Copyright 2015-2016 gRPC authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ // versions: // protoc-gen-go v1.25.0 // protoc v3.14.0 -// source: interop/grpc_testing/test.proto +// source: grpc/testing/test.proto package grpc_testing @@ -28,7 +28,6 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - sync "sync" ) const ( @@ -42,1874 +41,189 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 -// The type of payload that should be returned. -type PayloadType int32 - -const ( - // Compressable text format. - PayloadType_COMPRESSABLE PayloadType = 0 - // Uncompressable binary format. - PayloadType_UNCOMPRESSABLE PayloadType = 1 - // Randomly chosen from all other formats defined in this enum. - PayloadType_RANDOM PayloadType = 2 -) - -// Enum value maps for PayloadType. -var ( - PayloadType_name = map[int32]string{ - 0: "COMPRESSABLE", - 1: "UNCOMPRESSABLE", - 2: "RANDOM", - } - PayloadType_value = map[string]int32{ - "COMPRESSABLE": 0, - "UNCOMPRESSABLE": 1, - "RANDOM": 2, - } -) - -func (x PayloadType) Enum() *PayloadType { - p := new(PayloadType) - *p = x - return p -} - -func (x PayloadType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PayloadType) Descriptor() protoreflect.EnumDescriptor { - return file_interop_grpc_testing_test_proto_enumTypes[0].Descriptor() -} - -func (PayloadType) Type() protoreflect.EnumType { - return &file_interop_grpc_testing_test_proto_enumTypes[0] -} - -func (x PayloadType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PayloadType.Descriptor instead. -func (PayloadType) EnumDescriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{0} -} - -// The type of route that a client took to reach a server w.r.t. gRPCLB. -// The server must fill in "fallback" if it detects that the RPC reached -// the server via the "gRPCLB fallback" path, and "backend" if it detects -// that the RPC reached the server via "gRPCLB backend" path (i.e. if it got -// the address of this server from the gRPCLB server BalanceLoad RPC). Exactly -// how this detection is done is context and server dependant. -type GrpclbRouteType int32 - -const ( - // Server didn't detect the route that a client took to reach it. - GrpclbRouteType_GRPCLB_ROUTE_TYPE_UNKNOWN GrpclbRouteType = 0 - // Indicates that a client reached a server via gRPCLB fallback. - GrpclbRouteType_GRPCLB_ROUTE_TYPE_FALLBACK GrpclbRouteType = 1 - // Indicates that a client reached a server as a gRPCLB-given backend. - GrpclbRouteType_GRPCLB_ROUTE_TYPE_BACKEND GrpclbRouteType = 2 -) - -// Enum value maps for GrpclbRouteType. -var ( - GrpclbRouteType_name = map[int32]string{ - 0: "GRPCLB_ROUTE_TYPE_UNKNOWN", - 1: "GRPCLB_ROUTE_TYPE_FALLBACK", - 2: "GRPCLB_ROUTE_TYPE_BACKEND", - } - GrpclbRouteType_value = map[string]int32{ - "GRPCLB_ROUTE_TYPE_UNKNOWN": 0, - "GRPCLB_ROUTE_TYPE_FALLBACK": 1, - "GRPCLB_ROUTE_TYPE_BACKEND": 2, - } -) - -func (x GrpclbRouteType) Enum() *GrpclbRouteType { - p := new(GrpclbRouteType) - *p = x - return p -} - -func (x GrpclbRouteType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (GrpclbRouteType) Descriptor() protoreflect.EnumDescriptor { - return file_interop_grpc_testing_test_proto_enumTypes[1].Descriptor() -} - -func (GrpclbRouteType) Type() protoreflect.EnumType { - return &file_interop_grpc_testing_test_proto_enumTypes[1] -} - -func (x GrpclbRouteType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use GrpclbRouteType.Descriptor instead. -func (GrpclbRouteType) EnumDescriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{1} -} - -// Type of RPCs to send. -type ClientConfigureRequest_RpcType int32 - -const ( - ClientConfigureRequest_EMPTY_CALL ClientConfigureRequest_RpcType = 0 - ClientConfigureRequest_UNARY_CALL ClientConfigureRequest_RpcType = 1 -) - -// Enum value maps for ClientConfigureRequest_RpcType. -var ( - ClientConfigureRequest_RpcType_name = map[int32]string{ - 0: "EMPTY_CALL", - 1: "UNARY_CALL", - } - ClientConfigureRequest_RpcType_value = map[string]int32{ - "EMPTY_CALL": 0, - "UNARY_CALL": 1, - } -) - -func (x ClientConfigureRequest_RpcType) Enum() *ClientConfigureRequest_RpcType { - p := new(ClientConfigureRequest_RpcType) - *p = x - return p -} - -func (x ClientConfigureRequest_RpcType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ClientConfigureRequest_RpcType) Descriptor() protoreflect.EnumDescriptor { - return file_interop_grpc_testing_test_proto_enumTypes[2].Descriptor() -} - -func (ClientConfigureRequest_RpcType) Type() protoreflect.EnumType { - return &file_interop_grpc_testing_test_proto_enumTypes[2] -} - -func (x ClientConfigureRequest_RpcType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ClientConfigureRequest_RpcType.Descriptor instead. -func (ClientConfigureRequest_RpcType) EnumDescriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{14, 0} -} - -type Empty struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Empty) Reset() { - *x = Empty{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Empty) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Empty) ProtoMessage() {} - -func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Empty.ProtoReflect.Descriptor instead. -func (*Empty) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{0} -} - -// A block of data, to simply increase gRPC message size. -type Payload struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The type of data in body. - Type PayloadType `protobuf:"varint,1,opt,name=type,proto3,enum=grpc.testing.PayloadType" json:"type,omitempty"` - // Primary contents of payload. - Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` -} - -func (x *Payload) Reset() { - *x = Payload{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Payload) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Payload) ProtoMessage() {} - -func (x *Payload) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Payload.ProtoReflect.Descriptor instead. -func (*Payload) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{1} -} - -func (x *Payload) GetType() PayloadType { - if x != nil { - return x.Type - } - return PayloadType_COMPRESSABLE -} - -func (x *Payload) GetBody() []byte { - if x != nil { - return x.Body - } - return nil -} - -// A protobuf representation for grpc status. This is used by test -// clients to specify a status that the server should attempt to return. -type EchoStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *EchoStatus) Reset() { - *x = EchoStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EchoStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EchoStatus) ProtoMessage() {} - -func (x *EchoStatus) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EchoStatus.ProtoReflect.Descriptor instead. -func (*EchoStatus) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{2} -} - -func (x *EchoStatus) GetCode() int32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *EchoStatus) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -// Unary request. -type SimpleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,proto3,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` - // Desired payload size in the response from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - ResponseSize int32 `protobuf:"varint,2,opt,name=response_size,json=responseSize,proto3" json:"response_size,omitempty"` - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - // Whether SimpleResponse should include username. - FillUsername bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername,proto3" json:"fill_username,omitempty"` - // Whether SimpleResponse should include OAuth scope. - FillOauthScope bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope,proto3" json:"fill_oauth_scope,omitempty"` - // Whether server should return a given status - ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` - // Whether SimpleResponse should include server_id. - FillServerId bool `protobuf:"varint,9,opt,name=fill_server_id,json=fillServerId,proto3" json:"fill_server_id,omitempty"` - // Whether SimpleResponse should include grpclb_route_type. - FillGrpclbRouteType bool `protobuf:"varint,10,opt,name=fill_grpclb_route_type,json=fillGrpclbRouteType,proto3" json:"fill_grpclb_route_type,omitempty"` -} - -func (x *SimpleRequest) Reset() { - *x = SimpleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SimpleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SimpleRequest) ProtoMessage() {} - -func (x *SimpleRequest) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SimpleRequest.ProtoReflect.Descriptor instead. -func (*SimpleRequest) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{3} -} - -func (x *SimpleRequest) GetResponseType() PayloadType { - if x != nil { - return x.ResponseType - } - return PayloadType_COMPRESSABLE -} - -func (x *SimpleRequest) GetResponseSize() int32 { - if x != nil { - return x.ResponseSize - } - return 0 -} - -func (x *SimpleRequest) GetPayload() *Payload { - if x != nil { - return x.Payload - } - return nil -} - -func (x *SimpleRequest) GetFillUsername() bool { - if x != nil { - return x.FillUsername - } - return false -} - -func (x *SimpleRequest) GetFillOauthScope() bool { - if x != nil { - return x.FillOauthScope - } - return false -} - -func (x *SimpleRequest) GetResponseStatus() *EchoStatus { - if x != nil { - return x.ResponseStatus - } - return nil -} - -func (x *SimpleRequest) GetFillServerId() bool { - if x != nil { - return x.FillServerId - } - return false -} - -func (x *SimpleRequest) GetFillGrpclbRouteType() bool { - if x != nil { - return x.FillGrpclbRouteType - } - return false -} - -// Unary response, as configured by the request. -type SimpleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Payload to increase message size. - Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - // The user the request came from, for verifying authentication was - // successful when the client expected it. - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` - // OAuth scope. - OauthScope string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope,proto3" json:"oauth_scope,omitempty"` - // Server ID. This must be unique among different server instances, - // but the same across all RPC's made to a particular server instance. - ServerId string `protobuf:"bytes,4,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` - // gRPCLB Path. - GrpclbRouteType GrpclbRouteType `protobuf:"varint,5,opt,name=grpclb_route_type,json=grpclbRouteType,proto3,enum=grpc.testing.GrpclbRouteType" json:"grpclb_route_type,omitempty"` - // Server hostname. - Hostname string `protobuf:"bytes,6,opt,name=hostname,proto3" json:"hostname,omitempty"` -} - -func (x *SimpleResponse) Reset() { - *x = SimpleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SimpleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SimpleResponse) ProtoMessage() {} - -func (x *SimpleResponse) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SimpleResponse.ProtoReflect.Descriptor instead. -func (*SimpleResponse) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{4} -} - -func (x *SimpleResponse) GetPayload() *Payload { - if x != nil { - return x.Payload - } - return nil -} - -func (x *SimpleResponse) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *SimpleResponse) GetOauthScope() string { - if x != nil { - return x.OauthScope - } - return "" -} - -func (x *SimpleResponse) GetServerId() string { - if x != nil { - return x.ServerId - } - return "" -} - -func (x *SimpleResponse) GetGrpclbRouteType() GrpclbRouteType { - if x != nil { - return x.GrpclbRouteType - } - return GrpclbRouteType_GRPCLB_ROUTE_TYPE_UNKNOWN -} - -func (x *SimpleResponse) GetHostname() string { - if x != nil { - return x.Hostname - } - return "" -} - -// Client-streaming request. -type StreamingInputCallRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (x *StreamingInputCallRequest) Reset() { - *x = StreamingInputCallRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StreamingInputCallRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StreamingInputCallRequest) ProtoMessage() {} - -func (x *StreamingInputCallRequest) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StreamingInputCallRequest.ProtoReflect.Descriptor instead. -func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{5} -} - -func (x *StreamingInputCallRequest) GetPayload() *Payload { - if x != nil { - return x.Payload - } - return nil -} - -// Client-streaming response. -type StreamingInputCallResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Aggregated size of payloads received from the client. - AggregatedPayloadSize int32 `protobuf:"varint,1,opt,name=aggregated_payload_size,json=aggregatedPayloadSize,proto3" json:"aggregated_payload_size,omitempty"` -} - -func (x *StreamingInputCallResponse) Reset() { - *x = StreamingInputCallResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StreamingInputCallResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StreamingInputCallResponse) ProtoMessage() {} - -func (x *StreamingInputCallResponse) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StreamingInputCallResponse.ProtoReflect.Descriptor instead. -func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{6} -} - -func (x *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 { - if x != nil { - return x.AggregatedPayloadSize - } - return 0 -} - -// Configuration for a particular response. -type ResponseParameters struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Desired payload sizes in responses from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - Size int32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` - // Desired interval between consecutive responses in the response stream in - // microseconds. - IntervalUs int32 `protobuf:"varint,2,opt,name=interval_us,json=intervalUs,proto3" json:"interval_us,omitempty"` -} - -func (x *ResponseParameters) Reset() { - *x = ResponseParameters{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResponseParameters) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResponseParameters) ProtoMessage() {} - -func (x *ResponseParameters) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResponseParameters.ProtoReflect.Descriptor instead. -func (*ResponseParameters) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{7} -} - -func (x *ResponseParameters) GetSize() int32 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *ResponseParameters) GetIntervalUs() int32 { - if x != nil { - return x.IntervalUs - } - return 0 -} - -// Server-streaming request. -type StreamingOutputCallRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Desired payload type in the response from the server. - // If response_type is RANDOM, the payload from each response in the stream - // might be of different types. This is to simulate a mixed type of payload - // stream. - ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,proto3,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` - // Configuration for each expected response message. - ResponseParameters []*ResponseParameters `protobuf:"bytes,2,rep,name=response_parameters,json=responseParameters,proto3" json:"response_parameters,omitempty"` - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - // Whether server should return a given status - ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` -} - -func (x *StreamingOutputCallRequest) Reset() { - *x = StreamingOutputCallRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StreamingOutputCallRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StreamingOutputCallRequest) ProtoMessage() {} - -func (x *StreamingOutputCallRequest) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StreamingOutputCallRequest.ProtoReflect.Descriptor instead. -func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{8} -} - -func (x *StreamingOutputCallRequest) GetResponseType() PayloadType { - if x != nil { - return x.ResponseType - } - return PayloadType_COMPRESSABLE -} - -func (x *StreamingOutputCallRequest) GetResponseParameters() []*ResponseParameters { - if x != nil { - return x.ResponseParameters - } - return nil -} - -func (x *StreamingOutputCallRequest) GetPayload() *Payload { - if x != nil { - return x.Payload - } - return nil -} - -func (x *StreamingOutputCallRequest) GetResponseStatus() *EchoStatus { - if x != nil { - return x.ResponseStatus - } - return nil -} - -// Server-streaming response, as configured by the request and parameters. -type StreamingOutputCallResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Payload to increase response size. - Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (x *StreamingOutputCallResponse) Reset() { - *x = StreamingOutputCallResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StreamingOutputCallResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StreamingOutputCallResponse) ProtoMessage() {} - -func (x *StreamingOutputCallResponse) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StreamingOutputCallResponse.ProtoReflect.Descriptor instead. -func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{9} -} - -func (x *StreamingOutputCallResponse) GetPayload() *Payload { - if x != nil { - return x.Payload - } - return nil -} - -type LoadBalancerStatsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Request stats for the next num_rpcs sent by client. - NumRpcs int32 `protobuf:"varint,1,opt,name=num_rpcs,json=numRpcs,proto3" json:"num_rpcs,omitempty"` - // If num_rpcs have not completed within timeout_sec, return partial results. - TimeoutSec int32 `protobuf:"varint,2,opt,name=timeout_sec,json=timeoutSec,proto3" json:"timeout_sec,omitempty"` -} - -func (x *LoadBalancerStatsRequest) Reset() { - *x = LoadBalancerStatsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadBalancerStatsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoadBalancerStatsRequest) ProtoMessage() {} - -func (x *LoadBalancerStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoadBalancerStatsRequest.ProtoReflect.Descriptor instead. -func (*LoadBalancerStatsRequest) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{10} -} - -func (x *LoadBalancerStatsRequest) GetNumRpcs() int32 { - if x != nil { - return x.NumRpcs - } - return 0 -} - -func (x *LoadBalancerStatsRequest) GetTimeoutSec() int32 { - if x != nil { - return x.TimeoutSec - } - return 0 -} - -type LoadBalancerStatsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The number of completed RPCs for each peer. - RpcsByPeer map[string]int32 `protobuf:"bytes,1,rep,name=rpcs_by_peer,json=rpcsByPeer,proto3" json:"rpcs_by_peer,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // The number of RPCs that failed to record a remote peer. - NumFailures int32 `protobuf:"varint,2,opt,name=num_failures,json=numFailures,proto3" json:"num_failures,omitempty"` - // The number of completed RPCs for each method (UnaryCall or EmptyCall). - RpcsByMethod map[string]*LoadBalancerStatsResponse_RpcsByPeer `protobuf:"bytes,3,rep,name=rpcs_by_method,json=rpcsByMethod,proto3" json:"rpcs_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *LoadBalancerStatsResponse) Reset() { - *x = LoadBalancerStatsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadBalancerStatsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoadBalancerStatsResponse) ProtoMessage() {} - -func (x *LoadBalancerStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoadBalancerStatsResponse.ProtoReflect.Descriptor instead. -func (*LoadBalancerStatsResponse) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{11} -} - -func (x *LoadBalancerStatsResponse) GetRpcsByPeer() map[string]int32 { - if x != nil { - return x.RpcsByPeer - } - return nil -} - -func (x *LoadBalancerStatsResponse) GetNumFailures() int32 { - if x != nil { - return x.NumFailures - } - return 0 -} - -func (x *LoadBalancerStatsResponse) GetRpcsByMethod() map[string]*LoadBalancerStatsResponse_RpcsByPeer { - if x != nil { - return x.RpcsByMethod - } - return nil -} - -// Request for retrieving a test client's accumulated stats. -type LoadBalancerAccumulatedStatsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *LoadBalancerAccumulatedStatsRequest) Reset() { - *x = LoadBalancerAccumulatedStatsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadBalancerAccumulatedStatsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoadBalancerAccumulatedStatsRequest) ProtoMessage() {} - -func (x *LoadBalancerAccumulatedStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoadBalancerAccumulatedStatsRequest.ProtoReflect.Descriptor instead. -func (*LoadBalancerAccumulatedStatsRequest) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{12} -} - -// Accumulated stats for RPCs sent by a test client. -type LoadBalancerAccumulatedStatsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The total number of RPCs have ever issued for each type. - NumRpcsStartedByMethod map[string]int32 `protobuf:"bytes,1,rep,name=num_rpcs_started_by_method,json=numRpcsStartedByMethod,proto3" json:"num_rpcs_started_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // The total number of RPCs have ever completed successfully for each type. - NumRpcsSucceededByMethod map[string]int32 `protobuf:"bytes,2,rep,name=num_rpcs_succeeded_by_method,json=numRpcsSucceededByMethod,proto3" json:"num_rpcs_succeeded_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // The total number of RPCs have ever failed for each type. - NumRpcsFailedByMethod map[string]int32 `protobuf:"bytes,3,rep,name=num_rpcs_failed_by_method,json=numRpcsFailedByMethod,proto3" json:"num_rpcs_failed_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` -} - -func (x *LoadBalancerAccumulatedStatsResponse) Reset() { - *x = LoadBalancerAccumulatedStatsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadBalancerAccumulatedStatsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoadBalancerAccumulatedStatsResponse) ProtoMessage() {} - -func (x *LoadBalancerAccumulatedStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoadBalancerAccumulatedStatsResponse.ProtoReflect.Descriptor instead. -func (*LoadBalancerAccumulatedStatsResponse) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{13} -} - -func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsStartedByMethod() map[string]int32 { - if x != nil { - return x.NumRpcsStartedByMethod - } - return nil -} - -func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsSucceededByMethod() map[string]int32 { - if x != nil { - return x.NumRpcsSucceededByMethod - } - return nil -} - -func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsFailedByMethod() map[string]int32 { - if x != nil { - return x.NumRpcsFailedByMethod - } - return nil -} - -// Configurations for a test client. -type ClientConfigureRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The types of RPCs the client sends. - Types []ClientConfigureRequest_RpcType `protobuf:"varint,1,rep,packed,name=types,proto3,enum=grpc.testing.ClientConfigureRequest_RpcType" json:"types,omitempty"` - // The collection of custom metadata to be attached to RPCs sent by the client. - Metadata []*ClientConfigureRequest_Metadata `protobuf:"bytes,2,rep,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (x *ClientConfigureRequest) Reset() { - *x = ClientConfigureRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientConfigureRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientConfigureRequest) ProtoMessage() {} - -func (x *ClientConfigureRequest) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientConfigureRequest.ProtoReflect.Descriptor instead. -func (*ClientConfigureRequest) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{14} -} - -func (x *ClientConfigureRequest) GetTypes() []ClientConfigureRequest_RpcType { - if x != nil { - return x.Types - } - return nil -} - -func (x *ClientConfigureRequest) GetMetadata() []*ClientConfigureRequest_Metadata { - if x != nil { - return x.Metadata - } - return nil -} - -// Response for updating a test client's configuration. -type ClientConfigureResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ClientConfigureResponse) Reset() { - *x = ClientConfigureResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientConfigureResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientConfigureResponse) ProtoMessage() {} - -func (x *ClientConfigureResponse) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientConfigureResponse.ProtoReflect.Descriptor instead. -func (*ClientConfigureResponse) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{15} -} - -type LoadBalancerStatsResponse_RpcsByPeer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The number of completed RPCs for each peer. - RpcsByPeer map[string]int32 `protobuf:"bytes,1,rep,name=rpcs_by_peer,json=rpcsByPeer,proto3" json:"rpcs_by_peer,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` -} - -func (x *LoadBalancerStatsResponse_RpcsByPeer) Reset() { - *x = LoadBalancerStatsResponse_RpcsByPeer{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadBalancerStatsResponse_RpcsByPeer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoadBalancerStatsResponse_RpcsByPeer) ProtoMessage() {} - -func (x *LoadBalancerStatsResponse_RpcsByPeer) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoadBalancerStatsResponse_RpcsByPeer.ProtoReflect.Descriptor instead. -func (*LoadBalancerStatsResponse_RpcsByPeer) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{11, 0} -} - -func (x *LoadBalancerStatsResponse_RpcsByPeer) GetRpcsByPeer() map[string]int32 { - if x != nil { - return x.RpcsByPeer - } - return nil -} - -// Metadata to be attached for the given type of RPCs. -type ClientConfigureRequest_Metadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type ClientConfigureRequest_RpcType `protobuf:"varint,1,opt,name=type,proto3,enum=grpc.testing.ClientConfigureRequest_RpcType" json:"type,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *ClientConfigureRequest_Metadata) Reset() { - *x = ClientConfigureRequest_Metadata{} - if protoimpl.UnsafeEnabled { - mi := &file_interop_grpc_testing_test_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientConfigureRequest_Metadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientConfigureRequest_Metadata) ProtoMessage() {} - -func (x *ClientConfigureRequest_Metadata) ProtoReflect() protoreflect.Message { - mi := &file_interop_grpc_testing_test_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientConfigureRequest_Metadata.ProtoReflect.Descriptor instead. -func (*ClientConfigureRequest_Metadata) Descriptor() ([]byte, []int) { - return file_interop_grpc_testing_test_proto_rawDescGZIP(), []int{14, 0} -} - -func (x *ClientConfigureRequest_Metadata) GetType() ClientConfigureRequest_RpcType { - if x != nil { - return x.Type - } - return ClientConfigureRequest_EMPTY_CALL -} - -func (x *ClientConfigureRequest_Metadata) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *ClientConfigureRequest_Metadata) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -var File_interop_grpc_testing_test_proto protoreflect.FileDescriptor - -var file_interop_grpc_testing_test_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6f, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x22, - 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x4c, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, - 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x3a, 0x0a, 0x0a, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0x92, 0x03, 0x0a, 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x69, - 0x6c, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0c, 0x66, 0x69, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x28, 0x0a, 0x10, 0x66, 0x69, 0x6c, 0x6c, 0x5f, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x73, 0x63, - 0x6f, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x6c, 0x4f, - 0x61, 0x75, 0x74, 0x68, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x0f, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0e, - 0x66, 0x69, 0x6c, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x69, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x33, 0x0a, 0x16, 0x66, 0x69, 0x6c, 0x6c, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x6c, - 0x62, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x13, 0x66, 0x69, 0x6c, 0x6c, 0x47, 0x72, 0x70, 0x63, 0x6c, 0x62, 0x52, 0x6f, - 0x75, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x82, 0x02, 0x0a, 0x0e, 0x53, 0x69, 0x6d, 0x70, - 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x61, 0x75, 0x74, 0x68, - 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x61, - 0x75, 0x74, 0x68, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x11, 0x67, 0x72, 0x70, 0x63, 0x6c, 0x62, 0x5f, - 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, - 0x47, 0x72, 0x70, 0x63, 0x6c, 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x0f, 0x67, 0x72, 0x70, 0x63, 0x6c, 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4c, 0x0a, 0x19, +var File_grpc_testing_test_proto protoreflect.FileDescriptor + +var file_grpc_testing_test_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x74, + 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x18, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1b, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xcb, + 0x05, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x35, + 0x0a, 0x09, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x13, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x09, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x43, 0x61, + 0x6c, 0x6c, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, + 0x12, 0x43, 0x61, 0x63, 0x68, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x43, + 0x61, 0x6c, 0x6c, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, + 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, + 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x28, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x29, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, + 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x69, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x43, 0x61, - 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x54, 0x0a, 0x1a, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x67, 0x67, 0x72, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x61, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, 0x7a, 0x65, - 0x22, 0x49, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x5f, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x55, 0x73, 0x22, 0xa3, 0x02, 0x0a, 0x1a, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, - 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, - 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x51, 0x0a, 0x13, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x52, 0x12, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2f, 0x0a, - 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x41, - 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x4e, 0x0a, 0x1b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2f, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, - 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x22, 0x56, 0x0a, 0x18, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, - 0x08, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x70, 0x63, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x07, 0x6e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x22, 0xe2, 0x04, 0x0a, 0x19, 0x4c, 0x6f, - 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0c, 0x72, 0x70, 0x63, 0x73, 0x5f, - 0x62, 0x79, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, - 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, 0x65, - 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x72, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, - 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x75, 0x6d, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x46, 0x61, 0x69, - 0x6c, 0x75, 0x72, 0x65, 0x73, 0x12, 0x5f, 0x0a, 0x0e, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x62, 0x79, - 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, - 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x70, 0x63, 0x73, 0x42, 0x79, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x1a, 0xb1, 0x01, 0x0a, 0x0a, 0x52, 0x70, 0x63, 0x73, 0x42, - 0x79, 0x50, 0x65, 0x65, 0x72, 0x12, 0x64, 0x0a, 0x0c, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x62, 0x79, - 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, 0x65, 0x72, 0x2e, - 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0a, 0x72, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, 0x65, 0x72, 0x1a, 0x3d, 0x0a, 0x0f, 0x52, - 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3d, 0x0a, 0x0f, 0x52, 0x70, - 0x63, 0x73, 0x42, 0x79, 0x50, 0x65, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x73, 0x0a, 0x11, 0x52, 0x70, 0x63, - 0x73, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x48, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x32, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, - 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x73, 0x42, 0x79, 0x50, - 0x65, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x25, - 0x0a, 0x23, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, - 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xb2, 0x05, 0x0a, 0x24, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, - 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8a, - 0x01, 0x0a, 0x1a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x4e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, - 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x16, 0x6e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x90, 0x01, 0x0a, 0x1c, - 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, - 0x65, 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x50, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, - 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x75, - 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x18, 0x6e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x75, 0x63, - 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x87, - 0x01, 0x0a, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x66, 0x61, 0x69, 0x6c, - 0x65, 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, - 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x46, 0x61, - 0x69, 0x6c, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x15, 0x6e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, - 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x1a, 0x49, 0x0a, 0x1b, 0x4e, 0x75, 0x6d, 0x52, - 0x70, 0x63, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x1a, 0x4b, 0x0a, 0x1d, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x75, - 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x48, 0x0a, 0x1a, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, - 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc8, 0x02, 0x0a, 0x16, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x70, 0x63, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x49, 0x0a, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x1a, 0x74, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x40, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x29, 0x0a, 0x07, 0x52, 0x70, - 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x5f, 0x43, - 0x41, 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x43, - 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x22, 0x19, 0x0a, 0x17, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2a, 0x3f, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x10, 0x0a, 0x0c, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x10, - 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x41, - 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x41, 0x4e, 0x44, 0x4f, 0x4d, 0x10, - 0x02, 0x2a, 0x6f, 0x0a, 0x0f, 0x47, 0x72, 0x70, 0x63, 0x6c, 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, - 0x4f, 0x55, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, 0x4f, - 0x55, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x41, 0x4c, 0x4c, 0x42, 0x41, 0x43, - 0x4b, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, 0x4f, - 0x55, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, - 0x10, 0x02, 0x32, 0xbb, 0x04, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x35, 0x0a, 0x09, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x43, 0x61, 0x6c, 0x6c, 0x12, - 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x09, 0x55, 0x6e, 0x61, - 0x72, 0x79, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x6c, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x28, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, - 0x67, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, - 0x69, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, - 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x27, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, - 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, + 0x6c, 0x6c, 0x12, 0x27, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, + 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x69, 0x0a, 0x0e, 0x46, 0x75, 0x6c, 0x6c, 0x44, + 0x75, 0x70, 0x6c, 0x65, 0x78, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x28, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, + 0x6e, 0x67, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, + 0x30, 0x01, 0x12, 0x69, 0x0a, 0x0e, 0x48, 0x61, 0x6c, 0x66, 0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, + 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x28, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x69, 0x0a, 0x0e, 0x46, 0x75, - 0x6c, 0x6c, 0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x28, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x69, 0x0a, 0x0e, 0x48, 0x61, 0x6c, 0x66, 0x44, 0x75, 0x70, - 0x6c, 0x65, 0x78, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x28, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, - 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, - 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, - 0x32, 0x55, 0x0a, 0x14, 0x55, 0x6e, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x65, - 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x11, 0x55, 0x6e, 0x69, 0x6d, - 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x13, 0x2e, + 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x6c, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3d, 0x0a, + 0x11, 0x55, 0x6e, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x43, 0x61, + 0x6c, 0x6c, 0x12, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x55, 0x0a, 0x14, + 0x55, 0x6e, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x11, 0x55, 0x6e, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x65, 0x64, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x32, 0x89, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x12, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x1a, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x38, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x86, 0x02, 0x0a, 0x18, 0x4c, 0x6f, 0x61, 0x64, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x63, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, + 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x32, + 0x86, 0x02, 0x0a, 0x18, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x63, 0x0a, 0x0e, + 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x19, 0x47, 0x65, - 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, - 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, - 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, - 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x32, 0x7b, 0x0a, 0x1f, 0x58, 0x64, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, - 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x84, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, + 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, + 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, + 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, + 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, + 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x8b, 0x01, 0x0a, 0x16, 0x58, 0x64, 0x73, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, + 0x67, 0x12, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x0d, 0x53, + 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x12, 0x13, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x13, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x7b, 0x0a, 0x1f, 0x58, 0x64, 0x73, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x09, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2d, 0x5a, - 0x2b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, - 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6f, 0x70, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_interop_grpc_testing_test_proto_rawDescOnce sync.Once - file_interop_grpc_testing_test_proto_rawDescData = file_interop_grpc_testing_test_proto_rawDesc -) - -func file_interop_grpc_testing_test_proto_rawDescGZIP() []byte { - file_interop_grpc_testing_test_proto_rawDescOnce.Do(func() { - file_interop_grpc_testing_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_interop_grpc_testing_test_proto_rawDescData) - }) - return file_interop_grpc_testing_test_proto_rawDescData -} - -var file_interop_grpc_testing_test_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_interop_grpc_testing_test_proto_msgTypes = make([]protoimpl.MessageInfo, 24) -var file_interop_grpc_testing_test_proto_goTypes = []interface{}{ - (PayloadType)(0), // 0: grpc.testing.PayloadType - (GrpclbRouteType)(0), // 1: grpc.testing.GrpclbRouteType - (ClientConfigureRequest_RpcType)(0), // 2: grpc.testing.ClientConfigureRequest.RpcType - (*Empty)(nil), // 3: grpc.testing.Empty - (*Payload)(nil), // 4: grpc.testing.Payload - (*EchoStatus)(nil), // 5: grpc.testing.EchoStatus - (*SimpleRequest)(nil), // 6: grpc.testing.SimpleRequest - (*SimpleResponse)(nil), // 7: grpc.testing.SimpleResponse - (*StreamingInputCallRequest)(nil), // 8: grpc.testing.StreamingInputCallRequest - (*StreamingInputCallResponse)(nil), // 9: grpc.testing.StreamingInputCallResponse - (*ResponseParameters)(nil), // 10: grpc.testing.ResponseParameters - (*StreamingOutputCallRequest)(nil), // 11: grpc.testing.StreamingOutputCallRequest - (*StreamingOutputCallResponse)(nil), // 12: grpc.testing.StreamingOutputCallResponse - (*LoadBalancerStatsRequest)(nil), // 13: grpc.testing.LoadBalancerStatsRequest - (*LoadBalancerStatsResponse)(nil), // 14: grpc.testing.LoadBalancerStatsResponse - (*LoadBalancerAccumulatedStatsRequest)(nil), // 15: grpc.testing.LoadBalancerAccumulatedStatsRequest - (*LoadBalancerAccumulatedStatsResponse)(nil), // 16: grpc.testing.LoadBalancerAccumulatedStatsResponse - (*ClientConfigureRequest)(nil), // 17: grpc.testing.ClientConfigureRequest - (*ClientConfigureResponse)(nil), // 18: grpc.testing.ClientConfigureResponse - (*LoadBalancerStatsResponse_RpcsByPeer)(nil), // 19: grpc.testing.LoadBalancerStatsResponse.RpcsByPeer - nil, // 20: grpc.testing.LoadBalancerStatsResponse.RpcsByPeerEntry - nil, // 21: grpc.testing.LoadBalancerStatsResponse.RpcsByMethodEntry - nil, // 22: grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.RpcsByPeerEntry - nil, // 23: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsStartedByMethodEntry - nil, // 24: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsSucceededByMethodEntry - nil, // 25: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsFailedByMethodEntry - (*ClientConfigureRequest_Metadata)(nil), // 26: grpc.testing.ClientConfigureRequest.Metadata -} -var file_interop_grpc_testing_test_proto_depIdxs = []int32{ - 0, // 0: grpc.testing.Payload.type:type_name -> grpc.testing.PayloadType - 0, // 1: grpc.testing.SimpleRequest.response_type:type_name -> grpc.testing.PayloadType - 4, // 2: grpc.testing.SimpleRequest.payload:type_name -> grpc.testing.Payload - 5, // 3: grpc.testing.SimpleRequest.response_status:type_name -> grpc.testing.EchoStatus - 4, // 4: grpc.testing.SimpleResponse.payload:type_name -> grpc.testing.Payload - 1, // 5: grpc.testing.SimpleResponse.grpclb_route_type:type_name -> grpc.testing.GrpclbRouteType - 4, // 6: grpc.testing.StreamingInputCallRequest.payload:type_name -> grpc.testing.Payload - 0, // 7: grpc.testing.StreamingOutputCallRequest.response_type:type_name -> grpc.testing.PayloadType - 10, // 8: grpc.testing.StreamingOutputCallRequest.response_parameters:type_name -> grpc.testing.ResponseParameters - 4, // 9: grpc.testing.StreamingOutputCallRequest.payload:type_name -> grpc.testing.Payload - 5, // 10: grpc.testing.StreamingOutputCallRequest.response_status:type_name -> grpc.testing.EchoStatus - 4, // 11: grpc.testing.StreamingOutputCallResponse.payload:type_name -> grpc.testing.Payload - 20, // 12: grpc.testing.LoadBalancerStatsResponse.rpcs_by_peer:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByPeerEntry - 21, // 13: grpc.testing.LoadBalancerStatsResponse.rpcs_by_method:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByMethodEntry - 23, // 14: grpc.testing.LoadBalancerAccumulatedStatsResponse.num_rpcs_started_by_method:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsStartedByMethodEntry - 24, // 15: grpc.testing.LoadBalancerAccumulatedStatsResponse.num_rpcs_succeeded_by_method:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsSucceededByMethodEntry - 25, // 16: grpc.testing.LoadBalancerAccumulatedStatsResponse.num_rpcs_failed_by_method:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsFailedByMethodEntry - 2, // 17: grpc.testing.ClientConfigureRequest.types:type_name -> grpc.testing.ClientConfigureRequest.RpcType - 26, // 18: grpc.testing.ClientConfigureRequest.metadata:type_name -> grpc.testing.ClientConfigureRequest.Metadata - 22, // 19: grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.rpcs_by_peer:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.RpcsByPeerEntry - 19, // 20: grpc.testing.LoadBalancerStatsResponse.RpcsByMethodEntry.value:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByPeer - 2, // 21: grpc.testing.ClientConfigureRequest.Metadata.type:type_name -> grpc.testing.ClientConfigureRequest.RpcType - 3, // 22: grpc.testing.TestService.EmptyCall:input_type -> grpc.testing.Empty - 6, // 23: grpc.testing.TestService.UnaryCall:input_type -> grpc.testing.SimpleRequest - 11, // 24: grpc.testing.TestService.StreamingOutputCall:input_type -> grpc.testing.StreamingOutputCallRequest - 8, // 25: grpc.testing.TestService.StreamingInputCall:input_type -> grpc.testing.StreamingInputCallRequest - 11, // 26: grpc.testing.TestService.FullDuplexCall:input_type -> grpc.testing.StreamingOutputCallRequest - 11, // 27: grpc.testing.TestService.HalfDuplexCall:input_type -> grpc.testing.StreamingOutputCallRequest - 3, // 28: grpc.testing.UnimplementedService.UnimplementedCall:input_type -> grpc.testing.Empty - 13, // 29: grpc.testing.LoadBalancerStatsService.GetClientStats:input_type -> grpc.testing.LoadBalancerStatsRequest - 15, // 30: grpc.testing.LoadBalancerStatsService.GetClientAccumulatedStats:input_type -> grpc.testing.LoadBalancerAccumulatedStatsRequest - 17, // 31: grpc.testing.XdsUpdateClientConfigureService.Configure:input_type -> grpc.testing.ClientConfigureRequest - 3, // 32: grpc.testing.TestService.EmptyCall:output_type -> grpc.testing.Empty - 7, // 33: grpc.testing.TestService.UnaryCall:output_type -> grpc.testing.SimpleResponse - 12, // 34: grpc.testing.TestService.StreamingOutputCall:output_type -> grpc.testing.StreamingOutputCallResponse - 9, // 35: grpc.testing.TestService.StreamingInputCall:output_type -> grpc.testing.StreamingInputCallResponse - 12, // 36: grpc.testing.TestService.FullDuplexCall:output_type -> grpc.testing.StreamingOutputCallResponse - 12, // 37: grpc.testing.TestService.HalfDuplexCall:output_type -> grpc.testing.StreamingOutputCallResponse - 3, // 38: grpc.testing.UnimplementedService.UnimplementedCall:output_type -> grpc.testing.Empty - 14, // 39: grpc.testing.LoadBalancerStatsService.GetClientStats:output_type -> grpc.testing.LoadBalancerStatsResponse - 16, // 40: grpc.testing.LoadBalancerStatsService.GetClientAccumulatedStats:output_type -> grpc.testing.LoadBalancerAccumulatedStatsResponse - 18, // 41: grpc.testing.XdsUpdateClientConfigureService.Configure:output_type -> grpc.testing.ClientConfigureResponse - 32, // [32:42] is the sub-list for method output_type - 22, // [22:32] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name -} - -func init() { file_interop_grpc_testing_test_proto_init() } -func file_interop_grpc_testing_test_proto_init() { - if File_interop_grpc_testing_test_proto != nil { + 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_grpc_testing_test_proto_goTypes = []interface{}{ + (*Empty)(nil), // 0: grpc.testing.Empty + (*SimpleRequest)(nil), // 1: grpc.testing.SimpleRequest + (*StreamingOutputCallRequest)(nil), // 2: grpc.testing.StreamingOutputCallRequest + (*StreamingInputCallRequest)(nil), // 3: grpc.testing.StreamingInputCallRequest + (*ReconnectParams)(nil), // 4: grpc.testing.ReconnectParams + (*LoadBalancerStatsRequest)(nil), // 5: grpc.testing.LoadBalancerStatsRequest + (*LoadBalancerAccumulatedStatsRequest)(nil), // 6: grpc.testing.LoadBalancerAccumulatedStatsRequest + (*ClientConfigureRequest)(nil), // 7: grpc.testing.ClientConfigureRequest + (*SimpleResponse)(nil), // 8: grpc.testing.SimpleResponse + (*StreamingOutputCallResponse)(nil), // 9: grpc.testing.StreamingOutputCallResponse + (*StreamingInputCallResponse)(nil), // 10: grpc.testing.StreamingInputCallResponse + (*ReconnectInfo)(nil), // 11: grpc.testing.ReconnectInfo + (*LoadBalancerStatsResponse)(nil), // 12: grpc.testing.LoadBalancerStatsResponse + (*LoadBalancerAccumulatedStatsResponse)(nil), // 13: grpc.testing.LoadBalancerAccumulatedStatsResponse + (*ClientConfigureResponse)(nil), // 14: grpc.testing.ClientConfigureResponse +} +var file_grpc_testing_test_proto_depIdxs = []int32{ + 0, // 0: grpc.testing.TestService.EmptyCall:input_type -> grpc.testing.Empty + 1, // 1: grpc.testing.TestService.UnaryCall:input_type -> grpc.testing.SimpleRequest + 1, // 2: grpc.testing.TestService.CacheableUnaryCall:input_type -> grpc.testing.SimpleRequest + 2, // 3: grpc.testing.TestService.StreamingOutputCall:input_type -> grpc.testing.StreamingOutputCallRequest + 3, // 4: grpc.testing.TestService.StreamingInputCall:input_type -> grpc.testing.StreamingInputCallRequest + 2, // 5: grpc.testing.TestService.FullDuplexCall:input_type -> grpc.testing.StreamingOutputCallRequest + 2, // 6: grpc.testing.TestService.HalfDuplexCall:input_type -> grpc.testing.StreamingOutputCallRequest + 0, // 7: grpc.testing.TestService.UnimplementedCall:input_type -> grpc.testing.Empty + 0, // 8: grpc.testing.UnimplementedService.UnimplementedCall:input_type -> grpc.testing.Empty + 4, // 9: grpc.testing.ReconnectService.Start:input_type -> grpc.testing.ReconnectParams + 0, // 10: grpc.testing.ReconnectService.Stop:input_type -> grpc.testing.Empty + 5, // 11: grpc.testing.LoadBalancerStatsService.GetClientStats:input_type -> grpc.testing.LoadBalancerStatsRequest + 6, // 12: grpc.testing.LoadBalancerStatsService.GetClientAccumulatedStats:input_type -> grpc.testing.LoadBalancerAccumulatedStatsRequest + 0, // 13: grpc.testing.XdsUpdateHealthService.SetServing:input_type -> grpc.testing.Empty + 0, // 14: grpc.testing.XdsUpdateHealthService.SetNotServing:input_type -> grpc.testing.Empty + 7, // 15: grpc.testing.XdsUpdateClientConfigureService.Configure:input_type -> grpc.testing.ClientConfigureRequest + 0, // 16: grpc.testing.TestService.EmptyCall:output_type -> grpc.testing.Empty + 8, // 17: grpc.testing.TestService.UnaryCall:output_type -> grpc.testing.SimpleResponse + 8, // 18: grpc.testing.TestService.CacheableUnaryCall:output_type -> grpc.testing.SimpleResponse + 9, // 19: grpc.testing.TestService.StreamingOutputCall:output_type -> grpc.testing.StreamingOutputCallResponse + 10, // 20: grpc.testing.TestService.StreamingInputCall:output_type -> grpc.testing.StreamingInputCallResponse + 9, // 21: grpc.testing.TestService.FullDuplexCall:output_type -> grpc.testing.StreamingOutputCallResponse + 9, // 22: grpc.testing.TestService.HalfDuplexCall:output_type -> grpc.testing.StreamingOutputCallResponse + 0, // 23: grpc.testing.TestService.UnimplementedCall:output_type -> grpc.testing.Empty + 0, // 24: grpc.testing.UnimplementedService.UnimplementedCall:output_type -> grpc.testing.Empty + 0, // 25: grpc.testing.ReconnectService.Start:output_type -> grpc.testing.Empty + 11, // 26: grpc.testing.ReconnectService.Stop:output_type -> grpc.testing.ReconnectInfo + 12, // 27: grpc.testing.LoadBalancerStatsService.GetClientStats:output_type -> grpc.testing.LoadBalancerStatsResponse + 13, // 28: grpc.testing.LoadBalancerStatsService.GetClientAccumulatedStats:output_type -> grpc.testing.LoadBalancerAccumulatedStatsResponse + 0, // 29: grpc.testing.XdsUpdateHealthService.SetServing:output_type -> grpc.testing.Empty + 0, // 30: grpc.testing.XdsUpdateHealthService.SetNotServing:output_type -> grpc.testing.Empty + 14, // 31: grpc.testing.XdsUpdateClientConfigureService.Configure:output_type -> grpc.testing.ClientConfigureResponse + 16, // [16:32] is the sub-list for method output_type + 0, // [0:16] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_grpc_testing_test_proto_init() } +func file_grpc_testing_test_proto_init() { + if File_grpc_testing_test_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_interop_grpc_testing_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Payload); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EchoStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SimpleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SimpleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamingInputCallRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamingInputCallResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResponseParameters); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamingOutputCallRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamingOutputCallResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadBalancerStatsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadBalancerStatsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadBalancerAccumulatedStatsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadBalancerAccumulatedStatsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientConfigureRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientConfigureResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadBalancerStatsResponse_RpcsByPeer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interop_grpc_testing_test_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientConfigureRequest_Metadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } + file_grpc_testing_empty_proto_init() + file_grpc_testing_messages_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_interop_grpc_testing_test_proto_rawDesc, - NumEnums: 3, - NumMessages: 24, + RawDescriptor: file_grpc_testing_test_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, NumExtensions: 0, - NumServices: 4, + NumServices: 6, }, - GoTypes: file_interop_grpc_testing_test_proto_goTypes, - DependencyIndexes: file_interop_grpc_testing_test_proto_depIdxs, - EnumInfos: file_interop_grpc_testing_test_proto_enumTypes, - MessageInfos: file_interop_grpc_testing_test_proto_msgTypes, + GoTypes: file_grpc_testing_test_proto_goTypes, + DependencyIndexes: file_grpc_testing_test_proto_depIdxs, }.Build() - File_interop_grpc_testing_test_proto = out.File - file_interop_grpc_testing_test_proto_rawDesc = nil - file_interop_grpc_testing_test_proto_goTypes = nil - file_interop_grpc_testing_test_proto_depIdxs = nil + File_grpc_testing_test_proto = out.File + file_grpc_testing_test_proto_rawDesc = nil + file_grpc_testing_test_proto_goTypes = nil + file_grpc_testing_test_proto_depIdxs = nil } diff --git a/interop/grpc_testing/test.proto b/interop/grpc_testing/test.proto deleted file mode 100644 index 3d7f018d3bb5..000000000000 --- a/interop/grpc_testing/test.proto +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright 2017 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// An integration test service that covers all the method signature permutations -// of unary/streaming requests/responses. -syntax = "proto3"; - -option go_package = "google.golang.org/grpc/interop/grpc_testing"; - -package grpc.testing; - -message Empty {} - -// The type of payload that should be returned. -enum PayloadType { - // Compressable text format. - COMPRESSABLE = 0; - - // Uncompressable binary format. - UNCOMPRESSABLE = 1; - - // Randomly chosen from all other formats defined in this enum. - RANDOM = 2; -} - -// A block of data, to simply increase gRPC message size. -message Payload { - // The type of data in body. - PayloadType type = 1; - // Primary contents of payload. - bytes body = 2; -} - -// A protobuf representation for grpc status. This is used by test -// clients to specify a status that the server should attempt to return. -message EchoStatus { - int32 code = 1; - string message = 2; -} - -// The type of route that a client took to reach a server w.r.t. gRPCLB. -// The server must fill in "fallback" if it detects that the RPC reached -// the server via the "gRPCLB fallback" path, and "backend" if it detects -// that the RPC reached the server via "gRPCLB backend" path (i.e. if it got -// the address of this server from the gRPCLB server BalanceLoad RPC). Exactly -// how this detection is done is context and server dependant. -enum GrpclbRouteType { - // Server didn't detect the route that a client took to reach it. - GRPCLB_ROUTE_TYPE_UNKNOWN = 0; - // Indicates that a client reached a server via gRPCLB fallback. - GRPCLB_ROUTE_TYPE_FALLBACK = 1; - // Indicates that a client reached a server as a gRPCLB-given backend. - GRPCLB_ROUTE_TYPE_BACKEND = 2; -} - -// Unary request. -message SimpleRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - PayloadType response_type = 1; - - // Desired payload size in the response from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - int32 response_size = 2; - - // Optional input payload sent along with the request. - Payload payload = 3; - - // Whether SimpleResponse should include username. - bool fill_username = 4; - - // Whether SimpleResponse should include OAuth scope. - bool fill_oauth_scope = 5; - - // Whether server should return a given status - EchoStatus response_status = 7; - - // Whether SimpleResponse should include server_id. - bool fill_server_id = 9; - - // Whether SimpleResponse should include grpclb_route_type. - bool fill_grpclb_route_type = 10; -} - -// Unary response, as configured by the request. -message SimpleResponse { - // Payload to increase message size. - Payload payload = 1; - - // The user the request came from, for verifying authentication was - // successful when the client expected it. - string username = 2; - - // OAuth scope. - string oauth_scope = 3; - - // Server ID. This must be unique among different server instances, - // but the same across all RPC's made to a particular server instance. - string server_id = 4; - - // gRPCLB Path. - GrpclbRouteType grpclb_route_type = 5; - - // Server hostname. - string hostname = 6; -} - -// Client-streaming request. -message StreamingInputCallRequest { - // Optional input payload sent along with the request. - Payload payload = 1; - - // Not expecting any payload from the response. -} - -// Client-streaming response. -message StreamingInputCallResponse { - // Aggregated size of payloads received from the client. - int32 aggregated_payload_size = 1; -} - -// Configuration for a particular response. -message ResponseParameters { - // Desired payload sizes in responses from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - int32 size = 1; - - // Desired interval between consecutive responses in the response stream in - // microseconds. - int32 interval_us = 2; -} - -// Server-streaming request. -message StreamingOutputCallRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, the payload from each response in the stream - // might be of different types. This is to simulate a mixed type of payload - // stream. - PayloadType response_type = 1; - - // Configuration for each expected response message. - repeated ResponseParameters response_parameters = 2; - - // Optional input payload sent along with the request. - Payload payload = 3; - - // Whether server should return a given status - EchoStatus response_status = 7; -} - -// Server-streaming response, as configured by the request and parameters. -message StreamingOutputCallResponse { - // Payload to increase response size. - Payload payload = 1; -} - -// A simple service to test the various types of RPCs and experiment with -// performance with various types of payload. -service TestService { - // One empty request followed by one empty response. - rpc EmptyCall(Empty) returns (Empty); - - // One request followed by one response. - // The server returns the client payload as-is. - rpc UnaryCall(SimpleRequest) returns (SimpleResponse); - - // One request followed by a sequence of responses (streamed download). - // The server returns the payload with client desired type and sizes. - rpc StreamingOutputCall(StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); - - // A sequence of requests followed by one response (streamed upload). - // The server returns the aggregated size of client payload as the result. - rpc StreamingInputCall(stream StreamingInputCallRequest) - returns (StreamingInputCallResponse); - - // A sequence of requests with each request served by the server immediately. - // As one request could lead to multiple responses, this interface - // demonstrates the idea of full duplexing. - rpc FullDuplexCall(stream StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); - - // A sequence of requests followed by a sequence of responses. - // The server buffers all the client requests and then serves them in order. A - // stream of responses are returned to the client when the server starts with - // first request. - rpc HalfDuplexCall(stream StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); -} - -// A simple service NOT implemented at servers so clients can test for -// that case. -service UnimplementedService { - // A call that no server should implement - rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty); -} - -message LoadBalancerStatsRequest { - // Request stats for the next num_rpcs sent by client. - int32 num_rpcs = 1; - // If num_rpcs have not completed within timeout_sec, return partial results. - int32 timeout_sec = 2; -} - -message LoadBalancerStatsResponse { - message RpcsByPeer { - // The number of completed RPCs for each peer. - map rpcs_by_peer = 1; - } - - // The number of completed RPCs for each peer. - map rpcs_by_peer = 1; - // The number of RPCs that failed to record a remote peer. - int32 num_failures = 2; - // The number of completed RPCs for each method (UnaryCall or EmptyCall). - map rpcs_by_method = 3; -} - -// Request for retrieving a test client's accumulated stats. -message LoadBalancerAccumulatedStatsRequest {} - -// Accumulated stats for RPCs sent by a test client. -message LoadBalancerAccumulatedStatsResponse { - // The total number of RPCs have ever issued for each type. - map num_rpcs_started_by_method = 1; - // The total number of RPCs have ever completed successfully for each type. - map num_rpcs_succeeded_by_method = 2; - // The total number of RPCs have ever failed for each type. - map num_rpcs_failed_by_method = 3; -} - -// A service used to obtain stats for verifying LB behavior. -service LoadBalancerStatsService { - // Gets the backend distribution for RPCs sent by a test client. - rpc GetClientStats(LoadBalancerStatsRequest) - returns (LoadBalancerStatsResponse) {} - // Gets the accumulated stats for RPCs sent by a test client. - rpc GetClientAccumulatedStats(LoadBalancerAccumulatedStatsRequest) - returns (LoadBalancerAccumulatedStatsResponse) {} -} - -// Configurations for a test client. -message ClientConfigureRequest { - // Type of RPCs to send. - enum RpcType { - EMPTY_CALL = 0; - UNARY_CALL = 1; - } - - // Metadata to be attached for the given type of RPCs. - message Metadata { - RpcType type = 1; - string key = 2; - string value = 3; - } - - // The types of RPCs the client sends. - repeated RpcType types = 1; - // The collection of custom metadata to be attached to RPCs sent by the client. - repeated Metadata metadata = 2; -} - -// Response for updating a test client's configuration. -message ClientConfigureResponse {} - -// A service to dynamically update the configuration of an xDS test client. -service XdsUpdateClientConfigureService { - // Update the tes client's configuration. - rpc Configure(ClientConfigureRequest) returns (ClientConfigureResponse); -} diff --git a/interop/grpc_testing/test_grpc.pb.go b/interop/grpc_testing/test_grpc.pb.go index a8a2e67375be..6b1ae9eb4321 100644 --- a/interop/grpc_testing/test_grpc.pb.go +++ b/interop/grpc_testing/test_grpc.pb.go @@ -20,8 +20,11 @@ type TestServiceClient interface { // One empty request followed by one empty response. EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) // One request followed by one response. - // The server returns the client payload as-is. UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) + // One request followed by one response. Response has cache control + // headers set such that a caching HTTP proxy (such as GFE) can + // satisfy subsequent requests. + CacheableUnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) // One request followed by a sequence of responses (streamed download). // The server returns the payload with client desired type and sizes. StreamingOutputCall(ctx context.Context, in *StreamingOutputCallRequest, opts ...grpc.CallOption) (TestService_StreamingOutputCallClient, error) @@ -37,6 +40,9 @@ type TestServiceClient interface { // stream of responses are returned to the client when the server starts with // first request. HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_HalfDuplexCallClient, error) + // The test server will not implement this method. It will be used + // to test the behavior when clients call unimplemented methods. + UnimplementedCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) } type testServiceClient struct { @@ -65,6 +71,15 @@ func (c *testServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, op return out, nil } +func (c *testServiceClient) CacheableUnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { + out := new(SimpleResponse) + err := c.cc.Invoke(ctx, "/grpc.testing.TestService/CacheableUnaryCall", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *testServiceClient) StreamingOutputCall(ctx context.Context, in *StreamingOutputCallRequest, opts ...grpc.CallOption) (TestService_StreamingOutputCallClient, error) { stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[0], "/grpc.testing.TestService/StreamingOutputCall", opts...) if err != nil { @@ -193,6 +208,15 @@ func (x *testServiceHalfDuplexCallClient) Recv() (*StreamingOutputCallResponse, return m, nil } +func (c *testServiceClient) UnimplementedCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/grpc.testing.TestService/UnimplementedCall", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // TestServiceServer is the server API for TestService service. // All implementations must embed UnimplementedTestServiceServer // for forward compatibility @@ -200,8 +224,11 @@ type TestServiceServer interface { // One empty request followed by one empty response. EmptyCall(context.Context, *Empty) (*Empty, error) // One request followed by one response. - // The server returns the client payload as-is. UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) + // One request followed by one response. Response has cache control + // headers set such that a caching HTTP proxy (such as GFE) can + // satisfy subsequent requests. + CacheableUnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) // One request followed by a sequence of responses (streamed download). // The server returns the payload with client desired type and sizes. StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error @@ -217,6 +244,9 @@ type TestServiceServer interface { // stream of responses are returned to the client when the server starts with // first request. HalfDuplexCall(TestService_HalfDuplexCallServer) error + // The test server will not implement this method. It will be used + // to test the behavior when clients call unimplemented methods. + UnimplementedCall(context.Context, *Empty) (*Empty, error) mustEmbedUnimplementedTestServiceServer() } @@ -230,6 +260,9 @@ func (UnimplementedTestServiceServer) EmptyCall(context.Context, *Empty) (*Empty func (UnimplementedTestServiceServer) UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UnaryCall not implemented") } +func (UnimplementedTestServiceServer) CacheableUnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CacheableUnaryCall not implemented") +} func (UnimplementedTestServiceServer) StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error { return status.Errorf(codes.Unimplemented, "method StreamingOutputCall not implemented") } @@ -242,6 +275,9 @@ func (UnimplementedTestServiceServer) FullDuplexCall(TestService_FullDuplexCallS func (UnimplementedTestServiceServer) HalfDuplexCall(TestService_HalfDuplexCallServer) error { return status.Errorf(codes.Unimplemented, "method HalfDuplexCall not implemented") } +func (UnimplementedTestServiceServer) UnimplementedCall(context.Context, *Empty) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnimplementedCall not implemented") +} func (UnimplementedTestServiceServer) mustEmbedUnimplementedTestServiceServer() {} // UnsafeTestServiceServer may be embedded to opt out of forward compatibility for this service. @@ -291,6 +327,24 @@ func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _TestService_CacheableUnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SimpleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestServiceServer).CacheableUnaryCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.TestService/CacheableUnaryCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServiceServer).CacheableUnaryCall(ctx, req.(*SimpleRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _TestService_StreamingOutputCall_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(StreamingOutputCallRequest) if err := stream.RecvMsg(m); err != nil { @@ -390,6 +444,24 @@ func (x *testServiceHalfDuplexCallServer) Recv() (*StreamingOutputCallRequest, e return m, nil } +func _TestService_UnimplementedCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestServiceServer).UnimplementedCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.TestService/UnimplementedCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServiceServer).UnimplementedCall(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + // TestService_ServiceDesc is the grpc.ServiceDesc for TestService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -405,6 +477,14 @@ var TestService_ServiceDesc = grpc.ServiceDesc{ MethodName: "UnaryCall", Handler: _TestService_UnaryCall_Handler, }, + { + MethodName: "CacheableUnaryCall", + Handler: _TestService_CacheableUnaryCall_Handler, + }, + { + MethodName: "UnimplementedCall", + Handler: _TestService_UnimplementedCall_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -430,7 +510,7 @@ var TestService_ServiceDesc = grpc.ServiceDesc{ ClientStreams: true, }, }, - Metadata: "interop/grpc_testing/test.proto", + Metadata: "grpc/testing/test.proto", } // UnimplementedServiceClient is the client API for UnimplementedService service. @@ -518,7 +598,129 @@ var UnimplementedService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "interop/grpc_testing/test.proto", + Metadata: "grpc/testing/test.proto", +} + +// ReconnectServiceClient is the client API for ReconnectService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ReconnectServiceClient interface { + Start(ctx context.Context, in *ReconnectParams, opts ...grpc.CallOption) (*Empty, error) + Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ReconnectInfo, error) +} + +type reconnectServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewReconnectServiceClient(cc grpc.ClientConnInterface) ReconnectServiceClient { + return &reconnectServiceClient{cc} +} + +func (c *reconnectServiceClient) Start(ctx context.Context, in *ReconnectParams, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/grpc.testing.ReconnectService/Start", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reconnectServiceClient) Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ReconnectInfo, error) { + out := new(ReconnectInfo) + err := c.cc.Invoke(ctx, "/grpc.testing.ReconnectService/Stop", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ReconnectServiceServer is the server API for ReconnectService service. +// All implementations must embed UnimplementedReconnectServiceServer +// for forward compatibility +type ReconnectServiceServer interface { + Start(context.Context, *ReconnectParams) (*Empty, error) + Stop(context.Context, *Empty) (*ReconnectInfo, error) + mustEmbedUnimplementedReconnectServiceServer() +} + +// UnimplementedReconnectServiceServer must be embedded to have forward compatible implementations. +type UnimplementedReconnectServiceServer struct { +} + +func (UnimplementedReconnectServiceServer) Start(context.Context, *ReconnectParams) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") +} +func (UnimplementedReconnectServiceServer) Stop(context.Context, *Empty) (*ReconnectInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") +} +func (UnimplementedReconnectServiceServer) mustEmbedUnimplementedReconnectServiceServer() {} + +// UnsafeReconnectServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ReconnectServiceServer will +// result in compilation errors. +type UnsafeReconnectServiceServer interface { + mustEmbedUnimplementedReconnectServiceServer() +} + +func RegisterReconnectServiceServer(s grpc.ServiceRegistrar, srv ReconnectServiceServer) { + s.RegisterService(&ReconnectService_ServiceDesc, srv) +} + +func _ReconnectService_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReconnectParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReconnectServiceServer).Start(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.ReconnectService/Start", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReconnectServiceServer).Start(ctx, req.(*ReconnectParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReconnectService_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReconnectServiceServer).Stop(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.ReconnectService/Stop", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReconnectServiceServer).Stop(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// ReconnectService_ServiceDesc is the grpc.ServiceDesc for ReconnectService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ReconnectService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.ReconnectService", + HandlerType: (*ReconnectServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Start", + Handler: _ReconnectService_Start_Handler, + }, + { + MethodName: "Stop", + Handler: _ReconnectService_Stop_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "grpc/testing/test.proto", } // LoadBalancerStatsServiceClient is the client API for LoadBalancerStatsService service. @@ -645,7 +847,130 @@ var LoadBalancerStatsService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "interop/grpc_testing/test.proto", + Metadata: "grpc/testing/test.proto", +} + +// XdsUpdateHealthServiceClient is the client API for XdsUpdateHealthService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type XdsUpdateHealthServiceClient interface { + SetServing(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) + SetNotServing(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) +} + +type xdsUpdateHealthServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewXdsUpdateHealthServiceClient(cc grpc.ClientConnInterface) XdsUpdateHealthServiceClient { + return &xdsUpdateHealthServiceClient{cc} +} + +func (c *xdsUpdateHealthServiceClient) SetServing(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/grpc.testing.XdsUpdateHealthService/SetServing", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *xdsUpdateHealthServiceClient) SetNotServing(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/grpc.testing.XdsUpdateHealthService/SetNotServing", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// XdsUpdateHealthServiceServer is the server API for XdsUpdateHealthService service. +// All implementations must embed UnimplementedXdsUpdateHealthServiceServer +// for forward compatibility +type XdsUpdateHealthServiceServer interface { + SetServing(context.Context, *Empty) (*Empty, error) + SetNotServing(context.Context, *Empty) (*Empty, error) + mustEmbedUnimplementedXdsUpdateHealthServiceServer() +} + +// UnimplementedXdsUpdateHealthServiceServer must be embedded to have forward compatible implementations. +type UnimplementedXdsUpdateHealthServiceServer struct { +} + +func (UnimplementedXdsUpdateHealthServiceServer) SetServing(context.Context, *Empty) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetServing not implemented") +} +func (UnimplementedXdsUpdateHealthServiceServer) SetNotServing(context.Context, *Empty) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetNotServing not implemented") +} +func (UnimplementedXdsUpdateHealthServiceServer) mustEmbedUnimplementedXdsUpdateHealthServiceServer() { +} + +// UnsafeXdsUpdateHealthServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to XdsUpdateHealthServiceServer will +// result in compilation errors. +type UnsafeXdsUpdateHealthServiceServer interface { + mustEmbedUnimplementedXdsUpdateHealthServiceServer() +} + +func RegisterXdsUpdateHealthServiceServer(s grpc.ServiceRegistrar, srv XdsUpdateHealthServiceServer) { + s.RegisterService(&XdsUpdateHealthService_ServiceDesc, srv) +} + +func _XdsUpdateHealthService_SetServing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(XdsUpdateHealthServiceServer).SetServing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.XdsUpdateHealthService/SetServing", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(XdsUpdateHealthServiceServer).SetServing(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _XdsUpdateHealthService_SetNotServing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(XdsUpdateHealthServiceServer).SetNotServing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.testing.XdsUpdateHealthService/SetNotServing", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(XdsUpdateHealthServiceServer).SetNotServing(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// XdsUpdateHealthService_ServiceDesc is the grpc.ServiceDesc for XdsUpdateHealthService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var XdsUpdateHealthService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.testing.XdsUpdateHealthService", + HandlerType: (*XdsUpdateHealthServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetServing", + Handler: _XdsUpdateHealthService_SetServing_Handler, + }, + { + MethodName: "SetNotServing", + Handler: _XdsUpdateHealthService_SetNotServing_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "grpc/testing/test.proto", } // XdsUpdateClientConfigureServiceClient is the client API for XdsUpdateClientConfigureService service. @@ -734,5 +1059,5 @@ var XdsUpdateClientConfigureService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "interop/grpc_testing/test.proto", + Metadata: "grpc/testing/test.proto", } diff --git a/interop/grpc_testing/worker_service.pb.go b/interop/grpc_testing/worker_service.pb.go new file mode 100644 index 000000000000..3effdd6533b4 --- /dev/null +++ b/interop/grpc_testing/worker_service.pb.go @@ -0,0 +1,120 @@ +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: grpc/testing/worker_service.proto + +package grpc_testing + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +var File_grpc_testing_worker_service_proto protoreflect.FileDescriptor + +var file_grpc_testing_worker_service_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x77, + 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x1a, 0x1a, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x97, 0x02, + 0x0a, 0x0d, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x45, 0x0a, 0x09, 0x52, 0x75, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x67, + 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x41, 0x72, 0x67, 0x73, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x28, 0x01, 0x30, 0x01, 0x12, 0x45, 0x0a, 0x09, 0x52, 0x75, 0x6e, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x72, 0x67, 0x73, 0x1a, 0x1a, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x28, 0x01, 0x30, 0x01, 0x12, 0x42, 0x0a, + 0x09, 0x43, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x34, 0x0a, 0x0a, 0x51, 0x75, 0x69, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, + 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x56, + 0x6f, 0x69, 0x64, 0x1a, 0x12, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x56, 0x6f, 0x69, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_grpc_testing_worker_service_proto_goTypes = []interface{}{ + (*ServerArgs)(nil), // 0: grpc.testing.ServerArgs + (*ClientArgs)(nil), // 1: grpc.testing.ClientArgs + (*CoreRequest)(nil), // 2: grpc.testing.CoreRequest + (*Void)(nil), // 3: grpc.testing.Void + (*ServerStatus)(nil), // 4: grpc.testing.ServerStatus + (*ClientStatus)(nil), // 5: grpc.testing.ClientStatus + (*CoreResponse)(nil), // 6: grpc.testing.CoreResponse +} +var file_grpc_testing_worker_service_proto_depIdxs = []int32{ + 0, // 0: grpc.testing.WorkerService.RunServer:input_type -> grpc.testing.ServerArgs + 1, // 1: grpc.testing.WorkerService.RunClient:input_type -> grpc.testing.ClientArgs + 2, // 2: grpc.testing.WorkerService.CoreCount:input_type -> grpc.testing.CoreRequest + 3, // 3: grpc.testing.WorkerService.QuitWorker:input_type -> grpc.testing.Void + 4, // 4: grpc.testing.WorkerService.RunServer:output_type -> grpc.testing.ServerStatus + 5, // 5: grpc.testing.WorkerService.RunClient:output_type -> grpc.testing.ClientStatus + 6, // 6: grpc.testing.WorkerService.CoreCount:output_type -> grpc.testing.CoreResponse + 3, // 7: grpc.testing.WorkerService.QuitWorker:output_type -> grpc.testing.Void + 4, // [4:8] is the sub-list for method output_type + 0, // [0:4] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_grpc_testing_worker_service_proto_init() } +func file_grpc_testing_worker_service_proto_init() { + if File_grpc_testing_worker_service_proto != nil { + return + } + file_grpc_testing_control_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_grpc_testing_worker_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_grpc_testing_worker_service_proto_goTypes, + DependencyIndexes: file_grpc_testing_worker_service_proto_depIdxs, + }.Build() + File_grpc_testing_worker_service_proto = out.File + file_grpc_testing_worker_service_proto_rawDesc = nil + file_grpc_testing_worker_service_proto_goTypes = nil + file_grpc_testing_worker_service_proto_depIdxs = nil +} diff --git a/benchmark/grpc_testing/services_grpc.pb.go b/interop/grpc_testing/worker_service_grpc.pb.go similarity index 54% rename from benchmark/grpc_testing/services_grpc.pb.go rename to interop/grpc_testing/worker_service_grpc.pb.go index 5dfe0e578dff..76d24ca2e20a 100644 --- a/benchmark/grpc_testing/services_grpc.pb.go +++ b/interop/grpc_testing/worker_service_grpc.pb.go @@ -13,241 +13,6 @@ import ( // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion7 -// BenchmarkServiceClient is the client API for BenchmarkService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type BenchmarkServiceClient interface { - // One request followed by one response. - // The server returns the client payload as-is. - UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) - // One request followed by one response. - // The server returns the client payload as-is. - StreamingCall(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingCallClient, error) - // Unconstrainted streaming. - // Both server and client keep sending & receiving simultaneously. - UnconstrainedStreamingCall(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_UnconstrainedStreamingCallClient, error) -} - -type benchmarkServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewBenchmarkServiceClient(cc grpc.ClientConnInterface) BenchmarkServiceClient { - return &benchmarkServiceClient{cc} -} - -func (c *benchmarkServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { - out := new(SimpleResponse) - err := c.cc.Invoke(ctx, "/grpc.testing.BenchmarkService/UnaryCall", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *benchmarkServiceClient) StreamingCall(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingCallClient, error) { - stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[0], "/grpc.testing.BenchmarkService/StreamingCall", opts...) - if err != nil { - return nil, err - } - x := &benchmarkServiceStreamingCallClient{stream} - return x, nil -} - -type BenchmarkService_StreamingCallClient interface { - Send(*SimpleRequest) error - Recv() (*SimpleResponse, error) - grpc.ClientStream -} - -type benchmarkServiceStreamingCallClient struct { - grpc.ClientStream -} - -func (x *benchmarkServiceStreamingCallClient) Send(m *SimpleRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *benchmarkServiceStreamingCallClient) Recv() (*SimpleResponse, error) { - m := new(SimpleResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *benchmarkServiceClient) UnconstrainedStreamingCall(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_UnconstrainedStreamingCallClient, error) { - stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[1], "/grpc.testing.BenchmarkService/UnconstrainedStreamingCall", opts...) - if err != nil { - return nil, err - } - x := &benchmarkServiceUnconstrainedStreamingCallClient{stream} - return x, nil -} - -type BenchmarkService_UnconstrainedStreamingCallClient interface { - Send(*SimpleRequest) error - Recv() (*SimpleResponse, error) - grpc.ClientStream -} - -type benchmarkServiceUnconstrainedStreamingCallClient struct { - grpc.ClientStream -} - -func (x *benchmarkServiceUnconstrainedStreamingCallClient) Send(m *SimpleRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *benchmarkServiceUnconstrainedStreamingCallClient) Recv() (*SimpleResponse, error) { - m := new(SimpleResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// BenchmarkServiceServer is the server API for BenchmarkService service. -// All implementations must embed UnimplementedBenchmarkServiceServer -// for forward compatibility -type BenchmarkServiceServer interface { - // One request followed by one response. - // The server returns the client payload as-is. - UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) - // One request followed by one response. - // The server returns the client payload as-is. - StreamingCall(BenchmarkService_StreamingCallServer) error - // Unconstrainted streaming. - // Both server and client keep sending & receiving simultaneously. - UnconstrainedStreamingCall(BenchmarkService_UnconstrainedStreamingCallServer) error - mustEmbedUnimplementedBenchmarkServiceServer() -} - -// UnimplementedBenchmarkServiceServer must be embedded to have forward compatible implementations. -type UnimplementedBenchmarkServiceServer struct { -} - -func (UnimplementedBenchmarkServiceServer) UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnaryCall not implemented") -} -func (UnimplementedBenchmarkServiceServer) StreamingCall(BenchmarkService_StreamingCallServer) error { - return status.Errorf(codes.Unimplemented, "method StreamingCall not implemented") -} -func (UnimplementedBenchmarkServiceServer) UnconstrainedStreamingCall(BenchmarkService_UnconstrainedStreamingCallServer) error { - return status.Errorf(codes.Unimplemented, "method UnconstrainedStreamingCall not implemented") -} -func (UnimplementedBenchmarkServiceServer) mustEmbedUnimplementedBenchmarkServiceServer() {} - -// UnsafeBenchmarkServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BenchmarkServiceServer will -// result in compilation errors. -type UnsafeBenchmarkServiceServer interface { - mustEmbedUnimplementedBenchmarkServiceServer() -} - -func RegisterBenchmarkServiceServer(s grpc.ServiceRegistrar, srv BenchmarkServiceServer) { - s.RegisterService(&BenchmarkService_ServiceDesc, srv) -} - -func _BenchmarkService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SimpleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BenchmarkServiceServer).UnaryCall(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.testing.BenchmarkService/UnaryCall", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BenchmarkServiceServer).UnaryCall(ctx, req.(*SimpleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BenchmarkService_StreamingCall_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(BenchmarkServiceServer).StreamingCall(&benchmarkServiceStreamingCallServer{stream}) -} - -type BenchmarkService_StreamingCallServer interface { - Send(*SimpleResponse) error - Recv() (*SimpleRequest, error) - grpc.ServerStream -} - -type benchmarkServiceStreamingCallServer struct { - grpc.ServerStream -} - -func (x *benchmarkServiceStreamingCallServer) Send(m *SimpleResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *benchmarkServiceStreamingCallServer) Recv() (*SimpleRequest, error) { - m := new(SimpleRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _BenchmarkService_UnconstrainedStreamingCall_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(BenchmarkServiceServer).UnconstrainedStreamingCall(&benchmarkServiceUnconstrainedStreamingCallServer{stream}) -} - -type BenchmarkService_UnconstrainedStreamingCallServer interface { - Send(*SimpleResponse) error - Recv() (*SimpleRequest, error) - grpc.ServerStream -} - -type benchmarkServiceUnconstrainedStreamingCallServer struct { - grpc.ServerStream -} - -func (x *benchmarkServiceUnconstrainedStreamingCallServer) Send(m *SimpleResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *benchmarkServiceUnconstrainedStreamingCallServer) Recv() (*SimpleRequest, error) { - m := new(SimpleRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// BenchmarkService_ServiceDesc is the grpc.ServiceDesc for BenchmarkService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var BenchmarkService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.testing.BenchmarkService", - HandlerType: (*BenchmarkServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UnaryCall", - Handler: _BenchmarkService_UnaryCall_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamingCall", - Handler: _BenchmarkService_StreamingCall_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "UnconstrainedStreamingCall", - Handler: _BenchmarkService_UnconstrainedStreamingCall_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "benchmark/grpc_testing/services.proto", -} - // WorkerServiceClient is the client API for WorkerService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -532,5 +297,5 @@ var WorkerService_ServiceDesc = grpc.ServiceDesc{ ClientStreams: true, }, }, - Metadata: "benchmark/grpc_testing/services.proto", + Metadata: "grpc/testing/worker_service.proto", } diff --git a/interop/test_utils.go b/interop/test_utils.go index 7e3aaa95f0ca..78f937a83d68 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -57,8 +57,6 @@ func ClientNewPayload(t testpb.PayloadType, size int) *testpb.Payload { body := make([]byte, size) switch t { case testpb.PayloadType_COMPRESSABLE: - case testpb.PayloadType_UNCOMPRESSABLE: - logger.Fatalf("PayloadType UNCOMPRESSABLE is not supported") default: logger.Fatalf("Unsupported payload type: %d", t) } @@ -693,8 +691,6 @@ func serverNewPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) body := make([]byte, size) switch t { case testpb.PayloadType_COMPRESSABLE: - case testpb.PayloadType_UNCOMPRESSABLE: - return nil, fmt.Errorf("payloadType UNCOMPRESSABLE is not supported") default: return nil, fmt.Errorf("unsupported payload type: %d", t) } diff --git a/regenerate.sh b/regenerate.sh index 6d3ec324a260..ed52187df660 100755 --- a/regenerate.sh +++ b/regenerate.sh @@ -71,13 +71,15 @@ SOURCES=( ${WORKDIR}/grpc-proto/grpc/lookup/v1/rls.proto ${WORKDIR}/grpc-proto/grpc/lookup/v1/rls_config.proto ${WORKDIR}/grpc-proto/grpc/service_config/service_config.proto + ${WORKDIR}/grpc-proto/grpc/testing/*.proto + ${WORKDIR}/grpc-proto/grpc/core/*.proto ${WORKDIR}/istio/istio/google/security/meshca/v1/meshca.proto ) # These options of the form 'Mfoo.proto=bar' instruct the codegen to use an # import path of 'bar' in the generated code when 'foo.proto' is imported in # one of the sources. -OPTS=Mgrpc/service_config/service_config.proto=/internal/proto/grpc_service_config +OPTS=Mgrpc/service_config/service_config.proto=/internal/proto/grpc_service_config,Mgrpc/core/stats.proto=google.golang.org/grpc/interop/grpc_testing/core for src in ${SOURCES[@]}; do echo "protoc ${src}" @@ -111,6 +113,10 @@ rm ${WORKDIR}/out/google.golang.org/grpc/reflection/grpc_testingv3/*.pb.go # grpc/service_config/service_config.proto does not have a go_package option. mv ${WORKDIR}/out/grpc/service_config/service_config.pb.go internal/proto/grpc_service_config +# grpc/testing does not have a go_package option. +mv ${WORKDIR}/out/grpc/testing/*.pb.go interop/grpc_testing/ +mv ${WORKDIR}/out/grpc/core/*.pb.go interop/grpc_testing/core/ + # istio/google/security/meshca/v1/meshca.proto does not have a go_package option. mkdir -p ${WORKDIR}/out/google.golang.org/grpc/credentials/tls/certprovider/meshca/internal/v1/ mv ${WORKDIR}/out/istio/google/security/meshca/v1/* ${WORKDIR}/out/google.golang.org/grpc/credentials/tls/certprovider/meshca/internal/v1/ diff --git a/stats/grpc_testing/test.pb.go b/stats/grpc_testing/test.pb.go deleted file mode 100644 index 7acea50d128f..000000000000 --- a/stats/grpc_testing/test.pb.go +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright 2017 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.14.0 -// source: stats/grpc_testing/test.proto - -package grpc_testing - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -type SimpleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *SimpleRequest) Reset() { - *x = SimpleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_stats_grpc_testing_test_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SimpleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SimpleRequest) ProtoMessage() {} - -func (x *SimpleRequest) ProtoReflect() protoreflect.Message { - mi := &file_stats_grpc_testing_test_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SimpleRequest.ProtoReflect.Descriptor instead. -func (*SimpleRequest) Descriptor() ([]byte, []int) { - return file_stats_grpc_testing_test_proto_rawDescGZIP(), []int{0} -} - -func (x *SimpleRequest) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -type SimpleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *SimpleResponse) Reset() { - *x = SimpleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_stats_grpc_testing_test_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SimpleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SimpleResponse) ProtoMessage() {} - -func (x *SimpleResponse) ProtoReflect() protoreflect.Message { - mi := &file_stats_grpc_testing_test_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SimpleResponse.ProtoReflect.Descriptor instead. -func (*SimpleResponse) Descriptor() ([]byte, []int) { - return file_stats_grpc_testing_test_proto_rawDescGZIP(), []int{1} -} - -func (x *SimpleResponse) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -var File_stats_grpc_testing_test_proto protoreflect.FileDescriptor - -var file_stats_grpc_testing_test_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x1f, 0x0a, - 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x20, - 0x0a, 0x0e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, - 0x32, 0xc8, 0x02, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x46, 0x0a, 0x09, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x1b, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, - 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0e, 0x46, 0x75, 0x6c, 0x6c, - 0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4f, 0x0a, 0x10, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x1b, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, - 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x4f, 0x0a, 0x10, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x1b, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, - 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x2b, 0x5a, 0x29, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x5f, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_stats_grpc_testing_test_proto_rawDescOnce sync.Once - file_stats_grpc_testing_test_proto_rawDescData = file_stats_grpc_testing_test_proto_rawDesc -) - -func file_stats_grpc_testing_test_proto_rawDescGZIP() []byte { - file_stats_grpc_testing_test_proto_rawDescOnce.Do(func() { - file_stats_grpc_testing_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_stats_grpc_testing_test_proto_rawDescData) - }) - return file_stats_grpc_testing_test_proto_rawDescData -} - -var file_stats_grpc_testing_test_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_stats_grpc_testing_test_proto_goTypes = []interface{}{ - (*SimpleRequest)(nil), // 0: grpc.testing.SimpleRequest - (*SimpleResponse)(nil), // 1: grpc.testing.SimpleResponse -} -var file_stats_grpc_testing_test_proto_depIdxs = []int32{ - 0, // 0: grpc.testing.TestService.UnaryCall:input_type -> grpc.testing.SimpleRequest - 0, // 1: grpc.testing.TestService.FullDuplexCall:input_type -> grpc.testing.SimpleRequest - 0, // 2: grpc.testing.TestService.ClientStreamCall:input_type -> grpc.testing.SimpleRequest - 0, // 3: grpc.testing.TestService.ServerStreamCall:input_type -> grpc.testing.SimpleRequest - 1, // 4: grpc.testing.TestService.UnaryCall:output_type -> grpc.testing.SimpleResponse - 1, // 5: grpc.testing.TestService.FullDuplexCall:output_type -> grpc.testing.SimpleResponse - 1, // 6: grpc.testing.TestService.ClientStreamCall:output_type -> grpc.testing.SimpleResponse - 1, // 7: grpc.testing.TestService.ServerStreamCall:output_type -> grpc.testing.SimpleResponse - 4, // [4:8] is the sub-list for method output_type - 0, // [0:4] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_stats_grpc_testing_test_proto_init() } -func file_stats_grpc_testing_test_proto_init() { - if File_stats_grpc_testing_test_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_stats_grpc_testing_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SimpleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stats_grpc_testing_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SimpleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_stats_grpc_testing_test_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_stats_grpc_testing_test_proto_goTypes, - DependencyIndexes: file_stats_grpc_testing_test_proto_depIdxs, - MessageInfos: file_stats_grpc_testing_test_proto_msgTypes, - }.Build() - File_stats_grpc_testing_test_proto = out.File - file_stats_grpc_testing_test_proto_rawDesc = nil - file_stats_grpc_testing_test_proto_goTypes = nil - file_stats_grpc_testing_test_proto_depIdxs = nil -} diff --git a/stats/grpc_testing/test.proto b/stats/grpc_testing/test.proto deleted file mode 100644 index 2716363260a6..000000000000 --- a/stats/grpc_testing/test.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2017 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -option go_package = "google.golang.org/grpc/stats/grpc_testing"; - -package grpc.testing; - -message SimpleRequest { - int32 id = 2; -} - -message SimpleResponse { - int32 id = 3; -} - -// A simple test service. -service TestService { - // One request followed by one response. - // The server returns the client id as-is. - rpc UnaryCall(SimpleRequest) returns (SimpleResponse); - - // A sequence of requests with each request served by the server immediately. - // As one request could lead to multiple responses, this interface - // demonstrates the idea of full duplexing. - rpc FullDuplexCall(stream SimpleRequest) returns (stream SimpleResponse); - - // Client stream - rpc ClientStreamCall(stream SimpleRequest) returns (SimpleResponse); - - // Server stream - rpc ServerStreamCall(SimpleRequest) returns (stream SimpleResponse); -} diff --git a/stats/grpc_testing/test_grpc.pb.go b/stats/grpc_testing/test_grpc.pb.go deleted file mode 100644 index 3a6f2b8e1a65..000000000000 --- a/stats/grpc_testing/test_grpc.pb.go +++ /dev/null @@ -1,316 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. - -package grpc_testing - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion7 - -// TestServiceClient is the client API for TestService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type TestServiceClient interface { - // One request followed by one response. - // The server returns the client id as-is. - UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) - // A sequence of requests with each request served by the server immediately. - // As one request could lead to multiple responses, this interface - // demonstrates the idea of full duplexing. - FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) - // Client stream - ClientStreamCall(ctx context.Context, opts ...grpc.CallOption) (TestService_ClientStreamCallClient, error) - // Server stream - ServerStreamCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (TestService_ServerStreamCallClient, error) -} - -type testServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient { - return &testServiceClient{cc} -} - -func (c *testServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { - out := new(SimpleResponse) - err := c.cc.Invoke(ctx, "/grpc.testing.TestService/UnaryCall", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testServiceClient) FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) { - stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[0], "/grpc.testing.TestService/FullDuplexCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceFullDuplexCallClient{stream} - return x, nil -} - -type TestService_FullDuplexCallClient interface { - Send(*SimpleRequest) error - Recv() (*SimpleResponse, error) - grpc.ClientStream -} - -type testServiceFullDuplexCallClient struct { - grpc.ClientStream -} - -func (x *testServiceFullDuplexCallClient) Send(m *SimpleRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testServiceFullDuplexCallClient) Recv() (*SimpleResponse, error) { - m := new(SimpleResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *testServiceClient) ClientStreamCall(ctx context.Context, opts ...grpc.CallOption) (TestService_ClientStreamCallClient, error) { - stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[1], "/grpc.testing.TestService/ClientStreamCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceClientStreamCallClient{stream} - return x, nil -} - -type TestService_ClientStreamCallClient interface { - Send(*SimpleRequest) error - CloseAndRecv() (*SimpleResponse, error) - grpc.ClientStream -} - -type testServiceClientStreamCallClient struct { - grpc.ClientStream -} - -func (x *testServiceClientStreamCallClient) Send(m *SimpleRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testServiceClientStreamCallClient) CloseAndRecv() (*SimpleResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(SimpleResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *testServiceClient) ServerStreamCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (TestService_ServerStreamCallClient, error) { - stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[2], "/grpc.testing.TestService/ServerStreamCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceServerStreamCallClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type TestService_ServerStreamCallClient interface { - Recv() (*SimpleResponse, error) - grpc.ClientStream -} - -type testServiceServerStreamCallClient struct { - grpc.ClientStream -} - -func (x *testServiceServerStreamCallClient) Recv() (*SimpleResponse, error) { - m := new(SimpleResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// TestServiceServer is the server API for TestService service. -// All implementations must embed UnimplementedTestServiceServer -// for forward compatibility -type TestServiceServer interface { - // One request followed by one response. - // The server returns the client id as-is. - UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) - // A sequence of requests with each request served by the server immediately. - // As one request could lead to multiple responses, this interface - // demonstrates the idea of full duplexing. - FullDuplexCall(TestService_FullDuplexCallServer) error - // Client stream - ClientStreamCall(TestService_ClientStreamCallServer) error - // Server stream - ServerStreamCall(*SimpleRequest, TestService_ServerStreamCallServer) error - mustEmbedUnimplementedTestServiceServer() -} - -// UnimplementedTestServiceServer must be embedded to have forward compatible implementations. -type UnimplementedTestServiceServer struct { -} - -func (UnimplementedTestServiceServer) UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnaryCall not implemented") -} -func (UnimplementedTestServiceServer) FullDuplexCall(TestService_FullDuplexCallServer) error { - return status.Errorf(codes.Unimplemented, "method FullDuplexCall not implemented") -} -func (UnimplementedTestServiceServer) ClientStreamCall(TestService_ClientStreamCallServer) error { - return status.Errorf(codes.Unimplemented, "method ClientStreamCall not implemented") -} -func (UnimplementedTestServiceServer) ServerStreamCall(*SimpleRequest, TestService_ServerStreamCallServer) error { - return status.Errorf(codes.Unimplemented, "method ServerStreamCall not implemented") -} -func (UnimplementedTestServiceServer) mustEmbedUnimplementedTestServiceServer() {} - -// UnsafeTestServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to TestServiceServer will -// result in compilation errors. -type UnsafeTestServiceServer interface { - mustEmbedUnimplementedTestServiceServer() -} - -func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer) { - s.RegisterService(&TestService_ServiceDesc, srv) -} - -func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SimpleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestServiceServer).UnaryCall(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.testing.TestService/UnaryCall", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestServiceServer).UnaryCall(ctx, req.(*SimpleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestService_FullDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServiceServer).FullDuplexCall(&testServiceFullDuplexCallServer{stream}) -} - -type TestService_FullDuplexCallServer interface { - Send(*SimpleResponse) error - Recv() (*SimpleRequest, error) - grpc.ServerStream -} - -type testServiceFullDuplexCallServer struct { - grpc.ServerStream -} - -func (x *testServiceFullDuplexCallServer) Send(m *SimpleResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testServiceFullDuplexCallServer) Recv() (*SimpleRequest, error) { - m := new(SimpleRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _TestService_ClientStreamCall_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServiceServer).ClientStreamCall(&testServiceClientStreamCallServer{stream}) -} - -type TestService_ClientStreamCallServer interface { - SendAndClose(*SimpleResponse) error - Recv() (*SimpleRequest, error) - grpc.ServerStream -} - -type testServiceClientStreamCallServer struct { - grpc.ServerStream -} - -func (x *testServiceClientStreamCallServer) SendAndClose(m *SimpleResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testServiceClientStreamCallServer) Recv() (*SimpleRequest, error) { - m := new(SimpleRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _TestService_ServerStreamCall_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SimpleRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(TestServiceServer).ServerStreamCall(m, &testServiceServerStreamCallServer{stream}) -} - -type TestService_ServerStreamCallServer interface { - Send(*SimpleResponse) error - grpc.ServerStream -} - -type testServiceServerStreamCallServer struct { - grpc.ServerStream -} - -func (x *testServiceServerStreamCallServer) Send(m *SimpleResponse) error { - return x.ServerStream.SendMsg(m) -} - -// TestService_ServiceDesc is the grpc.ServiceDesc for TestService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var TestService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.testing.TestService", - HandlerType: (*TestServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UnaryCall", - Handler: _TestService_UnaryCall_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "FullDuplexCall", - Handler: _TestService_FullDuplexCall_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "ClientStreamCall", - Handler: _TestService_ClientStreamCall_Handler, - ClientStreams: true, - }, - { - StreamName: "ServerStreamCall", - Handler: _TestService_ServerStreamCall_Handler, - ServerStreams: true, - }, - }, - Metadata: "stats/grpc_testing/test.proto", -} diff --git a/stats/stats_test.go b/stats/stats_test.go index 875a57eeddfc..aac8166f76f8 100644 --- a/stats/stats_test.go +++ b/stats/stats_test.go @@ -31,9 +31,9 @@ import ( "github.com/golang/protobuf/proto" "google.golang.org/grpc" "google.golang.org/grpc/internal/grpctest" + testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/metadata" "google.golang.org/grpc/stats" - testpb "google.golang.org/grpc/stats/grpc_testing" "google.golang.org/grpc/status" ) @@ -75,6 +75,17 @@ var ( errorID int32 = 32202 ) +func idToPayload(id int32) *testpb.Payload { + return &testpb.Payload{Body: []byte{byte(id), byte(id >> 8), byte(id >> 16), byte(id >> 24)}} +} + +func payloadToID(p *testpb.Payload) int32 { + if p == nil || len(p.Body) != 4 { + panic("invalid payload") + } + return int32(p.Body[0]) + int32(p.Body[1])<<8 + int32(p.Body[2])<<16 + int32(p.Body[3])<<24 +} + type testServer struct { testpb.UnimplementedTestServiceServer } @@ -87,11 +98,11 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (* return nil, status.Errorf(status.Code(err), "grpc.SetTrailer(_, %v) = %v, want ", testTrailerMetadata, err) } - if in.Id == errorID { - return nil, fmt.Errorf("got error id: %v", in.Id) + if id := payloadToID(in.Payload); id == errorID { + return nil, fmt.Errorf("got error id: %v", id) } - return &testpb.SimpleResponse{Id: in.Id}, nil + return &testpb.SimpleResponse{Payload: in.Payload}, nil } func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { @@ -109,17 +120,17 @@ func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServ return err } - if in.Id == errorID { - return fmt.Errorf("got error id: %v", in.Id) + if id := payloadToID(in.Payload); id == errorID { + return fmt.Errorf("got error id: %v", id) } - if err := stream.Send(&testpb.SimpleResponse{Id: in.Id}); err != nil { + if err := stream.Send(&testpb.StreamingOutputCallResponse{Payload: in.Payload}); err != nil { return err } } } -func (s *testServer) ClientStreamCall(stream testpb.TestService_ClientStreamCallServer) error { +func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInputCallServer) error { if err := stream.SendHeader(testHeaderMetadata); err != nil { return status.Errorf(status.Code(err), "%v.SendHeader(%v) = %v, want %v", stream, testHeaderMetadata, err, nil) } @@ -128,30 +139,30 @@ func (s *testServer) ClientStreamCall(stream testpb.TestService_ClientStreamCall in, err := stream.Recv() if err == io.EOF { // read done. - return stream.SendAndClose(&testpb.SimpleResponse{Id: int32(0)}) + return stream.SendAndClose(&testpb.StreamingInputCallResponse{AggregatedPayloadSize: 0}) } if err != nil { return err } - if in.Id == errorID { - return fmt.Errorf("got error id: %v", in.Id) + if id := payloadToID(in.Payload); id == errorID { + return fmt.Errorf("got error id: %v", id) } } } -func (s *testServer) ServerStreamCall(in *testpb.SimpleRequest, stream testpb.TestService_ServerStreamCallServer) error { +func (s *testServer) StreamingOutputCall(in *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { if err := stream.SendHeader(testHeaderMetadata); err != nil { return status.Errorf(status.Code(err), "%v.SendHeader(%v) = %v, want %v", stream, testHeaderMetadata, err, nil) } stream.SetTrailer(testTrailerMetadata) - if in.Id == errorID { - return fmt.Errorf("got error id: %v", in.Id) + if id := payloadToID(in.Payload); id == errorID { + return fmt.Errorf("got error id: %v", id) } for i := 0; i < 5; i++ { - if err := stream.Send(&testpb.SimpleResponse{Id: in.Id}); err != nil { + if err := stream.Send(&testpb.StreamingOutputCallResponse{Payload: in.Payload}); err != nil { return err } } @@ -279,9 +290,9 @@ func (te *test) doUnaryCall(c *rpcConfig) (*testpb.SimpleRequest, *testpb.Simple ) tc := testpb.NewTestServiceClient(te.clientConn()) if c.success { - req = &testpb.SimpleRequest{Id: errorID + 1} + req = &testpb.SimpleRequest{Payload: idToPayload(errorID + 1)} } else { - req = &testpb.SimpleRequest{Id: errorID} + req = &testpb.SimpleRequest{Payload: idToPayload(errorID)} } tCtx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) @@ -290,10 +301,10 @@ func (te *test) doUnaryCall(c *rpcConfig) (*testpb.SimpleRequest, *testpb.Simple return req, resp, err } -func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]*testpb.SimpleRequest, []*testpb.SimpleResponse, error) { +func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]proto.Message, []proto.Message, error) { var ( - reqs []*testpb.SimpleRequest - resps []*testpb.SimpleResponse + reqs []proto.Message + resps []proto.Message err error ) tc := testpb.NewTestServiceClient(te.clientConn()) @@ -308,14 +319,14 @@ func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]*testpb.SimpleRequest startID = errorID } for i := 0; i < c.count; i++ { - req := &testpb.SimpleRequest{ - Id: int32(i) + startID, + req := &testpb.StreamingOutputCallRequest{ + Payload: idToPayload(int32(i) + startID), } reqs = append(reqs, req) if err = stream.Send(req); err != nil { return reqs, resps, err } - var resp *testpb.SimpleResponse + var resp *testpb.StreamingOutputCallResponse if resp, err = stream.Recv(); err != nil { return reqs, resps, err } @@ -331,16 +342,16 @@ func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]*testpb.SimpleRequest return reqs, resps, nil } -func (te *test) doClientStreamCall(c *rpcConfig) ([]*testpb.SimpleRequest, *testpb.SimpleResponse, error) { +func (te *test) doClientStreamCall(c *rpcConfig) ([]proto.Message, *testpb.StreamingInputCallResponse, error) { var ( - reqs []*testpb.SimpleRequest - resp *testpb.SimpleResponse + reqs []proto.Message + resp *testpb.StreamingInputCallResponse err error ) tc := testpb.NewTestServiceClient(te.clientConn()) tCtx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() - stream, err := tc.ClientStreamCall(metadata.NewOutgoingContext(tCtx, testMetadata), grpc.WaitForReady(!c.failfast)) + stream, err := tc.StreamingInputCall(metadata.NewOutgoingContext(tCtx, testMetadata), grpc.WaitForReady(!c.failfast)) if err != nil { return reqs, resp, err } @@ -349,8 +360,8 @@ func (te *test) doClientStreamCall(c *rpcConfig) ([]*testpb.SimpleRequest, *test startID = errorID } for i := 0; i < c.count; i++ { - req := &testpb.SimpleRequest{ - Id: int32(i) + startID, + req := &testpb.StreamingInputCallRequest{ + Payload: idToPayload(int32(i) + startID), } reqs = append(reqs, req) if err = stream.Send(req); err != nil { @@ -361,10 +372,10 @@ func (te *test) doClientStreamCall(c *rpcConfig) ([]*testpb.SimpleRequest, *test return reqs, resp, err } -func (te *test) doServerStreamCall(c *rpcConfig) (*testpb.SimpleRequest, []*testpb.SimpleResponse, error) { +func (te *test) doServerStreamCall(c *rpcConfig) (*testpb.StreamingOutputCallRequest, []proto.Message, error) { var ( - req *testpb.SimpleRequest - resps []*testpb.SimpleResponse + req *testpb.StreamingOutputCallRequest + resps []proto.Message err error ) @@ -374,15 +385,15 @@ func (te *test) doServerStreamCall(c *rpcConfig) (*testpb.SimpleRequest, []*test if !c.success { startID = errorID } - req = &testpb.SimpleRequest{Id: startID} + req = &testpb.StreamingOutputCallRequest{Payload: idToPayload(startID)} tCtx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() - stream, err := tc.ServerStreamCall(metadata.NewOutgoingContext(tCtx, testMetadata), req, grpc.WaitForReady(!c.failfast)) + stream, err := tc.StreamingOutputCall(metadata.NewOutgoingContext(tCtx, testMetadata), req, grpc.WaitForReady(!c.failfast)) if err != nil { return req, resps, err } for { - var resp *testpb.SimpleResponse + var resp *testpb.StreamingOutputCallResponse resp, err := stream.Recv() if err == io.EOF { return req, resps, nil @@ -398,9 +409,9 @@ type expectedData struct { serverAddr string compression string reqIdx int - requests []*testpb.SimpleRequest + requests []proto.Message respIdx int - responses []*testpb.SimpleResponse + responses []proto.Message err error failfast bool } @@ -829,13 +840,13 @@ func testServerStats(t *testing.T, tc *testConfig, cc *rpcConfig, checkFuncs []f defer te.tearDown() var ( - reqs []*testpb.SimpleRequest - resps []*testpb.SimpleResponse + reqs []proto.Message + resps []proto.Message err error method string - req *testpb.SimpleRequest - resp *testpb.SimpleResponse + req proto.Message + resp proto.Message e error ) @@ -843,18 +854,18 @@ func testServerStats(t *testing.T, tc *testConfig, cc *rpcConfig, checkFuncs []f case unaryRPC: method = "/grpc.testing.TestService/UnaryCall" req, resp, e = te.doUnaryCall(cc) - reqs = []*testpb.SimpleRequest{req} - resps = []*testpb.SimpleResponse{resp} + reqs = []proto.Message{req} + resps = []proto.Message{resp} err = e case clientStreamRPC: - method = "/grpc.testing.TestService/ClientStreamCall" + method = "/grpc.testing.TestService/StreamingInputCall" reqs, resp, e = te.doClientStreamCall(cc) - resps = []*testpb.SimpleResponse{resp} + resps = []proto.Message{resp} err = e case serverStreamRPC: - method = "/grpc.testing.TestService/ServerStreamCall" + method = "/grpc.testing.TestService/StreamingOutputCall" req, resps, e = te.doServerStreamCall(cc) - reqs = []*testpb.SimpleRequest{req} + reqs = []proto.Message{req} err = e case fullDuplexStreamRPC: method = "/grpc.testing.TestService/FullDuplexCall" @@ -1120,31 +1131,31 @@ func testClientStats(t *testing.T, tc *testConfig, cc *rpcConfig, checkFuncs map defer te.tearDown() var ( - reqs []*testpb.SimpleRequest - resps []*testpb.SimpleResponse + reqs []proto.Message + resps []proto.Message method string err error - req *testpb.SimpleRequest - resp *testpb.SimpleResponse + req proto.Message + resp proto.Message e error ) switch cc.callType { case unaryRPC: method = "/grpc.testing.TestService/UnaryCall" req, resp, e = te.doUnaryCall(cc) - reqs = []*testpb.SimpleRequest{req} - resps = []*testpb.SimpleResponse{resp} + reqs = []proto.Message{req} + resps = []proto.Message{resp} err = e case clientStreamRPC: - method = "/grpc.testing.TestService/ClientStreamCall" + method = "/grpc.testing.TestService/StreamingInputCall" reqs, resp, e = te.doClientStreamCall(cc) - resps = []*testpb.SimpleResponse{resp} + resps = []proto.Message{resp} err = e case serverStreamRPC: - method = "/grpc.testing.TestService/ServerStreamCall" + method = "/grpc.testing.TestService/StreamingOutputCall" req, resps, e = te.doServerStreamCall(cc) - reqs = []*testpb.SimpleRequest{req} + reqs = []proto.Message{req} err = e case fullDuplexStreamRPC: method = "/grpc.testing.TestService/FullDuplexCall" From 0bd76be2bb6b62dba23cef0454c86e97304ac58a Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 7 Jan 2021 14:53:43 -0800 Subject: [PATCH 06/37] lrs: use JSON for locality's String representation (#4135) --- xds/internal/balancer/edsbalancer/eds_impl.go | 33 ++++++++++---- .../balancer/edsbalancer/eds_impl_test.go | 6 ++- xds/internal/balancer/lrs/balancer.go | 22 +++++---- xds/internal/balancer/lrs/balancer_test.go | 3 +- xds/internal/balancer/lrs/picker.go | 5 +-- xds/internal/internal.go | 31 +++++++------ xds/internal/internal_test.go | 45 +++++++++++++++++++ 7 files changed, 105 insertions(+), 40 deletions(-) diff --git a/xds/internal/balancer/edsbalancer/eds_impl.go b/xds/internal/balancer/edsbalancer/eds_impl.go index a6e950b88eea..17a41ef18e75 100644 --- a/xds/internal/balancer/edsbalancer/eds_impl.go +++ b/xds/internal/balancer/edsbalancer/eds_impl.go @@ -142,12 +142,17 @@ func (edsImpl *edsBalancerImpl) handleChildPolicy(name string, config json.RawMe continue } for lid, config := range bgwc.configs { + lidJSON, err := lid.ToString() + if err != nil { + edsImpl.logger.Errorf("failed to marshal LocalityID: %#v, skipping this locality", lid) + continue + } // TODO: (eds) add support to balancer group to support smoothly // switching sub-balancers (keep old balancer around until new // balancer becomes ready). - bgwc.bg.Remove(lid.String()) - bgwc.bg.Add(lid.String(), edsImpl.subBalancerBuilder) - bgwc.bg.UpdateClientConnState(lid.String(), balancer.ClientConnState{ + bgwc.bg.Remove(lidJSON) + bgwc.bg.Add(lidJSON, edsImpl.subBalancerBuilder) + bgwc.bg.UpdateClientConnState(lidJSON, balancer.ClientConnState{ ResolverState: resolver.State{Addresses: config.addrs}, }) // This doesn't need to manually update picker, because the new @@ -285,6 +290,11 @@ func (edsImpl *edsBalancerImpl) handleEDSResponsePerPriority(bgwc *balancerGroup // One balancer for each locality. lid := locality.ID + lidJSON, err := lid.ToString() + if err != nil { + edsImpl.logger.Errorf("failed to marshal LocalityID: %#v, skipping this locality", lid) + continue + } newLocalitiesSet[lid] = struct{}{} newWeight := locality.Weight @@ -319,8 +329,8 @@ func (edsImpl *edsBalancerImpl) handleEDSResponsePerPriority(bgwc *balancerGroup config, ok := bgwc.configs[lid] if !ok { // A new balancer, add it to balancer group and balancer map. - bgwc.stateAggregator.Add(lid.String(), newWeight) - bgwc.bg.Add(lid.String(), edsImpl.subBalancerBuilder) + bgwc.stateAggregator.Add(lidJSON, newWeight) + bgwc.bg.Add(lidJSON, edsImpl.subBalancerBuilder) config = &localityConfig{ weight: newWeight, } @@ -343,13 +353,13 @@ func (edsImpl *edsBalancerImpl) handleEDSResponsePerPriority(bgwc *balancerGroup if weightChanged { config.weight = newWeight - bgwc.stateAggregator.UpdateWeight(lid.String(), newWeight) + bgwc.stateAggregator.UpdateWeight(lidJSON, newWeight) rebuildStateAndPicker = true } if addrsChanged { config.addrs = newAddrs - bgwc.bg.UpdateClientConnState(lid.String(), balancer.ClientConnState{ + bgwc.bg.UpdateClientConnState(lidJSON, balancer.ClientConnState{ ResolverState: resolver.State{Addresses: newAddrs}, }) } @@ -357,9 +367,14 @@ func (edsImpl *edsBalancerImpl) handleEDSResponsePerPriority(bgwc *balancerGroup // Delete localities that are removed in the latest response. for lid := range bgwc.configs { + lidJSON, err := lid.ToString() + if err != nil { + edsImpl.logger.Errorf("failed to marshal LocalityID: %#v, skipping this locality", lid) + continue + } if _, ok := newLocalitiesSet[lid]; !ok { - bgwc.stateAggregator.Remove(lid.String()) - bgwc.bg.Remove(lid.String()) + bgwc.stateAggregator.Remove(lidJSON) + bgwc.bg.Remove(lidJSON) delete(bgwc.configs, lid) edsImpl.logger.Infof("Locality %v deleted", lid) rebuildStateAndPicker = true diff --git a/xds/internal/balancer/edsbalancer/eds_impl_test.go b/xds/internal/balancer/edsbalancer/eds_impl_test.go index 9f28f252d9b5..2eec6be30f10 100644 --- a/xds/internal/balancer/edsbalancer/eds_impl_test.go +++ b/xds/internal/balancer/edsbalancer/eds_impl_test.go @@ -786,12 +786,14 @@ func (s) TestEDS_LoadReport(t *testing.T) { // We expect the 10 picks to be split between the localities since they are // of equal weight. And since we only mark the picks routed to sc2 as done, // the picks on sc1 should show up as inProgress. + locality1JSON, _ := locality1.ToString() + locality2JSON, _ := locality2.ToString() wantStoreData := []*load.Data{{ Cluster: testClusterNames[0], Service: "", LocalityStats: map[string]load.LocalityData{ - locality1.String(): {RequestStats: load.RequestData{InProgress: 5}}, - locality2.String(): {RequestStats: load.RequestData{Succeeded: 5}}, + locality1JSON: {RequestStats: load.RequestData{InProgress: 5}}, + locality2JSON: {RequestStats: load.RequestData{Succeeded: 5}}, }, }} for i := 0; i < 10; i++ { diff --git a/xds/internal/balancer/lrs/balancer.go b/xds/internal/balancer/lrs/balancer.go index 01bb14662865..d60355afd25e 100644 --- a/xds/internal/balancer/lrs/balancer.go +++ b/xds/internal/balancer/lrs/balancer.go @@ -27,7 +27,6 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/serviceconfig" - "google.golang.org/grpc/xds/internal" xdsclient "google.golang.org/grpc/xds/internal/client" "google.golang.org/grpc/xds/internal/client/load" ) @@ -101,7 +100,12 @@ func (b *lrsBalancer) UpdateClientConnState(s balancer.ClientConnState) error { if b.lb != nil { b.lb.Close() } - b.lb = bb.Build(newCCWrapper(b.cc, b.client.loadStore(), newConfig.Locality), b.buildOpts) + lidJSON, err := newConfig.Locality.ToString() + if err != nil { + return fmt.Errorf("failed to marshal LocalityID: %#v", newConfig.Locality) + } + ccWrapper := newCCWrapper(b.cc, b.client.loadStore(), lidJSON) + b.lb = bb.Build(ccWrapper, b.buildOpts) } b.config = newConfig @@ -134,20 +138,20 @@ func (b *lrsBalancer) Close() { type ccWrapper struct { balancer.ClientConn - loadStore load.PerClusterReporter - localityID *internal.LocalityID + loadStore load.PerClusterReporter + localityIDJSON string } -func newCCWrapper(cc balancer.ClientConn, loadStore load.PerClusterReporter, localityID *internal.LocalityID) *ccWrapper { +func newCCWrapper(cc balancer.ClientConn, loadStore load.PerClusterReporter, localityIDJSON string) *ccWrapper { return &ccWrapper{ - ClientConn: cc, - loadStore: loadStore, - localityID: localityID, + ClientConn: cc, + loadStore: loadStore, + localityIDJSON: localityIDJSON, } } func (ccw *ccWrapper) UpdateState(s balancer.State) { - s.Picker = newLoadReportPicker(s.Picker, *ccw.localityID, ccw.loadStore) + s.Picker = newLoadReportPicker(s.Picker, ccw.localityIDJSON, ccw.loadStore) ccw.ClientConn.UpdateState(s) } diff --git a/xds/internal/balancer/lrs/balancer_test.go b/xds/internal/balancer/lrs/balancer_test.go index 0794a7767214..0b575b112104 100644 --- a/xds/internal/balancer/lrs/balancer_test.go +++ b/xds/internal/balancer/lrs/balancer_test.go @@ -126,7 +126,8 @@ func TestLoadReporting(t *testing.T) { if sd.Cluster != testClusterName || sd.Service != testServiceName { t.Fatalf("got unexpected load for %q, %q, want %q, %q", sd.Cluster, sd.Service, testClusterName, testServiceName) } - localityData, ok := sd.LocalityStats[testLocality.String()] + testLocalityJSON, _ := testLocality.ToString() + localityData, ok := sd.LocalityStats[testLocalityJSON] if !ok { t.Fatalf("loads for %v not found in store", testLocality) } diff --git a/xds/internal/balancer/lrs/picker.go b/xds/internal/balancer/lrs/picker.go index 8ca72b4fe57c..1e4ad156e5b7 100644 --- a/xds/internal/balancer/lrs/picker.go +++ b/xds/internal/balancer/lrs/picker.go @@ -21,7 +21,6 @@ package lrs import ( orcapb "github.com/cncf/udpa/go/udpa/data/orca/v1" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/xds/internal" ) const ( @@ -43,10 +42,10 @@ type loadReportPicker struct { loadStore loadReporter } -func newLoadReportPicker(p balancer.Picker, id internal.LocalityID, loadStore loadReporter) *loadReportPicker { +func newLoadReportPicker(p balancer.Picker, id string, loadStore loadReporter) *loadReportPicker { return &loadReportPicker{ p: p, - locality: id.String(), + locality: id, loadStore: loadStore, } } diff --git a/xds/internal/internal.go b/xds/internal/internal.go index 5c12e6f23d26..e4284ee02e0c 100644 --- a/xds/internal/internal.go +++ b/xds/internal/internal.go @@ -20,8 +20,8 @@ package internal import ( + "encoding/json" "fmt" - "strings" ) // LocalityID is xds.Locality without XXX fields, so it can be used as map @@ -34,23 +34,22 @@ type LocalityID struct { SubZone string `json:"subZone,omitempty"` } -// String generates a string representation of LocalityID by adding ":" between -// the components of the LocalityID. -func (l LocalityID) String() string { - return fmt.Sprintf("%s:%s:%s", l.Region, l.Zone, l.SubZone) +// ToString generates a string representation of LocalityID by marshalling it into +// json. Not calling it String() so printf won't call it. +func (l LocalityID) ToString() (string, error) { + b, err := json.Marshal(l) + if err != nil { + return "", err + } + return string(b), nil } -// LocalityIDFromString converts a string representation of locality, of the -// form region:zone:sub-zone (as generated by the above String() method), into a +// LocalityIDFromString converts a json representation of locality, into a // LocalityID struct. -func LocalityIDFromString(l string) (LocalityID, error) { - parts := strings.Split(l, ":") - if len(parts) != 3 { - return LocalityID{}, fmt.Errorf("%s is not a well formatted locality ID", l) +func LocalityIDFromString(s string) (ret LocalityID, _ error) { + err := json.Unmarshal([]byte(s), &ret) + if err != nil { + return LocalityID{}, fmt.Errorf("%s is not a well formatted locality ID, error: %v", s, err) } - return LocalityID{ - Region: parts[0], - Zone: parts[1], - SubZone: parts[2], - }, nil + return ret, nil } diff --git a/xds/internal/internal_test.go b/xds/internal/internal_test.go index bdd6e85cba97..903b9db23c48 100644 --- a/xds/internal/internal_test.go +++ b/xds/internal/internal_test.go @@ -70,3 +70,48 @@ func (s) TestLocalityMatchProtoMessage(t *testing.T) { t.Fatalf("internal type and proto message have different fields: (-got +want):\n%+v", diff) } } + +func TestLocalityToAndFromJSON(t *testing.T) { + tests := []struct { + name string + localityID LocalityID + str string + wantErr bool + }{ + { + name: "3 fields", + localityID: LocalityID{Region: "r:r", Zone: "z#z", SubZone: "s^s"}, + str: `{"region":"r:r","zone":"z#z","subZone":"s^s"}`, + }, + { + name: "2 fields", + localityID: LocalityID{Region: "r:r", Zone: "z#z"}, + str: `{"region":"r:r","zone":"z#z"}`, + }, + { + name: "1 field", + localityID: LocalityID{Region: "r:r"}, + str: `{"region":"r:r"}`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotStr, err := tt.localityID.ToString() + if err != nil { + t.Errorf("failed to marshal LocalityID: %#v", tt.localityID) + } + if gotStr != tt.str { + t.Errorf("%#v.String() = %q, want %q", tt.localityID, gotStr, tt.str) + } + + gotID, err := LocalityIDFromString(tt.str) + if (err != nil) != tt.wantErr { + t.Errorf("LocalityIDFromString(%q) error = %v, wantErr %v", tt.str, err, tt.wantErr) + return + } + if diff := cmp.Diff(gotID, tt.localityID); diff != "" { + t.Errorf("LocalityIDFromString() got = %v, want %v, diff: %s", gotID, tt.localityID, diff) + } + }) + } +} From 6a318bb011c6613d6f1c98eb0b1b28edfe6b7c0d Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Fri, 8 Jan 2021 10:14:53 -0800 Subject: [PATCH 07/37] xds: add HTTP connection manager max_stream_duration support (#4122) --- xds/internal/client/client.go | 13 ++++- xds/internal/client/client_lds_test.go | 9 ++- xds/internal/client/client_rds_test.go | 10 +++- xds/internal/client/client_xds.go | 20 +++++-- xds/internal/resolver/serviceconfig.go | 10 +++- xds/internal/resolver/watch_service.go | 35 +++++++++-- xds/internal/resolver/watch_service_test.go | 65 +++++++++++++++++++-- xds/internal/resolver/xds_resolver_test.go | 51 +++++++++------- 8 files changed, 166 insertions(+), 47 deletions(-) diff --git a/xds/internal/client/client.go b/xds/internal/client/client.go index 4007a420f484..10c45415a574 100644 --- a/xds/internal/client/client.go +++ b/xds/internal/client/client.go @@ -147,6 +147,10 @@ type ListenerUpdate struct { RouteConfigName string // SecurityCfg contains security configuration sent by the control plane. SecurityCfg *SecurityConfig + // MaxStreamDuration contains the HTTP connection manager's + // common_http_protocol_options.max_stream_duration field, or zero if + // unset. + MaxStreamDuration time.Duration } func (lu *ListenerUpdate) String() string { @@ -181,8 +185,13 @@ type Route struct { Fraction *uint32 // If the matchers above indicate a match, the below configuration is used. - Action map[string]uint32 // action is weighted clusters. - MaxStreamDuration time.Duration + Action map[string]uint32 // action is weighted clusters. + // If MaxStreamDuration is nil, it indicates neither of the route action's + // max_stream_duration fields (grpc_timeout_header_max nor + // max_stream_duration) were set. In this case, the ListenerUpdate's + // MaxStreamDuration field should be used. If MaxStreamDuration is set to + // an explicit zero duration, the application's deadline should be used. + MaxStreamDuration *time.Duration } // HeaderMatcher represents header matchers. diff --git a/xds/internal/client/client_lds_test.go b/xds/internal/client/client_lds_test.go index 09dd2eea4d84..5172def9a82f 100644 --- a/xds/internal/client/client_lds_test.go +++ b/xds/internal/client/client_lds_test.go @@ -21,6 +21,7 @@ package client import ( "strings" "testing" + "time" v2xdspb "github.com/envoyproxy/go-control-plane/envoy/api/v2" v2corepb "github.com/envoyproxy/go-control-plane/envoy/api/v2/core" @@ -37,6 +38,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "google.golang.org/grpc/xds/internal/version" + "google.golang.org/protobuf/types/known/durationpb" ) func (s) TestUnmarshalListener_ClientSide(t *testing.T) { @@ -87,6 +89,9 @@ func (s) TestUnmarshalListener_ClientSide(t *testing.T) { RouteConfigName: v3RouteConfigName, }, }, + CommonHttpProtocolOptions: &v3corepb.HttpProtocolOptions{ + MaxStreamDuration: durationpb.New(time.Second), + }, } mcm, _ := ptypes.MarshalAny(cm) lis := &v3listenerpb.Listener{ @@ -278,7 +283,7 @@ func (s) TestUnmarshalListener_ClientSide(t *testing.T) { name: "v3 listener resource", resources: []*anypb.Any{v3Lis}, wantUpdate: map[string]ListenerUpdate{ - v3LDSTarget: {RouteConfigName: v3RouteConfigName}, + v3LDSTarget: {RouteConfigName: v3RouteConfigName, MaxStreamDuration: time.Second}, }, }, { @@ -286,7 +291,7 @@ func (s) TestUnmarshalListener_ClientSide(t *testing.T) { resources: []*anypb.Any{v2Lis, v3Lis}, wantUpdate: map[string]ListenerUpdate{ v2LDSTarget: {RouteConfigName: v2RouteConfigName}, - v3LDSTarget: {RouteConfigName: v3RouteConfigName}, + v3LDSTarget: {RouteConfigName: v3RouteConfigName, MaxStreamDuration: time.Second}, }, }, } diff --git a/xds/internal/client/client_rds_test.go b/xds/internal/client/client_rds_test.go index 481030fee211..c91444d4bfb6 100644 --- a/xds/internal/client/client_rds_test.go +++ b/xds/internal/client/client_rds_test.go @@ -317,7 +317,7 @@ func (s) TestRDSGenerateRDSUpdateFromRouteConfiguration(t *testing.T) { VirtualHosts: []*VirtualHost{ { Domains: []string{ldsTarget}, - Routes: []*Route{{Prefix: newStringP("/"), Action: map[string]uint32{clusterName: 1}, MaxStreamDuration: time.Second}}, + Routes: []*Route{{Prefix: newStringP("/"), Action: map[string]uint32{clusterName: 1}, MaxStreamDuration: newDurationP(time.Second)}}, }, }, }, @@ -347,7 +347,7 @@ func (s) TestRDSGenerateRDSUpdateFromRouteConfiguration(t *testing.T) { VirtualHosts: []*VirtualHost{ { Domains: []string{ldsTarget}, - Routes: []*Route{{Prefix: newStringP("/"), Action: map[string]uint32{clusterName: 1}, MaxStreamDuration: time.Second}}, + Routes: []*Route{{Prefix: newStringP("/"), Action: map[string]uint32{clusterName: 1}, MaxStreamDuration: newDurationP(time.Second)}}, }, }, }, @@ -377,7 +377,7 @@ func (s) TestRDSGenerateRDSUpdateFromRouteConfiguration(t *testing.T) { VirtualHosts: []*VirtualHost{ { Domains: []string{ldsTarget}, - Routes: []*Route{{Prefix: newStringP("/"), Action: map[string]uint32{clusterName: 1}, MaxStreamDuration: 0}}, + Routes: []*Route{{Prefix: newStringP("/"), Action: map[string]uint32{clusterName: 1}, MaxStreamDuration: newDurationP(0)}}, }, }, }, @@ -803,3 +803,7 @@ func newUInt32P(i uint32) *uint32 { func newBoolP(b bool) *bool { return &b } + +func newDurationP(d time.Duration) *time.Duration { + return &d +} diff --git a/xds/internal/client/client_xds.go b/xds/internal/client/client_xds.go index 68f65c082412..e2a008200a6a 100644 --- a/xds/internal/client/client_xds.go +++ b/xds/internal/client/client_xds.go @@ -80,6 +80,8 @@ func processListener(lis *v3listenerpb.Listener) (*ListenerUpdate, error) { // processClientSideListener checks if the provided Listener proto meets // the expected criteria. If so, it returns a non-empty routeConfigName. func processClientSideListener(lis *v3listenerpb.Listener) (*ListenerUpdate, error) { + update := &ListenerUpdate{} + apiLisAny := lis.GetApiListener().GetApiListener() if !IsHTTPConnManagerResource(apiLisAny.GetTypeUrl()) { return nil, fmt.Errorf("xds: unexpected resource type: %q in LDS response", apiLisAny.GetTypeUrl()) @@ -98,7 +100,7 @@ func processClientSideListener(lis *v3listenerpb.Listener) (*ListenerUpdate, err if name == "" { return nil, fmt.Errorf("xds: empty route_config_name in LDS response: %+v", lis) } - return &ListenerUpdate{RouteConfigName: name}, nil + update.RouteConfigName = name case *v3httppb.HttpConnectionManager_RouteConfig: // TODO: Add support for specifying the RouteConfiguration inline // in the LDS response. @@ -108,6 +110,10 @@ func processClientSideListener(lis *v3listenerpb.Listener) (*ListenerUpdate, err default: return nil, fmt.Errorf("xds: unsupported type %T for RouteSpecifier in received LDS response", apiLis.RouteSpecifier) } + + update.MaxStreamDuration = apiLis.GetCommonHttpProtocolOptions().GetMaxStreamDuration().AsDuration() + + return update, nil } func processServerSideListener(lis *v3listenerpb.Listener) (*ListenerUpdate, error) { @@ -346,12 +352,16 @@ func routesProtoToSlice(routes []*v3routepb.Route, logger *grpclog.PrefixLogger) } route.Action = clusters + msd := action.GetMaxStreamDuration() // Prefer grpc_timeout_header_max, if set. - if dur := msd.GetGrpcTimeoutHeaderMax(); dur != nil { - route.MaxStreamDuration = dur.AsDuration() - } else { - route.MaxStreamDuration = msd.GetMaxStreamDuration().AsDuration() + dur := msd.GetGrpcTimeoutHeaderMax() + if dur == nil { + dur = msd.GetMaxStreamDuration() + } + if dur != nil { + d := dur.AsDuration() + route.MaxStreamDuration = &d } routesRet = append(routesRet, &route) } diff --git a/xds/internal/resolver/serviceconfig.go b/xds/internal/resolver/serviceconfig.go index 13d3f2a095fc..95c3c4221609 100644 --- a/xds/internal/resolver/serviceconfig.go +++ b/xds/internal/resolver/serviceconfig.go @@ -201,11 +201,11 @@ var newWRR = wrr.NewRandom func (r *xdsResolver) newConfigSelector(su serviceUpdate) (*configSelector, error) { cs := &configSelector{ r: r, - routes: make([]route, len(su.Routes)), + routes: make([]route, len(su.routes)), clusters: make(map[string]*clusterInfo), } - for i, rt := range su.Routes { + for i, rt := range su.routes { clusters := newWRR() for cluster, weight := range rt.Action { clusters.Add(cluster, int64(weight)) @@ -227,7 +227,11 @@ func (r *xdsResolver) newConfigSelector(su serviceUpdate) (*configSelector, erro if err != nil { return nil, err } - cs.routes[i].maxStreamDuration = rt.MaxStreamDuration + if rt.MaxStreamDuration == nil { + cs.routes[i].maxStreamDuration = su.ldsConfig.maxStreamDuration + } else { + cs.routes[i].maxStreamDuration = *rt.MaxStreamDuration + } } return cs, nil diff --git a/xds/internal/resolver/watch_service.go b/xds/internal/resolver/watch_service.go index 01aad899e8be..79b83e95aa3c 100644 --- a/xds/internal/resolver/watch_service.go +++ b/xds/internal/resolver/watch_service.go @@ -22,17 +22,28 @@ import ( "fmt" "strings" "sync" + "time" "google.golang.org/grpc/internal/grpclog" xdsclient "google.golang.org/grpc/xds/internal/client" ) -// serviceUpdate contains information received from the RDS responses which is -// of interested to the xds resolver. The RDS request is built by first making a -// LDS to get the RouteConfig name. +// serviceUpdate contains information received from the LDS/RDS responses which +// are of interest to the xds resolver. The RDS request is built by first +// making a LDS to get the RouteConfig name. type serviceUpdate struct { - // Routes contain matchers+actions to route RPCs. - Routes []*xdsclient.Route + // routes contain matchers+actions to route RPCs. + routes []*xdsclient.Route + // ldsConfig contains configuration that applies to all routes. + ldsConfig ldsConfig +} + +// ldsConfig contains information received from the LDS responses which are of +// interest to the xds resolver. +type ldsConfig struct { + // maxStreamDuration is from the HTTP connection manager's + // common_http_protocol_options field. + maxStreamDuration time.Duration } // watchService uses LDS and RDS to discover information about the provided @@ -61,6 +72,7 @@ type serviceUpdateWatcher struct { serviceName string ldsCancel func() serviceCb func(serviceUpdate, error) + lastUpdate serviceUpdate mu sync.Mutex closed bool @@ -84,6 +96,7 @@ func (w *serviceUpdateWatcher) handleLDSResp(update xdsclient.ListenerUpdate, er w.rdsCancel() w.rdsName = "" w.rdsCancel = nil + w.lastUpdate = serviceUpdate{} } // The other error cases still return early without canceling the // existing RDS watch. @@ -91,9 +104,18 @@ func (w *serviceUpdateWatcher) handleLDSResp(update xdsclient.ListenerUpdate, er return } + oldLDSConfig := w.lastUpdate.ldsConfig + w.lastUpdate.ldsConfig = ldsConfig{maxStreamDuration: update.MaxStreamDuration} + if w.rdsName == update.RouteConfigName { // If the new RouteConfigName is same as the previous, don't cancel and // restart the RDS watch. + if w.lastUpdate.ldsConfig != oldLDSConfig { + // The route name didn't change but the LDS data did; send it now. + // If the route name did change, then we will wait until the first + // RDS update before reporting this LDS config. + w.serviceCb(w.lastUpdate, nil) + } return } w.rdsName = update.RouteConfigName @@ -127,7 +149,8 @@ func (w *serviceUpdateWatcher) handleRDSResp(update xdsclient.RouteConfigUpdate, return } - w.serviceCb(serviceUpdate{Routes: matchVh.Routes}, nil) + w.lastUpdate.routes = matchVh.Routes + w.serviceCb(w.lastUpdate, nil) } func (w *serviceUpdateWatcher) close() { diff --git a/xds/internal/resolver/watch_service_test.go b/xds/internal/resolver/watch_service_test.go index 2291d485b8b2..55a20372c018 100644 --- a/xds/internal/resolver/watch_service_test.go +++ b/xds/internal/resolver/watch_service_test.go @@ -22,6 +22,7 @@ import ( "context" "fmt" "testing" + "time" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -138,7 +139,7 @@ func verifyServiceUpdate(ctx context.Context, updateCh *testutils.Channel, wantU return fmt.Errorf("timeout when waiting for service update: %v", err) } gotUpdate := u.(serviceUpdateErr) - if gotUpdate.err != nil || !cmp.Equal(gotUpdate.u, wantUpdate, cmpopts.EquateEmpty()) { + if gotUpdate.err != nil || !cmp.Equal(gotUpdate.u, wantUpdate, cmpopts.EquateEmpty(), cmp.AllowUnexported(serviceUpdate{}, ldsConfig{})) { return fmt.Errorf("unexpected service update: (%v, %v), want: (%v, nil), diff (-want +got):\n%s", gotUpdate.u, gotUpdate.err, wantUpdate, cmp.Diff(gotUpdate.u, wantUpdate, cmpopts.EquateEmpty())) } return nil @@ -165,7 +166,7 @@ func (s) TestServiceWatch(t *testing.T) { xdsC.InvokeWatchListenerCallback(xdsclient.ListenerUpdate{RouteConfigName: routeStr}, nil) waitForWatchRouteConfig(ctx, t, xdsC, routeStr) - wantUpdate := serviceUpdate{Routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster: 1}}}} + wantUpdate := serviceUpdate{routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster: 1}}}} xdsC.InvokeWatchRouteConfigCallback(xdsclient.RouteConfigUpdate{ VirtualHosts: []*xdsclient.VirtualHost{ { @@ -179,7 +180,7 @@ func (s) TestServiceWatch(t *testing.T) { } wantUpdate2 := serviceUpdate{ - Routes: []*xdsclient.Route{{ + routes: []*xdsclient.Route{{ Path: newStringP(""), Action: map[string]uint32{cluster: 1}, }}, @@ -219,7 +220,7 @@ func (s) TestServiceWatchLDSUpdate(t *testing.T) { xdsC.InvokeWatchListenerCallback(xdsclient.ListenerUpdate{RouteConfigName: routeStr}, nil) waitForWatchRouteConfig(ctx, t, xdsC, routeStr) - wantUpdate := serviceUpdate{Routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster: 1}}}} + wantUpdate := serviceUpdate{routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster: 1}}}} xdsC.InvokeWatchRouteConfigCallback(xdsclient.RouteConfigUpdate{ VirtualHosts: []*xdsclient.VirtualHost{ { @@ -240,7 +241,7 @@ func (s) TestServiceWatchLDSUpdate(t *testing.T) { waitForWatchRouteConfig(ctx, t, xdsC, routeStr+"2") // RDS update for the new name. - wantUpdate2 := serviceUpdate{Routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster + "2": 1}}}} + wantUpdate2 := serviceUpdate{routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster + "2": 1}}}} xdsC.InvokeWatchRouteConfigCallback(xdsclient.RouteConfigUpdate{ VirtualHosts: []*xdsclient.VirtualHost{ { @@ -254,6 +255,58 @@ func (s) TestServiceWatchLDSUpdate(t *testing.T) { } } +// TestServiceWatchLDSUpdate covers the case that after first LDS and first RDS +// response, the second LDS response includes a new MaxStreamDuration. It also +// verifies this is reported in subsequent RDS updates. +func (s) TestServiceWatchLDSUpdateMaxStreamDuration(t *testing.T) { + serviceUpdateCh := testutils.NewChannel() + xdsC := fakeclient.NewClient() + cancelWatch := watchService(xdsC, targetStr, func(update serviceUpdate, err error) { + serviceUpdateCh.Send(serviceUpdateErr{u: update, err: err}) + }, nil) + defer cancelWatch() + + ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) + defer cancel() + waitForWatchListener(ctx, t, xdsC, targetStr) + xdsC.InvokeWatchListenerCallback(xdsclient.ListenerUpdate{RouteConfigName: routeStr, MaxStreamDuration: time.Second}, nil) + waitForWatchRouteConfig(ctx, t, xdsC, routeStr) + + wantUpdate := serviceUpdate{routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster: 1}}}, ldsConfig: ldsConfig{maxStreamDuration: time.Second}} + xdsC.InvokeWatchRouteConfigCallback(xdsclient.RouteConfigUpdate{ + VirtualHosts: []*xdsclient.VirtualHost{ + { + Domains: []string{targetStr}, + Routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster: 1}}}, + }, + }, + }, nil) + if err := verifyServiceUpdate(ctx, serviceUpdateCh, wantUpdate); err != nil { + t.Fatal(err) + } + + // Another LDS update with the same RDS_name but different MaxStreamDuration (zero in this case). + wantUpdate2 := serviceUpdate{routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster: 1}}}} + xdsC.InvokeWatchListenerCallback(xdsclient.ListenerUpdate{RouteConfigName: routeStr}, nil) + if err := verifyServiceUpdate(ctx, serviceUpdateCh, wantUpdate2); err != nil { + t.Fatal(err) + } + + // RDS update. + wantUpdate3 := serviceUpdate{routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster + "2": 1}}}} + xdsC.InvokeWatchRouteConfigCallback(xdsclient.RouteConfigUpdate{ + VirtualHosts: []*xdsclient.VirtualHost{ + { + Domains: []string{targetStr}, + Routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster + "2": 1}}}, + }, + }, + }, nil) + if err := verifyServiceUpdate(ctx, serviceUpdateCh, wantUpdate3); err != nil { + t.Fatal(err) + } +} + // TestServiceNotCancelRDSOnSameLDSUpdate covers the case that if the second LDS // update contains the same RDS name as the previous, the RDS watch isn't // canceled and restarted. @@ -271,7 +324,7 @@ func (s) TestServiceNotCancelRDSOnSameLDSUpdate(t *testing.T) { xdsC.InvokeWatchListenerCallback(xdsclient.ListenerUpdate{RouteConfigName: routeStr}, nil) waitForWatchRouteConfig(ctx, t, xdsC, routeStr) - wantUpdate := serviceUpdate{Routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster: 1}}}} + wantUpdate := serviceUpdate{routes: []*xdsclient.Route{{Prefix: newStringP(""), Action: map[string]uint32{cluster: 1}}}} xdsC.InvokeWatchRouteConfigCallback(xdsclient.RouteConfigUpdate{ VirtualHosts: []*xdsclient.VirtualHost{ { diff --git a/xds/internal/resolver/xds_resolver_test.go b/xds/internal/resolver/xds_resolver_test.go index a3c0f2866353..13f17e513df0 100644 --- a/xds/internal/resolver/xds_resolver_test.go +++ b/xds/internal/resolver/xds_resolver_test.go @@ -511,7 +511,7 @@ func (s) TestXDSResolverMaxStreamDuration(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() waitForWatchListener(ctx, t, xdsC, targetStr) - xdsC.InvokeWatchListenerCallback(xdsclient.ListenerUpdate{RouteConfigName: routeStr}, nil) + xdsC.InvokeWatchListenerCallback(xdsclient.ListenerUpdate{RouteConfigName: routeStr, MaxStreamDuration: time.Second}, nil) waitForWatchRouteConfig(ctx, t, xdsC, routeStr) defer func(oldNewWRR func() wrr.WRR) { newWRR = oldNewWRR }(newWRR) @@ -526,11 +526,11 @@ func (s) TestXDSResolverMaxStreamDuration(t *testing.T) { Routes: []*client.Route{{ Prefix: newStringP("/foo"), Action: map[string]uint32{"A": 1}, - MaxStreamDuration: 5 * time.Second, + MaxStreamDuration: newDurationP(5 * time.Second), }, { Prefix: newStringP("/bar"), Action: map[string]uint32{"B": 1}, - MaxStreamDuration: time.Duration(0), + MaxStreamDuration: newDurationP(0), }, { Prefix: newStringP(""), Action: map[string]uint32{"C": 1}, @@ -554,43 +554,50 @@ func (s) TestXDSResolverMaxStreamDuration(t *testing.T) { } testCases := []struct { + name string method string timeoutSupport bool want *time.Duration }{{ + name: "RDS setting", method: "/foo/method", timeoutSupport: true, - want: func() *time.Duration { x := 5 * time.Second; return &x }(), + want: newDurationP(5 * time.Second), }, { + name: "timeout support disabled", method: "/foo/method", timeoutSupport: false, want: nil, }, { + name: "explicit zero in RDS; ignore LDS", method: "/bar/method", timeoutSupport: true, want: nil, }, { + name: "no config in RDS; fallback to LDS", method: "/baz/method", timeoutSupport: true, - want: nil, + want: newDurationP(time.Second), }} for _, tc := range testCases { - env.TimeoutSupport = tc.timeoutSupport - req := iresolver.RPCInfo{ - Method: tc.method, - Context: context.Background(), - } - res, err := cs.SelectConfig(req) - if err != nil { - t.Errorf("Unexpected error from cs.SelectConfig(%v): %v", req, err) - continue - } - res.OnCommitted() - got := res.MethodConfig.Timeout - if !reflect.DeepEqual(got, tc.want) { - t.Errorf("For method %q: res.MethodConfig.Timeout = %v; want %v", tc.method, got, tc.want) - } + t.Run(tc.name, func(t *testing.T) { + env.TimeoutSupport = tc.timeoutSupport + req := iresolver.RPCInfo{ + Method: tc.method, + Context: context.Background(), + } + res, err := cs.SelectConfig(req) + if err != nil { + t.Errorf("Unexpected error from cs.SelectConfig(%v): %v", req, err) + return + } + res.OnCommitted() + got := res.MethodConfig.Timeout + if !reflect.DeepEqual(got, tc.want) { + t.Errorf("For method %q: res.MethodConfig.Timeout = %v; want %v", tc.method, got, tc.want) + } + }) } } @@ -856,3 +863,7 @@ func replaceRandNumGenerator(start int64) func() { grpcrandInt63n = grpcrand.Int63n } } + +func newDurationP(d time.Duration) *time.Duration { + return &d +} From 85e55dc558e1ad7f7d4d165480b47bf6efd3c6ff Mon Sep 17 00:00:00 2001 From: Garrett Gutierrez Date: Fri, 8 Jan 2021 16:09:17 -0800 Subject: [PATCH 08/37] interop: update client for xds testing support (#4108) --- interop/xds/client/client.go | 156 ++++++++++++++++++++++++++++++----- 1 file changed, 135 insertions(+), 21 deletions(-) diff --git a/interop/xds/client/client.go b/interop/xds/client/client.go index b119bcd2b865..7afdb20e8d72 100644 --- a/interop/xds/client/client.go +++ b/interop/xds/client/client.go @@ -38,6 +38,10 @@ import ( _ "google.golang.org/grpc/xds" ) +func init() { + rpcCfgs.Store([]*rpcConfig{{typ: unaryCall}}) +} + type statsWatcherKey struct { startID int32 endID int32 @@ -73,21 +77,84 @@ func (watcher *statsWatcher) buildResp() *testpb.LoadBalancerStatsResponse { } } +type accumulatedStats struct { + mu sync.Mutex + numRpcsStartedByMethod map[string]int32 + numRpcsSucceededByMethod map[string]int32 + numRpcsFailedByMethod map[string]int32 +} + +// copyStatsMap makes a copy of the map, and also replaces the RPC type string +// to the proto string. E.g. "UnaryCall" -> "UNARY_CALL". +func copyStatsMap(originalMap map[string]int32) (newMap map[string]int32) { + newMap = make(map[string]int32) + for k, v := range originalMap { + var kk string + switch k { + case unaryCall: + kk = testpb.ClientConfigureRequest_UNARY_CALL.String() + case emptyCall: + kk = testpb.ClientConfigureRequest_EMPTY_CALL.String() + default: + logger.Warningf("unrecognized rpc type: %s", k) + } + if kk == "" { + continue + } + newMap[kk] = v + } + return newMap +} + +func (as *accumulatedStats) buildResp() *testpb.LoadBalancerAccumulatedStatsResponse { + as.mu.Lock() + defer as.mu.Unlock() + return &testpb.LoadBalancerAccumulatedStatsResponse{ + NumRpcsStartedByMethod: copyStatsMap(as.numRpcsStartedByMethod), + NumRpcsSucceededByMethod: copyStatsMap(as.numRpcsSucceededByMethod), + NumRpcsFailedByMethod: copyStatsMap(as.numRpcsFailedByMethod), + } +} + +func (as *accumulatedStats) startRPC(rpcType string) { + as.mu.Lock() + defer as.mu.Unlock() + as.numRpcsStartedByMethod[rpcType]++ +} + +func (as *accumulatedStats) finishRPC(rpcType string, failed bool) { + as.mu.Lock() + defer as.mu.Unlock() + if failed { + as.numRpcsFailedByMethod[rpcType]++ + return + } + as.numRpcsSucceededByMethod[rpcType]++ +} + var ( failOnFailedRPC = flag.Bool("fail_on_failed_rpc", false, "Fail client if any RPCs fail after first success") numChannels = flag.Int("num_channels", 1, "Num of channels") printResponse = flag.Bool("print_response", false, "Write RPC response to stdout") qps = flag.Int("qps", 1, "QPS per channel, for each type of RPC") - rpc = flag.String("rpc", "UnaryCall", "Types of RPCs to make, ',' separated string. RPCs can be EmptyCall or UnaryCall") - rpcMetadata = flag.String("metadata", "", "The metadata to send with RPC, in format EmptyCall:key1:value1,UnaryCall:key2:value2") + rpc = flag.String("rpc", "UnaryCall", "Types of RPCs to make, ',' separated string. RPCs can be EmptyCall or UnaryCall. Deprecated: Use Configure RPC to XdsUpdateClientConfigureServiceServer instead.") + rpcMetadata = flag.String("metadata", "", "The metadata to send with RPC, in format EmptyCall:key1:value1,UnaryCall:key2:value2. Deprecated: Use Configure RPC to XdsUpdateClientConfigureServiceServer instead.") rpcTimeout = flag.Duration("rpc_timeout", 20*time.Second, "Per RPC timeout") server = flag.String("server", "localhost:8080", "Address of server to connect to") statsPort = flag.Int("stats_port", 8081, "Port to expose peer distribution stats service") + rpcCfgs atomic.Value + mu sync.Mutex currentRequestID int32 watchers = make(map[statsWatcherKey]*statsWatcher) + accStats = accumulatedStats{ + numRpcsStartedByMethod: make(map[string]int32), + numRpcsSucceededByMethod: make(map[string]int32), + numRpcsFailedByMethod: make(map[string]int32), + } + // 0 or 1 representing an RPC has succeeded. Use hasRPCSucceeded and // setRPCSucceeded to access in a safe manner. rpcSucceeded uint32 @@ -163,6 +230,47 @@ func (s *statsService) GetClientStats(ctx context.Context, in *testpb.LoadBalanc } } +func (s *statsService) GetClientAccumulatedStats(ctx context.Context, in *testpb.LoadBalancerAccumulatedStatsRequest) (*testpb.LoadBalancerAccumulatedStatsResponse, error) { + return accStats.buildResp(), nil +} + +type configureService struct { + testpb.UnimplementedXdsUpdateClientConfigureServiceServer +} + +func (s *configureService) Configure(ctx context.Context, in *testpb.ClientConfigureRequest) (*testpb.ClientConfigureResponse, error) { + rpcsToMD := make(map[testpb.ClientConfigureRequest_RpcType][]string) + for _, typ := range in.GetTypes() { + rpcsToMD[typ] = nil + } + for _, md := range in.GetMetadata() { + typ := md.GetType() + strs, ok := rpcsToMD[typ] + if !ok { + continue + } + rpcsToMD[typ] = append(strs, md.GetKey(), md.GetValue()) + } + cfgs := make([]*rpcConfig, 0, len(rpcsToMD)) + for typ, md := range rpcsToMD { + var rpcType string + switch typ { + case testpb.ClientConfigureRequest_UNARY_CALL: + rpcType = unaryCall + case testpb.ClientConfigureRequest_EMPTY_CALL: + rpcType = emptyCall + default: + return nil, fmt.Errorf("unsupported RPC type: %v", typ) + } + cfgs = append(cfgs, &rpcConfig{ + typ: rpcType, + md: metadata.Pairs(md...), + }) + } + rpcCfgs.Store(cfgs) + return &testpb.ClientConfigureResponse{}, nil +} + const ( unaryCall string = "UnaryCall" emptyCall string = "EmptyCall" @@ -218,7 +326,7 @@ func parseRPCMetadata(rpcMetadataStr string, rpcs []string) []*rpcConfig { func main() { flag.Parse() - rpcCfgs := parseRPCMetadata(*rpcMetadata, parseRPCTypes(*rpc)) + rpcCfgs.Store(parseRPCMetadata(*rpcMetadata, parseRPCTypes(*rpc))) lis, err := net.Listen("tcp", fmt.Sprintf(":%d", *statsPort)) if err != nil { @@ -227,6 +335,7 @@ func main() { s := grpc.NewServer() defer s.Stop() testpb.RegisterLoadBalancerStatsServiceServer(s, &statsService{}) + testpb.RegisterXdsUpdateClientConfigureServiceServer(s, &configureService{}) go s.Serve(lis) clients := make([]testpb.TestServiceClient, *numChannels) @@ -240,7 +349,7 @@ func main() { } ticker := time.NewTicker(time.Second / time.Duration(*qps**numChannels)) defer ticker.Stop() - sendRPCs(clients, rpcCfgs, ticker) + sendRPCs(clients, ticker) } func makeOneRPC(c testpb.TestServiceClient, cfg *rpcConfig) (*peer.Peer, *rpcInfo, error) { @@ -257,6 +366,7 @@ func makeOneRPC(c testpb.TestServiceClient, cfg *rpcConfig) (*peer.Peer, *rpcInf header metadata.MD err error ) + accStats.startRPC(cfg.typ) switch cfg.typ { case unaryCall: var resp *testpb.SimpleResponse @@ -270,8 +380,10 @@ func makeOneRPC(c testpb.TestServiceClient, cfg *rpcConfig) (*peer.Peer, *rpcInf _, err = c.EmptyCall(ctx, &testpb.Empty{}, grpc.Peer(&p), grpc.Header(&header)) } if err != nil { + accStats.finishRPC(cfg.typ, true) return nil, nil, err } + accStats.finishRPC(cfg.typ, false) hosts := header["hostname"] if len(hosts) > 0 { @@ -280,26 +392,28 @@ func makeOneRPC(c testpb.TestServiceClient, cfg *rpcConfig) (*peer.Peer, *rpcInf return &p, &info, err } -func sendRPCs(clients []testpb.TestServiceClient, cfgs []*rpcConfig, ticker *time.Ticker) { +func sendRPCs(clients []testpb.TestServiceClient, ticker *time.Ticker) { var i int for range ticker.C { - go func(i int) { - // Get and increment request ID, and save a list of watchers that - // are interested in this RPC. - mu.Lock() - savedRequestID := currentRequestID - currentRequestID++ - savedWatchers := []*statsWatcher{} - for key, value := range watchers { - if key.startID <= savedRequestID && savedRequestID < key.endID { - savedWatchers = append(savedWatchers, value) - } + // Get and increment request ID, and save a list of watchers that are + // interested in this RPC. + mu.Lock() + savedRequestID := currentRequestID + currentRequestID++ + savedWatchers := []*statsWatcher{} + for key, value := range watchers { + if key.startID <= savedRequestID && savedRequestID < key.endID { + savedWatchers = append(savedWatchers, value) } - mu.Unlock() + } + mu.Unlock() - c := clients[i] + // Get the RPC metadata configurations from the Configure RPC. + cfgs := rpcCfgs.Load().([]*rpcConfig) - for _, cfg := range cfgs { + c := clients[i] + for _, cfg := range cfgs { + go func(cfg *rpcConfig) { p, info, err := makeOneRPC(c, cfg) for _, watcher := range savedWatchers { @@ -325,8 +439,8 @@ func sendRPCs(clients []testpb.TestServiceClient, cfgs []*rpcConfig, ticker *tim fmt.Printf("RPC %q, failed with %v\n", cfg.typ, err) } } - } - }(i) + }(cfg) + } i = (i + 1) % len(clients) } } From 083393f287fe61b048da16074ca39bd93cd5e6bc Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Fri, 8 Jan 2021 16:47:46 -0800 Subject: [PATCH 09/37] xds/resolver: fix resource deletion (#4143) --- xds/internal/resolver/serviceconfig.go | 23 +-- xds/internal/resolver/xds_resolver.go | 102 +++++++----- xds/internal/resolver/xds_resolver_test.go | 172 +++++++++++++++++++++ 3 files changed, 247 insertions(+), 50 deletions(-) diff --git a/xds/internal/resolver/serviceconfig.go b/xds/internal/resolver/serviceconfig.go index 95c3c4221609..d61a546a04e2 100644 --- a/xds/internal/resolver/serviceconfig.go +++ b/xds/internal/resolver/serviceconfig.go @@ -113,6 +113,9 @@ type configSelector struct { var errNoMatchedRouteFound = status.Errorf(codes.Unavailable, "no matched route was found") func (cs *configSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*iresolver.RPCConfig, error) { + if cs == nil { + return nil, status.Errorf(codes.Unavailable, "no valid clusters") + } var rt *route // Loop through routes in order and select first match. for _, r := range cs.routes { @@ -157,17 +160,8 @@ func (cs *configSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*iresolver.RP return config, nil } -// incRefs increments refs of all clusters referenced by this config selector. -func (cs *configSelector) incRefs() { - // Loops over cs.clusters, but these are pointers to entries in - // activeClusters. - for _, ci := range cs.clusters { - atomic.AddInt32(&ci.refCount, 1) - } -} - -// decRefs decrements refs of all clusters referenced by this config selector. -func (cs *configSelector) decRefs() { +// stop decrements refs of all clusters referenced by this config selector. +func (cs *configSelector) stop() { // The resolver's old configSelector may be nil. Handle that here. if cs == nil { return @@ -234,6 +228,13 @@ func (r *xdsResolver) newConfigSelector(su serviceUpdate) (*configSelector, erro } } + // Account for this config selector's clusters. Do this after no further + // errors may occur. Note: cs.clusters are pointers to entries in + // activeClusters. + for _, ci := range cs.clusters { + atomic.AddInt32(&ci.refCount, 1) + } + return cs, nil } diff --git a/xds/internal/resolver/xds_resolver.go b/xds/internal/resolver/xds_resolver.go index a99403edcfa9..b40e115299a4 100644 --- a/xds/internal/resolver/xds_resolver.go +++ b/xds/internal/resolver/xds_resolver.go @@ -144,6 +144,43 @@ type xdsResolver struct { curConfigSelector *configSelector } +// sendNewServiceConfig prunes active clusters, generates a new service config +// based on the current set of active clusters, and sends an update to the +// channel with that service config and the provided config selector. Returns +// false if an error occurs while generating the service config and the update +// cannot be sent. +func (r *xdsResolver) sendNewServiceConfig(cs *configSelector) bool { + // Delete entries from r.activeClusters with zero references; + // otherwise serviceConfigJSON will generate a config including + // them. + r.pruneActiveClusters() + + if cs == nil && len(r.activeClusters) == 0 { + // There are no clusters and we are sending a failing configSelector. + // Send an empty config, which picks pick-first, with no address, and + // puts the ClientConn into transient failure. + r.cc.UpdateState(resolver.State{ServiceConfig: r.cc.ParseServiceConfig("{}")}) + return true + } + + // Produce the service config. + sc, err := serviceConfigJSON(r.activeClusters) + if err != nil { + // JSON marshal error; should never happen. + r.logger.Errorf("%v", err) + r.cc.ReportError(err) + return false + } + r.logger.Infof("Received update on resource %v from xds-client %p, generated service config: %v", r.target.Endpoint, r.client, sc) + + // Send the update to the ClientConn. + state := iresolver.SetConfigSelector(resolver.State{ + ServiceConfig: r.cc.ParseServiceConfig(sc), + }, cs) + r.cc.UpdateState(state) + return true +} + // run is a long running goroutine which blocks on receiving service updates // and passes it on the ClientConn. func (r *xdsResolver) run() { @@ -155,15 +192,15 @@ func (r *xdsResolver) run() { if update.err != nil { r.logger.Warningf("Watch error on resource %v from xds-client %p, %v", r.target.Endpoint, r.client, update.err) if xdsclient.ErrType(update.err) == xdsclient.ErrorTypeResourceNotFound { - // If error is resource-not-found, it means the LDS resource - // was removed. Send an empty service config, which picks - // pick-first, with no address, and puts the ClientConn into - // transient failure.. - r.cc.UpdateState(resolver.State{ - ServiceConfig: r.cc.ParseServiceConfig("{}"), - }) - // Dereference the active config selector, if one exists. - r.curConfigSelector.decRefs() + // If error is resource-not-found, it means the LDS + // resource was removed. Ultimately send an empty service + // config, which picks pick-first, with no address, and + // puts the ClientConn into transient failure. Before we + // can do that, we may need to send a normal service config + // along with an erroring (nil) config selector. + r.sendNewServiceConfig(nil) + // Stop and dereference the active config selector, if one exists. + r.curConfigSelector.stop() r.curConfigSelector = nil continue } @@ -173,43 +210,30 @@ func (r *xdsResolver) run() { r.cc.ReportError(update.err) continue } - var cs *configSelector - if !update.emptyUpdate { - // Create the config selector for this update. - var err error - if cs, err = r.newConfigSelector(update.su); err != nil { - r.logger.Warningf("Error parsing update on resource %v from xds-client %p: %v", r.target.Endpoint, r.client, err) - r.cc.ReportError(err) - continue - } - } else { - // Empty update; use the existing config selector. - cs = r.curConfigSelector + if update.emptyUpdate { + r.sendNewServiceConfig(r.curConfigSelector) + continue } - // Account for this config selector's clusters. - cs.incRefs() - // Delete entries from r.activeClusters with zero references; - // otherwise serviceConfigJSON will generate a config including - // them. - r.pruneActiveClusters() - // Produce the service config. - sc, err := serviceConfigJSON(r.activeClusters) + + // Create the config selector for this update. + cs, err := r.newConfigSelector(update.su) if err != nil { - // JSON marshal error; should never happen. - r.logger.Errorf("%v", err) + r.logger.Warningf("Error parsing update on resource %v from xds-client %p: %v", r.target.Endpoint, r.client, err) r.cc.ReportError(err) - cs.decRefs() continue } - r.logger.Infof("Received update on resource %v from xds-client %p, generated service config: %v", r.target.Endpoint, r.client, sc) - // Send the update to the ClientConn. - state := iresolver.SetConfigSelector(resolver.State{ - ServiceConfig: r.cc.ParseServiceConfig(sc), - }, cs) - r.cc.UpdateState(state) + + if !r.sendNewServiceConfig(cs) { + // JSON error creating the service config (unexpected); erase + // this config selector and ignore this update, continuing with + // the previous config selector. + cs.stop() + continue + } + // Decrement references to the old config selector and assign the // new one as the current one. - r.curConfigSelector.decRefs() + r.curConfigSelector.stop() r.curConfigSelector = cs } } diff --git a/xds/internal/resolver/xds_resolver_test.go b/xds/internal/resolver/xds_resolver_test.go index 13f17e513df0..218a7a610913 100644 --- a/xds/internal/resolver/xds_resolver_test.go +++ b/xds/internal/resolver/xds_resolver_test.go @@ -26,6 +26,7 @@ import ( "time" "github.com/google/go-cmp/cmp" + "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials/insecure" xdscreds "google.golang.org/grpc/credentials/xds" "google.golang.org/grpc/internal" @@ -36,6 +37,7 @@ import ( "google.golang.org/grpc/internal/wrr" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" + "google.golang.org/grpc/status" _ "google.golang.org/grpc/xds/internal/balancer/cdsbalancer" // To parse LB config "google.golang.org/grpc/xds/internal/balancer/clustermanager" "google.golang.org/grpc/xds/internal/client" @@ -435,6 +437,176 @@ func (s) TestXDSResolverGoodServiceUpdate(t *testing.T) { } } +// TestXDSResolverRemovedWithRPCs tests the case where a config selector sends +// an empty update to the resolver after the resource is removed. +func (s) TestXDSResolverRemovedWithRPCs(t *testing.T) { + xdsC := fakeclient.NewClient() + xdsR, tcc, cancel := testSetup(t, setupOpts{ + xdsClientFunc: func() (xdsClientInterface, error) { return xdsC, nil }, + }) + defer cancel() + defer xdsR.Close() + + ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) + defer cancel() + waitForWatchListener(ctx, t, xdsC, targetStr) + xdsC.InvokeWatchListenerCallback(xdsclient.ListenerUpdate{RouteConfigName: routeStr}, nil) + waitForWatchRouteConfig(ctx, t, xdsC, routeStr) + + // Invoke the watchAPI callback with a good service update and wait for the + // UpdateState method to be called on the ClientConn. + xdsC.InvokeWatchRouteConfigCallback(xdsclient.RouteConfigUpdate{ + VirtualHosts: []*xdsclient.VirtualHost{ + { + Domains: []string{targetStr}, + Routes: []*client.Route{{Prefix: newStringP(""), Action: map[string]uint32{"test-cluster-1": 1}}}, + }, + }, + }, nil) + + gotState, err := tcc.stateCh.Receive(ctx) + if err != nil { + t.Fatalf("ClientConn.UpdateState returned error: %v", err) + } + rState := gotState.(resolver.State) + if err := rState.ServiceConfig.Err; err != nil { + t.Fatalf("ClientConn.UpdateState received error in service config: %v", rState.ServiceConfig.Err) + } + + // "Make an RPC" by invoking the config selector. + cs := iresolver.GetConfigSelector(rState) + if cs == nil { + t.Fatalf("received nil config selector") + } + + res, err := cs.SelectConfig(iresolver.RPCInfo{Context: context.Background()}) + if err != nil { + t.Fatalf("Unexpected error from cs.SelectConfig(_): %v", err) + } + + // Delete the resource + suErr := xdsclient.NewErrorf(xdsclient.ErrorTypeResourceNotFound, "resource removed error") + xdsC.InvokeWatchRouteConfigCallback(xdsclient.RouteConfigUpdate{}, suErr) + + if _, err = tcc.stateCh.Receive(ctx); err != nil { + t.Fatalf("ClientConn.UpdateState returned error: %v", err) + } + + // "Finish the RPC"; this could cause a panic if the resolver doesn't + // handle it correctly. + res.OnCommitted() +} + +// TestXDSResolverRemovedResource tests for proper behavior after a resource is +// removed. +func (s) TestXDSResolverRemovedResource(t *testing.T) { + xdsC := fakeclient.NewClient() + xdsR, tcc, cancel := testSetup(t, setupOpts{ + xdsClientFunc: func() (xdsClientInterface, error) { return xdsC, nil }, + }) + defer cancel() + defer xdsR.Close() + + ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) + defer cancel() + waitForWatchListener(ctx, t, xdsC, targetStr) + xdsC.InvokeWatchListenerCallback(xdsclient.ListenerUpdate{RouteConfigName: routeStr}, nil) + waitForWatchRouteConfig(ctx, t, xdsC, routeStr) + + // Invoke the watchAPI callback with a good service update and wait for the + // UpdateState method to be called on the ClientConn. + xdsC.InvokeWatchRouteConfigCallback(xdsclient.RouteConfigUpdate{ + VirtualHosts: []*xdsclient.VirtualHost{ + { + Domains: []string{targetStr}, + Routes: []*client.Route{{Prefix: newStringP(""), Action: map[string]uint32{"test-cluster-1": 1}}}, + }, + }, + }, nil) + wantJSON := `{"loadBalancingConfig":[{ + "xds_cluster_manager_experimental":{ + "children":{ + "test-cluster-1":{ + "childPolicy":[{"cds_experimental":{"cluster":"test-cluster-1"}}] + } + } + }}]}` + wantSCParsed := internal.ParseServiceConfigForTesting.(func(string) *serviceconfig.ParseResult)(wantJSON) + + gotState, err := tcc.stateCh.Receive(ctx) + if err != nil { + t.Fatalf("ClientConn.UpdateState returned error: %v", err) + } + rState := gotState.(resolver.State) + if err := rState.ServiceConfig.Err; err != nil { + t.Fatalf("ClientConn.UpdateState received error in service config: %v", rState.ServiceConfig.Err) + } + if !internal.EqualServiceConfigForTesting(rState.ServiceConfig.Config, wantSCParsed.Config) { + t.Errorf("ClientConn.UpdateState received different service config") + t.Error("got: ", cmp.Diff(nil, rState.ServiceConfig.Config)) + t.Error("want: ", cmp.Diff(nil, wantSCParsed.Config)) + } + + // "Make an RPC" by invoking the config selector. + cs := iresolver.GetConfigSelector(rState) + if cs == nil { + t.Fatalf("received nil config selector") + } + + res, err := cs.SelectConfig(iresolver.RPCInfo{Context: context.Background()}) + if err != nil { + t.Fatalf("Unexpected error from cs.SelectConfig(_): %v", err) + } + + // "Finish the RPC"; this could cause a panic if the resolver doesn't + // handle it correctly. + res.OnCommitted() + + // Delete the resource. The channel should receive a service config with the + // original cluster but with an erroring config selector. + suErr := xdsclient.NewErrorf(xdsclient.ErrorTypeResourceNotFound, "resource removed error") + xdsC.InvokeWatchRouteConfigCallback(xdsclient.RouteConfigUpdate{}, suErr) + + if gotState, err = tcc.stateCh.Receive(ctx); err != nil { + t.Fatalf("ClientConn.UpdateState returned error: %v", err) + } + rState = gotState.(resolver.State) + if err := rState.ServiceConfig.Err; err != nil { + t.Fatalf("ClientConn.UpdateState received error in service config: %v", rState.ServiceConfig.Err) + } + if !internal.EqualServiceConfigForTesting(rState.ServiceConfig.Config, wantSCParsed.Config) { + t.Errorf("ClientConn.UpdateState received different service config") + t.Error("got: ", cmp.Diff(nil, rState.ServiceConfig.Config)) + t.Error("want: ", cmp.Diff(nil, wantSCParsed.Config)) + } + + // "Make another RPC" by invoking the config selector. + cs = iresolver.GetConfigSelector(rState) + if cs == nil { + t.Fatalf("received nil config selector") + } + + res, err = cs.SelectConfig(iresolver.RPCInfo{Context: context.Background()}) + if err == nil || status.Code(err) != codes.Unavailable { + t.Fatalf("Expected UNAVAILABLE error from cs.SelectConfig(_); got %v, %v", res, err) + } + + // In the meantime, an empty ServiceConfig update should have been sent. + if gotState, err = tcc.stateCh.Receive(ctx); err != nil { + t.Fatalf("ClientConn.UpdateState returned error: %v", err) + } + rState = gotState.(resolver.State) + if err := rState.ServiceConfig.Err; err != nil { + t.Fatalf("ClientConn.UpdateState received error in service config: %v", rState.ServiceConfig.Err) + } + wantSCParsed = internal.ParseServiceConfigForTesting.(func(string) *serviceconfig.ParseResult)("{}") + if !internal.EqualServiceConfigForTesting(rState.ServiceConfig.Config, wantSCParsed.Config) { + t.Errorf("ClientConn.UpdateState received different service config") + t.Error("got: ", cmp.Diff(nil, rState.ServiceConfig.Config)) + t.Error("want: ", cmp.Diff(nil, wantSCParsed.Config)) + } +} + func (s) TestXDSResolverWRR(t *testing.T) { xdsC := fakeclient.NewClient() xdsR, tcc, cancel := testSetup(t, setupOpts{ From fb40d83340e8c3830cc4907c00a1d8a003c6902c Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Fri, 8 Jan 2021 17:16:38 -0800 Subject: [PATCH 10/37] xds interop: turn on circuit breaking test (#4144) Also need to set server image to version 3, so that the server blocks the pending RPCs --- test/kokoro/xds.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/kokoro/xds.sh b/test/kokoro/xds.sh index 23c9d0119425..565d55aa116c 100755 --- a/test/kokoro/xds.sh +++ b/test/kokoro/xds.sh @@ -27,9 +27,9 @@ grpc/tools/run_tests/helper_scripts/prep_xds.sh # they are added into "all". GRPC_GO_LOG_VERBOSITY_LEVEL=99 GRPC_GO_LOG_SEVERITY_LEVEL=info \ python3 grpc/tools/run_tests/run_xds_tests.py \ - --test_case="all,path_matching,header_matching" \ + --test_case="all,path_matching,header_matching,circuit_breaking" \ --project_id=grpc-testing \ - --source_image=projects/grpc-testing/global/images/xds-test-server-2 \ + --source_image=projects/grpc-testing/global/images/xds-test-server-3 \ --path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \ --gcp_suffix=$(date '+%s') \ --verbose \ From 4cf4a98505bcdfb27ea2a5427b6e5a2d143dd060 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Mon, 11 Jan 2021 10:09:13 -0800 Subject: [PATCH 11/37] Change version to 1.36.0-dev (#4142) --- version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.go b/version.go index 1e75a5c7954f..1b9f3715952d 100644 --- a/version.go +++ b/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.35.0-dev" +const Version = "1.36.0-dev" From d3ae124a07fcb3eeddc18d84c5df3e82e182380c Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Tue, 12 Jan 2021 12:23:41 -0800 Subject: [PATCH 12/37] cleanup: use different import alias for services than messages (#4148) --- benchmark/benchmain/main.go | 18 ++++---- benchmark/benchmark.go | 24 ++++++----- benchmark/client/main.go | 4 +- benchmark/worker/benchmark_client.go | 10 +++-- benchmark/worker/main.go | 12 +++--- binarylog/binarylog_end2end_test.go | 28 +++++++------ interop/alts/client/client.go | 4 +- interop/alts/server/server.go | 5 ++- interop/client/client.go | 7 ++-- interop/grpclb_fallback/client.go | 14 ++++--- interop/http2/negative_http2_client.go | 18 ++++---- interop/server/server.go | 5 ++- interop/test_utils.go | 58 +++++++++++++------------- interop/xds/client/client.go | 20 +++++---- interop/xds/server/server.go | 8 ++-- stats/stats_test.go | 26 ++++++------ stress/client/main.go | 7 ++-- 17 files changed, 149 insertions(+), 119 deletions(-) diff --git a/benchmark/benchmain/main.go b/benchmark/benchmain/main.go index 509a1b905654..55427035f41b 100644 --- a/benchmark/benchmain/main.go +++ b/benchmark/benchmain/main.go @@ -65,10 +65,12 @@ import ( "google.golang.org/grpc/benchmark/stats" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/channelz" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" "google.golang.org/grpc/test/bufconn" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" + testpb "google.golang.org/grpc/interop/grpc_testing" ) var ( @@ -259,7 +261,7 @@ func unconstrainedStreamBenchmark(start startFunc, stop ucStopFunc, bf stats.Fea // service. The client is configured using the different options in the passed // 'bf'. Also returns a cleanup function to close the client and release // resources. -func makeClient(bf stats.Features) (testpb.BenchmarkServiceClient, func()) { +func makeClient(bf stats.Features) (testgrpc.BenchmarkServiceClient, func()) { nw := &latency.Network{Kbps: bf.Kbps, Latency: bf.Latency, MTU: bf.MTU} opts := []grpc.DialOption{} sopts := []grpc.ServerOption{} @@ -327,7 +329,7 @@ func makeClient(bf stats.Features) (testpb.BenchmarkServiceClient, func()) { lis = nw.Listener(lis) stopper := bm.StartServer(bm.ServerInfo{Type: "protobuf", Listener: lis}, sopts...) conn := bm.NewClientConn("" /* target not used */, opts...) - return testpb.NewBenchmarkServiceClient(conn), func() { + return testgrpc.NewBenchmarkServiceClient(conn), func() { conn.Close() stopper() } @@ -351,7 +353,7 @@ func makeFuncUnary(bf stats.Features) (rpcCallFunc, rpcCleanupFunc) { func makeFuncStream(bf stats.Features) (rpcCallFunc, rpcCleanupFunc) { tc, cleanup := makeClient(bf) - streams := make([]testpb.BenchmarkService_StreamingCallClient, bf.MaxConcurrentCalls) + streams := make([]testgrpc.BenchmarkService_StreamingCallClient, bf.MaxConcurrentCalls) for i := 0; i < bf.MaxConcurrentCalls; i++ { stream, err := tc.StreamingCall(context.Background()) if err != nil { @@ -402,10 +404,10 @@ func makeFuncUnconstrainedStream(bf stats.Features) (rpcSendFunc, rpcRecvFunc, r }, cleanup } -func setupUnconstrainedStream(bf stats.Features) ([]testpb.BenchmarkService_StreamingCallClient, *testpb.SimpleRequest, rpcCleanupFunc) { +func setupUnconstrainedStream(bf stats.Features) ([]testgrpc.BenchmarkService_StreamingCallClient, *testpb.SimpleRequest, rpcCleanupFunc) { tc, cleanup := makeClient(bf) - streams := make([]testpb.BenchmarkService_StreamingCallClient, bf.MaxConcurrentCalls) + streams := make([]testgrpc.BenchmarkService_StreamingCallClient, bf.MaxConcurrentCalls) md := metadata.Pairs(benchmark.UnconstrainedStreamingHeader, "1") ctx := metadata.NewOutgoingContext(context.Background(), md) for i := 0; i < bf.MaxConcurrentCalls; i++ { @@ -428,13 +430,13 @@ func setupUnconstrainedStream(bf stats.Features) ([]testpb.BenchmarkService_Stre // Makes a UnaryCall gRPC request using the given BenchmarkServiceClient and // request and response sizes. -func unaryCaller(client testpb.BenchmarkServiceClient, reqSize, respSize int) { +func unaryCaller(client testgrpc.BenchmarkServiceClient, reqSize, respSize int) { if err := bm.DoUnaryCall(client, reqSize, respSize); err != nil { logger.Fatalf("DoUnaryCall failed: %v", err) } } -func streamCaller(stream testpb.BenchmarkService_StreamingCallClient, reqSize, respSize int) { +func streamCaller(stream testgrpc.BenchmarkService_StreamingCallClient, reqSize, respSize int) { if err := bm.DoStreamingRoundTrip(stream, reqSize, respSize); err != nil { logger.Fatalf("DoStreamingRoundTrip failed: %v", err) } diff --git a/benchmark/benchmark.go b/benchmark/benchmark.go index 92fbeb888365..a8ae40fa6ada 100644 --- a/benchmark/benchmark.go +++ b/benchmark/benchmark.go @@ -31,9 +31,11 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" + testpb "google.golang.org/grpc/interop/grpc_testing" ) var logger = grpclog.Component("benchmark") @@ -61,7 +63,7 @@ func NewPayload(t testpb.PayloadType, size int) *testpb.Payload { } type testServer struct { - testpb.UnimplementedBenchmarkServiceServer + testgrpc.UnimplementedBenchmarkServiceServer } func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { @@ -75,7 +77,7 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (* // of ping-pong. const UnconstrainedStreamingHeader = "unconstrained-streaming" -func (s *testServer) StreamingCall(stream testpb.BenchmarkService_StreamingCallServer) error { +func (s *testServer) StreamingCall(stream testgrpc.BenchmarkService_StreamingCallServer) error { if md, ok := metadata.FromIncomingContext(stream.Context()); ok && len(md[UnconstrainedStreamingHeader]) != 0 { return s.UnconstrainedStreamingCall(stream) } @@ -100,7 +102,7 @@ func (s *testServer) StreamingCall(stream testpb.BenchmarkService_StreamingCallS } } -func (s *testServer) UnconstrainedStreamingCall(stream testpb.BenchmarkService_StreamingCallServer) error { +func (s *testServer) UnconstrainedStreamingCall(stream testgrpc.BenchmarkService_StreamingCallServer) error { in := new(testpb.SimpleRequest) // Receive a message to learn response type and size. err := stream.RecvMsg(in) @@ -151,7 +153,7 @@ func (s *testServer) UnconstrainedStreamingCall(stream testpb.BenchmarkService_S // byteBufServer is a gRPC server that sends and receives byte buffer. // The purpose is to benchmark the gRPC performance without protobuf serialization/deserialization overhead. type byteBufServer struct { - testpb.UnimplementedBenchmarkServiceServer + testgrpc.UnimplementedBenchmarkServiceServer respSize int32 } @@ -161,7 +163,7 @@ func (s *byteBufServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) return &testpb.SimpleResponse{}, nil } -func (s *byteBufServer) StreamingCall(stream testpb.BenchmarkService_StreamingCallServer) error { +func (s *byteBufServer) StreamingCall(stream testgrpc.BenchmarkService_StreamingCallServer) error { for { var in []byte err := stream.(grpc.ServerStream).RecvMsg(&in) @@ -201,13 +203,13 @@ func StartServer(info ServerInfo, opts ...grpc.ServerOption) func() { s := grpc.NewServer(opts...) switch info.Type { case "protobuf": - testpb.RegisterBenchmarkServiceServer(s, &testServer{}) + testgrpc.RegisterBenchmarkServiceServer(s, &testServer{}) case "bytebuf": respSize, ok := info.Metadata.(int32) if !ok { logger.Fatalf("failed to StartServer, invalid metadata: %v, for Type: %v", info.Metadata, info.Type) } - testpb.RegisterBenchmarkServiceServer(s, &byteBufServer{respSize: respSize}) + testgrpc.RegisterBenchmarkServiceServer(s, &byteBufServer{respSize: respSize}) default: logger.Fatalf("failed to StartServer, unknown Type: %v", info.Type) } @@ -218,7 +220,7 @@ func StartServer(info ServerInfo, opts ...grpc.ServerOption) func() { } // DoUnaryCall performs an unary RPC with given stub and request and response sizes. -func DoUnaryCall(tc testpb.BenchmarkServiceClient, reqSize, respSize int) error { +func DoUnaryCall(tc testgrpc.BenchmarkServiceClient, reqSize, respSize int) error { pl := NewPayload(testpb.PayloadType_COMPRESSABLE, reqSize) req := &testpb.SimpleRequest{ ResponseType: pl.Type, @@ -232,7 +234,7 @@ func DoUnaryCall(tc testpb.BenchmarkServiceClient, reqSize, respSize int) error } // DoStreamingRoundTrip performs a round trip for a single streaming rpc. -func DoStreamingRoundTrip(stream testpb.BenchmarkService_StreamingCallClient, reqSize, respSize int) error { +func DoStreamingRoundTrip(stream testgrpc.BenchmarkService_StreamingCallClient, reqSize, respSize int) error { pl := NewPayload(testpb.PayloadType_COMPRESSABLE, reqSize) req := &testpb.SimpleRequest{ ResponseType: pl.Type, @@ -253,7 +255,7 @@ func DoStreamingRoundTrip(stream testpb.BenchmarkService_StreamingCallClient, re } // DoByteBufStreamingRoundTrip performs a round trip for a single streaming rpc, using a custom codec for byte buffer. -func DoByteBufStreamingRoundTrip(stream testpb.BenchmarkService_StreamingCallClient, reqSize, respSize int) error { +func DoByteBufStreamingRoundTrip(stream testgrpc.BenchmarkService_StreamingCallClient, reqSize, respSize int) error { out := make([]byte, reqSize) if err := stream.(grpc.ClientStream).SendMsg(&out); err != nil { return fmt.Errorf("/BenchmarkService/StreamingCall.(ClientStream).SendMsg(_) = %v, want ", err) diff --git a/benchmark/client/main.go b/benchmark/client/main.go index c744348469ed..caf2db70a501 100644 --- a/benchmark/client/main.go +++ b/benchmark/client/main.go @@ -53,6 +53,8 @@ import ( "google.golang.org/grpc/benchmark/stats" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/syscall" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" testpb "google.golang.org/grpc/interop/grpc_testing" ) @@ -164,7 +166,7 @@ func runWithConn(cc *grpc.ClientConn, req *testpb.SimpleRequest, warmDeadline, e } func makeCaller(cc *grpc.ClientConn, req *testpb.SimpleRequest) func() { - client := testpb.NewBenchmarkServiceClient(cc) + client := testgrpc.NewBenchmarkServiceClient(cc) if *rpcType == "unary" { return func() { if _, err := client.UnaryCall(context.Background(), req); err != nil { diff --git a/benchmark/worker/benchmark_client.go b/benchmark/worker/benchmark_client.go index f760c7c36acc..43af38dc5f78 100644 --- a/benchmark/worker/benchmark_client.go +++ b/benchmark/worker/benchmark_client.go @@ -32,9 +32,11 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/syscall" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/status" "google.golang.org/grpc/testdata" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" + testpb "google.golang.org/grpc/interop/grpc_testing" ) var caFile = flag.String("ca_file", "", "The file containing the CA root cert file") @@ -243,7 +245,7 @@ func startBenchmarkClient(config *testpb.ClientConfig) (*benchmarkClient, error) func (bc *benchmarkClient) doCloseLoopUnary(conns []*grpc.ClientConn, rpcCountPerConn int, reqSize int, respSize int) { for ic, conn := range conns { - client := testpb.NewBenchmarkServiceClient(conn) + client := testgrpc.NewBenchmarkServiceClient(conn) // For each connection, create rpcCountPerConn goroutines to do rpc. for j := 0; j < rpcCountPerConn; j++ { // Create histogram for each goroutine. @@ -285,7 +287,7 @@ func (bc *benchmarkClient) doCloseLoopUnary(conns []*grpc.ClientConn, rpcCountPe } func (bc *benchmarkClient) doCloseLoopStreaming(conns []*grpc.ClientConn, rpcCountPerConn int, reqSize int, respSize int, payloadType string) { - var doRPC func(testpb.BenchmarkService_StreamingCallClient, int, int) error + var doRPC func(testgrpc.BenchmarkService_StreamingCallClient, int, int) error if payloadType == "bytebuf" { doRPC = benchmark.DoByteBufStreamingRoundTrip } else { @@ -294,7 +296,7 @@ func (bc *benchmarkClient) doCloseLoopStreaming(conns []*grpc.ClientConn, rpcCou for ic, conn := range conns { // For each connection, create rpcCountPerConn goroutines to do rpc. for j := 0; j < rpcCountPerConn; j++ { - c := testpb.NewBenchmarkServiceClient(conn) + c := testgrpc.NewBenchmarkServiceClient(conn) stream, err := c.StreamingCall(context.Background()) if err != nil { logger.Fatalf("%v.StreamingCall(_) = _, %v", c, err) diff --git a/benchmark/worker/main.go b/benchmark/worker/main.go index 4ecf997238d8..901341f51e7d 100644 --- a/benchmark/worker/main.go +++ b/benchmark/worker/main.go @@ -35,8 +35,10 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/status" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" + testpb "google.golang.org/grpc/interop/grpc_testing" ) var ( @@ -75,12 +77,12 @@ func (byteBufCodec) String() string { // workerServer implements WorkerService rpc handlers. // It can create benchmarkServer or benchmarkClient on demand. type workerServer struct { - testpb.UnimplementedWorkerServiceServer + testgrpc.UnimplementedWorkerServiceServer stop chan<- bool serverPort int } -func (s *workerServer) RunServer(stream testpb.WorkerService_RunServerServer) error { +func (s *workerServer) RunServer(stream testgrpc.WorkerService_RunServerServer) error { var bs *benchmarkServer defer func() { // Close benchmark server when stream ends. @@ -135,7 +137,7 @@ func (s *workerServer) RunServer(stream testpb.WorkerService_RunServerServer) er } } -func (s *workerServer) RunClient(stream testpb.WorkerService_RunClientServer) error { +func (s *workerServer) RunClient(stream testgrpc.WorkerService_RunClientServer) error { var bc *benchmarkClient defer func() { // Shut down benchmark client when stream ends. @@ -209,7 +211,7 @@ func main() { s := grpc.NewServer() stop := make(chan bool) - testpb.RegisterWorkerServiceServer(s, &workerServer{ + testgrpc.RegisterWorkerServiceServer(s, &workerServer{ stop: stop, serverPort: *serverPort, }) diff --git a/binarylog/binarylog_end2end_test.go b/binarylog/binarylog_end2end_test.go index e06ffec9166e..61eeb68edae8 100644 --- a/binarylog/binarylog_end2end_test.go +++ b/binarylog/binarylog_end2end_test.go @@ -31,13 +31,15 @@ import ( "github.com/golang/protobuf/proto" "google.golang.org/grpc" "google.golang.org/grpc/binarylog" - pb "google.golang.org/grpc/binarylog/grpc_binarylog_v1" "google.golang.org/grpc/grpclog" iblog "google.golang.org/grpc/internal/binarylog" "google.golang.org/grpc/internal/grpctest" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + + pb "google.golang.org/grpc/binarylog/grpc_binarylog_v1" + testgrpc "google.golang.org/grpc/interop/grpc_testing" + testpb "google.golang.org/grpc/interop/grpc_testing" ) var grpclogLogger = grpclog.Component("binarylog") @@ -126,7 +128,7 @@ func payloadToID(p *testpb.Payload) int32 { } type testServer struct { - testpb.UnimplementedTestServiceServer + testgrpc.UnimplementedTestServiceServer te *test } @@ -148,7 +150,7 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (* return &testpb.SimpleResponse{Payload: in.Payload}, nil } -func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { +func (s *testServer) FullDuplexCall(stream testgrpc.TestService_FullDuplexCallServer) error { md, ok := metadata.FromIncomingContext(stream.Context()) if ok { if err := stream.SendHeader(md); err != nil { @@ -176,7 +178,7 @@ func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServ } } -func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInputCallServer) error { +func (s *testServer) StreamingInputCall(stream testgrpc.TestService_StreamingInputCallServer) error { md, ok := metadata.FromIncomingContext(stream.Context()) if ok { if err := stream.SendHeader(md); err != nil { @@ -200,7 +202,7 @@ func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInput } } -func (s *testServer) StreamingOutputCall(in *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { +func (s *testServer) StreamingOutputCall(in *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error { md, ok := metadata.FromIncomingContext(stream.Context()) if ok { if err := stream.SendHeader(md); err != nil { @@ -227,7 +229,7 @@ func (s *testServer) StreamingOutputCall(in *testpb.StreamingOutputCallRequest, type test struct { t *testing.T - testService testpb.TestServiceServer // nil means none + testService testgrpc.TestServiceServer // nil means none // srv and srvAddr are set once startServer is called. srv *grpc.Server srvAddr string // Server IP without port. @@ -282,7 +284,7 @@ func (lw *listenerWrapper) Accept() (net.Conn, error) { // startServer starts a gRPC server listening. Callers should defer a // call to te.tearDown to clean up. -func (te *test) startServer(ts testpb.TestServiceServer) { +func (te *test) startServer(ts testgrpc.TestServiceServer) { te.testService = ts lis, err := net.Listen("tcp", "localhost:0") @@ -298,7 +300,7 @@ func (te *test) startServer(ts testpb.TestServiceServer) { s := grpc.NewServer(opts...) te.srv = s if te.testService != nil { - testpb.RegisterTestServiceServer(s, te.testService) + testgrpc.RegisterTestServiceServer(s, te.testService) } go s.Serve(lis) @@ -343,7 +345,7 @@ func (te *test) doUnaryCall(c *rpcConfig) (*testpb.SimpleRequest, *testpb.Simple req *testpb.SimpleRequest err error ) - tc := testpb.NewTestServiceClient(te.clientConn()) + tc := testgrpc.NewTestServiceClient(te.clientConn()) if c.success { req = &testpb.SimpleRequest{Payload: idToPayload(errorID + 1)} } else { @@ -363,7 +365,7 @@ func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]proto.Message, []prot resps []proto.Message err error ) - tc := testpb.NewTestServiceClient(te.clientConn()) + tc := testgrpc.NewTestServiceClient(te.clientConn()) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() ctx = metadata.NewOutgoingContext(ctx, testMetadata) @@ -412,7 +414,7 @@ func (te *test) doClientStreamCall(c *rpcConfig) ([]proto.Message, proto.Message resp *testpb.StreamingInputCallResponse err error ) - tc := testpb.NewTestServiceClient(te.clientConn()) + tc := testgrpc.NewTestServiceClient(te.clientConn()) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() ctx = metadata.NewOutgoingContext(ctx, testMetadata) @@ -445,7 +447,7 @@ func (te *test) doServerStreamCall(c *rpcConfig) (proto.Message, []proto.Message err error ) - tc := testpb.NewTestServiceClient(te.clientConn()) + tc := testgrpc.NewTestServiceClient(te.clientConn()) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() ctx = metadata.NewOutgoingContext(ctx, testMetadata) diff --git a/interop/alts/client/client.go b/interop/alts/client/client.go index 9fc0e3c15650..aef601ff885b 100644 --- a/interop/alts/client/client.go +++ b/interop/alts/client/client.go @@ -27,6 +27,8 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/alts" "google.golang.org/grpc/grpclog" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" testpb "google.golang.org/grpc/interop/grpc_testing" ) @@ -51,7 +53,7 @@ func main() { logger.Fatalf("gRPC Client: failed to dial the server at %v: %v", *serverAddr, err) } defer conn.Close() - grpcClient := testpb.NewTestServiceClient(conn) + grpcClient := testgrpc.NewTestServiceClient(conn) // Call the EmptyCall API. ctx := context.Background() diff --git a/interop/alts/server/server.go b/interop/alts/server/server.go index 0d0f375a0d1a..9db6750252e0 100644 --- a/interop/alts/server/server.go +++ b/interop/alts/server/server.go @@ -29,8 +29,9 @@ import ( "google.golang.org/grpc/credentials/alts" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/interop" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/tap" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" ) const ( @@ -64,7 +65,7 @@ func main() { } altsTC := alts.NewServerCreds(opts) grpcServer := grpc.NewServer(grpc.Creds(altsTC), grpc.InTapHandle(authz)) - testpb.RegisterTestServiceServer(grpcServer, interop.NewTestServer()) + testgrpc.RegisterTestServiceServer(grpcServer, interop.NewTestServer()) grpcServer.Serve(lis) } diff --git a/interop/client/client.go b/interop/client/client.go index 2d7823062309..8854ed2d76ec 100644 --- a/interop/client/client.go +++ b/interop/client/client.go @@ -32,9 +32,10 @@ import ( "google.golang.org/grpc/credentials/oauth" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/interop" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/resolver" "google.golang.org/grpc/testdata" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" ) const ( @@ -188,7 +189,7 @@ func main() { logger.Fatalf("Fail to dial: %v", err) } defer conn.Close() - tc := testpb.NewTestServiceClient(conn) + tc := testgrpc.NewTestServiceClient(conn) switch *testCase { case "empty_unary": interop.DoEmptyUnaryCall(tc) @@ -272,7 +273,7 @@ func main() { interop.DoUnimplementedMethod(conn) logger.Infoln("UnimplementedMethod done") case "unimplemented_service": - interop.DoUnimplementedService(testpb.NewUnimplementedServiceClient(conn)) + interop.DoUnimplementedService(testgrpc.NewUnimplementedServiceClient(conn)) logger.Infoln("UnimplementedService done") case "pick_first_unary": interop.DoPickFirstUnary(tc) diff --git a/interop/grpclb_fallback/client.go b/interop/grpclb_fallback/client.go index 262d7458aba5..61b2fae6968e 100644 --- a/interop/grpclb_fallback/client.go +++ b/interop/grpclb_fallback/client.go @@ -37,6 +37,8 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/alts" "google.golang.org/grpc/credentials/google" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" testpb "google.golang.org/grpc/interop/grpc_testing" ) @@ -55,7 +57,7 @@ var ( errorLog = log.New(os.Stderr, "ERROR: ", log.Ldate|log.Ltime|log.Lshortfile) ) -func doRPCAndGetPath(client testpb.TestServiceClient, timeout time.Duration) testpb.GrpclbRouteType { +func doRPCAndGetPath(client testgrpc.TestServiceClient, timeout time.Duration) testpb.GrpclbRouteType { infoLog.Printf("doRPCAndGetPath timeout:%v\n", timeout) ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() @@ -128,7 +130,7 @@ func runCmd(command string) { } } -func waitForFallbackAndDoRPCs(client testpb.TestServiceClient, fallbackDeadline time.Time) { +func waitForFallbackAndDoRPCs(client testgrpc.TestServiceClient, fallbackDeadline time.Time) { fallbackRetryCount := 0 fellBack := false for time.Now().Before(fallbackDeadline) { @@ -160,7 +162,7 @@ func doFastFallbackBeforeStartup() { fallbackDeadline := time.Now().Add(5 * time.Second) conn := createTestConn() defer conn.Close() - client := testpb.NewTestServiceClient(conn) + client := testgrpc.NewTestServiceClient(conn) waitForFallbackAndDoRPCs(client, fallbackDeadline) } @@ -169,14 +171,14 @@ func doSlowFallbackBeforeStartup() { fallbackDeadline := time.Now().Add(20 * time.Second) conn := createTestConn() defer conn.Close() - client := testpb.NewTestServiceClient(conn) + client := testgrpc.NewTestServiceClient(conn) waitForFallbackAndDoRPCs(client, fallbackDeadline) } func doFastFallbackAfterStartup() { conn := createTestConn() defer conn.Close() - client := testpb.NewTestServiceClient(conn) + client := testgrpc.NewTestServiceClient(conn) if g := doRPCAndGetPath(client, 20*time.Second); g != testpb.GrpclbRouteType_GRPCLB_ROUTE_TYPE_BACKEND { errorLog.Fatalf("Expected RPC to take grpclb route type BACKEND. Got: %v", g) } @@ -188,7 +190,7 @@ func doFastFallbackAfterStartup() { func doSlowFallbackAfterStartup() { conn := createTestConn() defer conn.Close() - client := testpb.NewTestServiceClient(conn) + client := testgrpc.NewTestServiceClient(conn) if g := doRPCAndGetPath(client, 20*time.Second); g != testpb.GrpclbRouteType_GRPCLB_ROUTE_TYPE_BACKEND { errorLog.Fatalf("Expected RPC to take grpclb route type BACKEND. Got: %v", g) } diff --git a/interop/http2/negative_http2_client.go b/interop/http2/negative_http2_client.go index 8ead7f49c6b4..9ed34f75716d 100644 --- a/interop/http2/negative_http2_client.go +++ b/interop/http2/negative_http2_client.go @@ -35,8 +35,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/interop" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/status" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" + testpb "google.golang.org/grpc/interop/grpc_testing" ) var ( @@ -66,7 +68,7 @@ func largeSimpleRequest() *testpb.SimpleRequest { } // sends two unary calls. The server asserts that the calls use different connections. -func goaway(tc testpb.TestServiceClient) { +func goaway(tc testgrpc.TestServiceClient) { interop.DoLargeUnaryCall(tc) // sleep to ensure that the client has time to recv the GOAWAY. // TODO(ncteisen): make this less hacky. @@ -74,7 +76,7 @@ func goaway(tc testpb.TestServiceClient) { interop.DoLargeUnaryCall(tc) } -func rstAfterHeader(tc testpb.TestServiceClient) { +func rstAfterHeader(tc testgrpc.TestServiceClient) { req := largeSimpleRequest() reply, err := tc.UnaryCall(context.Background(), req) if reply != nil { @@ -85,7 +87,7 @@ func rstAfterHeader(tc testpb.TestServiceClient) { } } -func rstDuringData(tc testpb.TestServiceClient) { +func rstDuringData(tc testgrpc.TestServiceClient) { req := largeSimpleRequest() reply, err := tc.UnaryCall(context.Background(), req) if reply != nil { @@ -96,7 +98,7 @@ func rstDuringData(tc testpb.TestServiceClient) { } } -func rstAfterData(tc testpb.TestServiceClient) { +func rstAfterData(tc testgrpc.TestServiceClient) { req := largeSimpleRequest() reply, err := tc.UnaryCall(context.Background(), req) if reply != nil { @@ -107,12 +109,12 @@ func rstAfterData(tc testpb.TestServiceClient) { } } -func ping(tc testpb.TestServiceClient) { +func ping(tc testgrpc.TestServiceClient) { // The server will assert that every ping it sends was ACK-ed by the client. interop.DoLargeUnaryCall(tc) } -func maxStreams(tc testpb.TestServiceClient) { +func maxStreams(tc testgrpc.TestServiceClient) { interop.DoLargeUnaryCall(tc) var wg sync.WaitGroup for i := 0; i < 15; i++ { @@ -135,7 +137,7 @@ func main() { logger.Fatalf("Fail to dial: %v", err) } defer conn.Close() - tc := testpb.NewTestServiceClient(conn) + tc := testgrpc.NewTestServiceClient(conn) switch *testCase { case "goaway": goaway(tc) diff --git a/interop/server/server.go b/interop/server/server.go index c70e450bb108..16360abe9e7b 100644 --- a/interop/server/server.go +++ b/interop/server/server.go @@ -29,8 +29,9 @@ import ( "google.golang.org/grpc/credentials/alts" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/interop" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/testdata" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" ) var ( @@ -76,6 +77,6 @@ func main() { opts = append(opts, grpc.Creds(altsTC)) } server := grpc.NewServer(opts...) - testpb.RegisterTestServiceServer(server, interop.NewTestServer()) + testgrpc.RegisterTestServiceServer(server, interop.NewTestServer()) server.Serve(lis) } diff --git a/interop/test_utils.go b/interop/test_utils.go index 78f937a83d68..cbcbcc4da173 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -33,9 +33,11 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" + testpb "google.golang.org/grpc/interop/grpc_testing" ) var ( @@ -67,7 +69,7 @@ func ClientNewPayload(t testpb.PayloadType, size int) *testpb.Payload { } // DoEmptyUnaryCall performs a unary RPC with empty request and response messages. -func DoEmptyUnaryCall(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoEmptyUnaryCall(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { reply, err := tc.EmptyCall(context.Background(), &testpb.Empty{}, args...) if err != nil { logger.Fatal("/TestService/EmptyCall RPC failed: ", err) @@ -78,7 +80,7 @@ func DoEmptyUnaryCall(tc testpb.TestServiceClient, args ...grpc.CallOption) { } // DoLargeUnaryCall performs a unary RPC with large payload in the request and response. -func DoLargeUnaryCall(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoLargeUnaryCall(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) req := &testpb.SimpleRequest{ ResponseType: testpb.PayloadType_COMPRESSABLE, @@ -97,7 +99,7 @@ func DoLargeUnaryCall(tc testpb.TestServiceClient, args ...grpc.CallOption) { } // DoClientStreaming performs a client streaming RPC. -func DoClientStreaming(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoClientStreaming(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { stream, err := tc.StreamingInputCall(context.Background(), args...) if err != nil { logger.Fatalf("%v.StreamingInputCall(_) = _, %v", tc, err) @@ -123,7 +125,7 @@ func DoClientStreaming(tc testpb.TestServiceClient, args ...grpc.CallOption) { } // DoServerStreaming performs a server streaming RPC. -func DoServerStreaming(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoServerStreaming(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { respParam := make([]*testpb.ResponseParameters, len(respSizes)) for i, s := range respSizes { respParam[i] = &testpb.ResponseParameters{ @@ -167,7 +169,7 @@ func DoServerStreaming(tc testpb.TestServiceClient, args ...grpc.CallOption) { } // DoPingPong performs ping-pong style bi-directional streaming RPC. -func DoPingPong(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoPingPong(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { stream, err := tc.FullDuplexCall(context.Background(), args...) if err != nil { logger.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) @@ -211,7 +213,7 @@ func DoPingPong(tc testpb.TestServiceClient, args ...grpc.CallOption) { } // DoEmptyStream sets up a bi-directional streaming with zero message. -func DoEmptyStream(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoEmptyStream(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { stream, err := tc.FullDuplexCall(context.Background(), args...) if err != nil { logger.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) @@ -225,7 +227,7 @@ func DoEmptyStream(tc testpb.TestServiceClient, args ...grpc.CallOption) { } // DoTimeoutOnSleepingServer performs an RPC on a sleep server which causes RPC timeout. -func DoTimeoutOnSleepingServer(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoTimeoutOnSleepingServer(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { ctx, cancel := context.WithTimeout(context.Background(), 1*time.Millisecond) defer cancel() stream, err := tc.FullDuplexCall(ctx, args...) @@ -249,7 +251,7 @@ func DoTimeoutOnSleepingServer(tc testpb.TestServiceClient, args ...grpc.CallOpt } // DoComputeEngineCreds performs a unary RPC with compute engine auth. -func DoComputeEngineCreds(tc testpb.TestServiceClient, serviceAccount, oauthScope string) { +func DoComputeEngineCreds(tc testgrpc.TestServiceClient, serviceAccount, oauthScope string) { pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) req := &testpb.SimpleRequest{ ResponseType: testpb.PayloadType_COMPRESSABLE, @@ -281,7 +283,7 @@ func getServiceAccountJSONKey(keyFile string) []byte { } // DoServiceAccountCreds performs a unary RPC with service account auth. -func DoServiceAccountCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { +func DoServiceAccountCreds(tc testgrpc.TestServiceClient, serviceAccountKeyFile, oauthScope string) { pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) req := &testpb.SimpleRequest{ ResponseType: testpb.PayloadType_COMPRESSABLE, @@ -306,7 +308,7 @@ func DoServiceAccountCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, o } // DoJWTTokenCreds performs a unary RPC with JWT token auth. -func DoJWTTokenCreds(tc testpb.TestServiceClient, serviceAccountKeyFile string) { +func DoJWTTokenCreds(tc testgrpc.TestServiceClient, serviceAccountKeyFile string) { pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) req := &testpb.SimpleRequest{ ResponseType: testpb.PayloadType_COMPRESSABLE, @@ -340,7 +342,7 @@ func GetToken(serviceAccountKeyFile string, oauthScope string) *oauth2.Token { } // DoOauth2TokenCreds performs a unary RPC with OAUTH2 token auth. -func DoOauth2TokenCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { +func DoOauth2TokenCreds(tc testgrpc.TestServiceClient, serviceAccountKeyFile, oauthScope string) { pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) req := &testpb.SimpleRequest{ ResponseType: testpb.PayloadType_COMPRESSABLE, @@ -365,7 +367,7 @@ func DoOauth2TokenCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oaut } // DoPerRPCCreds performs a unary RPC with per RPC OAUTH2 token. -func DoPerRPCCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { +func DoPerRPCCreds(tc testgrpc.TestServiceClient, serviceAccountKeyFile, oauthScope string) { jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) req := &testpb.SimpleRequest{ @@ -393,7 +395,7 @@ func DoPerRPCCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScop } // DoGoogleDefaultCredentials performs an unary RPC with google default credentials -func DoGoogleDefaultCredentials(tc testpb.TestServiceClient, defaultServiceAccount string) { +func DoGoogleDefaultCredentials(tc testgrpc.TestServiceClient, defaultServiceAccount string) { pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) req := &testpb.SimpleRequest{ ResponseType: testpb.PayloadType_COMPRESSABLE, @@ -412,7 +414,7 @@ func DoGoogleDefaultCredentials(tc testpb.TestServiceClient, defaultServiceAccou } // DoComputeEngineChannelCredentials performs an unary RPC with compute engine channel credentials -func DoComputeEngineChannelCredentials(tc testpb.TestServiceClient, defaultServiceAccount string) { +func DoComputeEngineChannelCredentials(tc testgrpc.TestServiceClient, defaultServiceAccount string) { pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) req := &testpb.SimpleRequest{ ResponseType: testpb.PayloadType_COMPRESSABLE, @@ -436,7 +438,7 @@ var testMetadata = metadata.MD{ } // DoCancelAfterBegin cancels the RPC after metadata has been sent but before payloads are sent. -func DoCancelAfterBegin(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoCancelAfterBegin(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { ctx, cancel := context.WithCancel(metadata.NewOutgoingContext(context.Background(), testMetadata)) stream, err := tc.StreamingInputCall(ctx, args...) if err != nil { @@ -450,7 +452,7 @@ func DoCancelAfterBegin(tc testpb.TestServiceClient, args ...grpc.CallOption) { } // DoCancelAfterFirstResponse cancels the RPC after receiving the first message from the server. -func DoCancelAfterFirstResponse(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoCancelAfterFirstResponse(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { ctx, cancel := context.WithCancel(context.Background()) stream, err := tc.FullDuplexCall(ctx, args...) if err != nil { @@ -504,7 +506,7 @@ func validateMetadata(header, trailer metadata.MD) { } // DoCustomMetadata checks that metadata is echoed back to the client. -func DoCustomMetadata(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoCustomMetadata(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { // Testing with UnaryCall. pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, 1) req := &testpb.SimpleRequest{ @@ -566,7 +568,7 @@ func DoCustomMetadata(tc testpb.TestServiceClient, args ...grpc.CallOption) { } // DoStatusCodeAndMessage checks that the status code is propagated back to the client. -func DoStatusCodeAndMessage(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoStatusCodeAndMessage(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { var code int32 = 2 msg := "test status message" expectedErr := status.Error(codes.Code(code), msg) @@ -602,7 +604,7 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient, args ...grpc.CallOption // DoSpecialStatusMessage verifies Unicode and whitespace is correctly processed // in status message. -func DoSpecialStatusMessage(tc testpb.TestServiceClient, args ...grpc.CallOption) { +func DoSpecialStatusMessage(tc testgrpc.TestServiceClient, args ...grpc.CallOption) { const ( code int32 = 2 msg string = "\t\ntest with whitespace\r\nand Unicode BMP ☺ and non-BMP 😈\t\n" @@ -622,7 +624,7 @@ func DoSpecialStatusMessage(tc testpb.TestServiceClient, args ...grpc.CallOption } // DoUnimplementedService attempts to call a method from an unimplemented service. -func DoUnimplementedService(tc testpb.UnimplementedServiceClient) { +func DoUnimplementedService(tc testgrpc.UnimplementedServiceClient) { _, err := tc.UnimplementedCall(context.Background(), &testpb.Empty{}) if status.Code(err) != codes.Unimplemented { logger.Fatalf("%v.UnimplementedCall() = _, %v, want _, %v", tc, status.Code(err), codes.Unimplemented) @@ -639,7 +641,7 @@ func DoUnimplementedMethod(cc *grpc.ClientConn) { // DoPickFirstUnary runs multiple RPCs (rpcCount) and checks that all requests // are sent to the same backend. -func DoPickFirstUnary(tc testpb.TestServiceClient) { +func DoPickFirstUnary(tc testgrpc.TestServiceClient) { const rpcCount = 100 pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, 1) @@ -672,11 +674,11 @@ func DoPickFirstUnary(tc testpb.TestServiceClient) { } type testServer struct { - testpb.UnimplementedTestServiceServer + testgrpc.UnimplementedTestServiceServer } // NewTestServer creates a test server for test service. -func NewTestServer() testpb.TestServiceServer { +func NewTestServer() testgrpc.TestServiceServer { return &testServer{} } @@ -724,7 +726,7 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (* }, nil } -func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { +func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error { cs := args.GetResponseParameters() for _, c := range cs { if us := c.GetIntervalUs(); us > 0 { @@ -743,7 +745,7 @@ func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest return nil } -func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInputCallServer) error { +func (s *testServer) StreamingInputCall(stream testgrpc.TestService_StreamingInputCallServer) error { var sum int for { in, err := stream.Recv() @@ -760,7 +762,7 @@ func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInput } } -func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { +func (s *testServer) FullDuplexCall(stream testgrpc.TestService_FullDuplexCallServer) error { if md, ok := metadata.FromIncomingContext(stream.Context()); ok { if initialMetadata, ok := md[initialMetadataKey]; ok { header := metadata.Pairs(initialMetadataKey, initialMetadata[0]) @@ -802,7 +804,7 @@ func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServ } } -func (s *testServer) HalfDuplexCall(stream testpb.TestService_HalfDuplexCallServer) error { +func (s *testServer) HalfDuplexCall(stream testgrpc.TestService_HalfDuplexCallServer) error { var msgBuf []*testpb.StreamingOutputCallRequest for { in, err := stream.Recv() diff --git a/interop/xds/client/client.go b/interop/xds/client/client.go index 7afdb20e8d72..0b8e9dee3af6 100644 --- a/interop/xds/client/client.go +++ b/interop/xds/client/client.go @@ -32,10 +32,12 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/grpclog" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" _ "google.golang.org/grpc/xds" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" + testpb "google.golang.org/grpc/interop/grpc_testing" ) func init() { @@ -163,7 +165,7 @@ var ( ) type statsService struct { - testpb.UnimplementedLoadBalancerStatsServiceServer + testgrpc.UnimplementedLoadBalancerStatsServiceServer } func hasRPCSucceeded() bool { @@ -235,7 +237,7 @@ func (s *statsService) GetClientAccumulatedStats(ctx context.Context, in *testpb } type configureService struct { - testpb.UnimplementedXdsUpdateClientConfigureServiceServer + testgrpc.UnimplementedXdsUpdateClientConfigureServiceServer } func (s *configureService) Configure(ctx context.Context, in *testpb.ClientConfigureRequest) (*testpb.ClientConfigureResponse, error) { @@ -334,25 +336,25 @@ func main() { } s := grpc.NewServer() defer s.Stop() - testpb.RegisterLoadBalancerStatsServiceServer(s, &statsService{}) - testpb.RegisterXdsUpdateClientConfigureServiceServer(s, &configureService{}) + testgrpc.RegisterLoadBalancerStatsServiceServer(s, &statsService{}) + testgrpc.RegisterXdsUpdateClientConfigureServiceServer(s, &configureService{}) go s.Serve(lis) - clients := make([]testpb.TestServiceClient, *numChannels) + clients := make([]testgrpc.TestServiceClient, *numChannels) for i := 0; i < *numChannels; i++ { conn, err := grpc.DialContext(context.Background(), *server, grpc.WithInsecure()) if err != nil { logger.Fatalf("Fail to dial: %v", err) } defer conn.Close() - clients[i] = testpb.NewTestServiceClient(conn) + clients[i] = testgrpc.NewTestServiceClient(conn) } ticker := time.NewTicker(time.Second / time.Duration(*qps**numChannels)) defer ticker.Stop() sendRPCs(clients, ticker) } -func makeOneRPC(c testpb.TestServiceClient, cfg *rpcConfig) (*peer.Peer, *rpcInfo, error) { +func makeOneRPC(c testgrpc.TestServiceClient, cfg *rpcConfig) (*peer.Peer, *rpcInfo, error) { ctx, cancel := context.WithTimeout(context.Background(), *rpcTimeout) defer cancel() @@ -392,7 +394,7 @@ func makeOneRPC(c testpb.TestServiceClient, cfg *rpcConfig) (*peer.Peer, *rpcInf return &p, &info, err } -func sendRPCs(clients []testpb.TestServiceClient, ticker *time.Ticker) { +func sendRPCs(clients []testgrpc.TestServiceClient, ticker *time.Ticker) { var i int for range ticker.C { // Get and increment request ID, and save a list of watchers that are diff --git a/interop/xds/server/server.go b/interop/xds/server/server.go index 45b8448822b2..4989eb728eec 100644 --- a/interop/xds/server/server.go +++ b/interop/xds/server/server.go @@ -29,8 +29,10 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/grpclog" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/metadata" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" + testpb "google.golang.org/grpc/interop/grpc_testing" ) var ( @@ -50,7 +52,7 @@ func getHostname() string { } type server struct { - testpb.UnimplementedTestServiceServer + testgrpc.UnimplementedTestServiceServer } func (s *server) EmptyCall(ctx context.Context, _ *testpb.Empty) (*testpb.Empty, error) { @@ -71,6 +73,6 @@ func main() { logger.Fatalf("failed to listen: %v", err) } s := grpc.NewServer() - testpb.RegisterTestServiceServer(s, &server{}) + testgrpc.RegisterTestServiceServer(s, &server{}) s.Serve(lis) } diff --git a/stats/stats_test.go b/stats/stats_test.go index aac8166f76f8..306f2f6b8e90 100644 --- a/stats/stats_test.go +++ b/stats/stats_test.go @@ -31,10 +31,12 @@ import ( "github.com/golang/protobuf/proto" "google.golang.org/grpc" "google.golang.org/grpc/internal/grpctest" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/metadata" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" + testpb "google.golang.org/grpc/interop/grpc_testing" ) const defaultTestTimeout = 10 * time.Second @@ -87,7 +89,7 @@ func payloadToID(p *testpb.Payload) int32 { } type testServer struct { - testpb.UnimplementedTestServiceServer + testgrpc.UnimplementedTestServiceServer } func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { @@ -105,7 +107,7 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (* return &testpb.SimpleResponse{Payload: in.Payload}, nil } -func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { +func (s *testServer) FullDuplexCall(stream testgrpc.TestService_FullDuplexCallServer) error { if err := stream.SendHeader(testHeaderMetadata); err != nil { return status.Errorf(status.Code(err), "%v.SendHeader(%v) = %v, want %v", stream, testHeaderMetadata, err, nil) } @@ -130,7 +132,7 @@ func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServ } } -func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInputCallServer) error { +func (s *testServer) StreamingInputCall(stream testgrpc.TestService_StreamingInputCallServer) error { if err := stream.SendHeader(testHeaderMetadata); err != nil { return status.Errorf(status.Code(err), "%v.SendHeader(%v) = %v, want %v", stream, testHeaderMetadata, err, nil) } @@ -151,7 +153,7 @@ func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInput } } -func (s *testServer) StreamingOutputCall(in *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { +func (s *testServer) StreamingOutputCall(in *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error { if err := stream.SendHeader(testHeaderMetadata); err != nil { return status.Errorf(status.Code(err), "%v.SendHeader(%v) = %v, want %v", stream, testHeaderMetadata, err, nil) } @@ -178,7 +180,7 @@ type test struct { clientStatsHandler stats.Handler serverStatsHandler stats.Handler - testServer testpb.TestServiceServer // nil means none + testServer testgrpc.TestServiceServer // nil means none // srv and srvAddr are set once startServer is called. srv *grpc.Server srvAddr string @@ -213,7 +215,7 @@ func newTest(t *testing.T, tc *testConfig, ch stats.Handler, sh stats.Handler) * // startServer starts a gRPC server listening. Callers should defer a // call to te.tearDown to clean up. -func (te *test) startServer(ts testpb.TestServiceServer) { +func (te *test) startServer(ts testgrpc.TestServiceServer) { te.testServer = ts lis, err := net.Listen("tcp", "localhost:0") if err != nil { @@ -232,7 +234,7 @@ func (te *test) startServer(ts testpb.TestServiceServer) { s := grpc.NewServer(opts...) te.srv = s if te.testServer != nil { - testpb.RegisterTestServiceServer(s, te.testServer) + testgrpc.RegisterTestServiceServer(s, te.testServer) } go s.Serve(lis) @@ -288,7 +290,7 @@ func (te *test) doUnaryCall(c *rpcConfig) (*testpb.SimpleRequest, *testpb.Simple req *testpb.SimpleRequest err error ) - tc := testpb.NewTestServiceClient(te.clientConn()) + tc := testgrpc.NewTestServiceClient(te.clientConn()) if c.success { req = &testpb.SimpleRequest{Payload: idToPayload(errorID + 1)} } else { @@ -307,7 +309,7 @@ func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]proto.Message, []prot resps []proto.Message err error ) - tc := testpb.NewTestServiceClient(te.clientConn()) + tc := testgrpc.NewTestServiceClient(te.clientConn()) tCtx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() stream, err := tc.FullDuplexCall(metadata.NewOutgoingContext(tCtx, testMetadata), grpc.WaitForReady(!c.failfast)) @@ -348,7 +350,7 @@ func (te *test) doClientStreamCall(c *rpcConfig) ([]proto.Message, *testpb.Strea resp *testpb.StreamingInputCallResponse err error ) - tc := testpb.NewTestServiceClient(te.clientConn()) + tc := testgrpc.NewTestServiceClient(te.clientConn()) tCtx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() stream, err := tc.StreamingInputCall(metadata.NewOutgoingContext(tCtx, testMetadata), grpc.WaitForReady(!c.failfast)) @@ -379,7 +381,7 @@ func (te *test) doServerStreamCall(c *rpcConfig) (*testpb.StreamingOutputCallReq err error ) - tc := testpb.NewTestServiceClient(te.clientConn()) + tc := testgrpc.NewTestServiceClient(te.clientConn()) var startID int32 if !c.success { diff --git a/stress/client/main.go b/stress/client/main.go index c5bfffa4e519..37e2a38f42a2 100644 --- a/stress/client/main.go +++ b/stress/client/main.go @@ -35,10 +35,11 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/interop" - testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/status" - metricspb "google.golang.org/grpc/stress/grpc_testing" "google.golang.org/grpc/testdata" + + testgrpc "google.golang.org/grpc/interop/grpc_testing" + metricspb "google.golang.org/grpc/stress/grpc_testing" ) var ( @@ -209,7 +210,7 @@ func startServer(server *server, port int) { // performRPCs uses weightedRandomTestSelector to select test case and runs the tests. func performRPCs(gauge *gauge, conn *grpc.ClientConn, selector *weightedRandomTestSelector, stop <-chan bool) { - client := testpb.NewTestServiceClient(conn) + client := testgrpc.NewTestServiceClient(conn) var numCalls int64 startTime := time.Now() for { From 5e3cbb54d230a7d9373b2d750784ed3eeb90d441 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Wed, 13 Jan 2021 13:23:43 -0800 Subject: [PATCH 13/37] interop/grpc_testing: update generated code after recent grpc-proto changes (#4149) --- interop/grpc_testing/messages.pb.go | 315 ++++++++++++++++++++-------- 1 file changed, 227 insertions(+), 88 deletions(-) diff --git a/interop/grpc_testing/messages.pb.go b/interop/grpc_testing/messages.pb.go index fb141c57df04..6ca348b6201d 100644 --- a/interop/grpc_testing/messages.pb.go +++ b/interop/grpc_testing/messages.pb.go @@ -1171,11 +1171,23 @@ type LoadBalancerAccumulatedStatsResponse struct { unknownFields protoimpl.UnknownFields // The total number of RPCs have ever issued for each type. + // Deprecated: use stats_per_method.rpcs_started instead. + // + // Deprecated: Do not use. NumRpcsStartedByMethod map[string]int32 `protobuf:"bytes,1,rep,name=num_rpcs_started_by_method,json=numRpcsStartedByMethod,proto3" json:"num_rpcs_started_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // The total number of RPCs have ever completed successfully for each type. + // Deprecated: use stats_per_method.result instead. + // + // Deprecated: Do not use. NumRpcsSucceededByMethod map[string]int32 `protobuf:"bytes,2,rep,name=num_rpcs_succeeded_by_method,json=numRpcsSucceededByMethod,proto3" json:"num_rpcs_succeeded_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // The total number of RPCs have ever failed for each type. + // Deprecated: use stats_per_method.result instead. + // + // Deprecated: Do not use. NumRpcsFailedByMethod map[string]int32 `protobuf:"bytes,3,rep,name=num_rpcs_failed_by_method,json=numRpcsFailedByMethod,proto3" json:"num_rpcs_failed_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + // Per-method RPC statistics. The key is the full method path; i.e. + // "/proto.package.ServiceName/MethodName". + StatsPerMethod map[string]*LoadBalancerAccumulatedStatsResponse_MethodStats `protobuf:"bytes,4,rep,name=stats_per_method,json=statsPerMethod,proto3" json:"stats_per_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *LoadBalancerAccumulatedStatsResponse) Reset() { @@ -1210,6 +1222,7 @@ func (*LoadBalancerAccumulatedStatsResponse) Descriptor() ([]byte, []int) { return file_grpc_testing_messages_proto_rawDescGZIP(), []int{15} } +// Deprecated: Do not use. func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsStartedByMethod() map[string]int32 { if x != nil { return x.NumRpcsStartedByMethod @@ -1217,6 +1230,7 @@ func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsStartedByMethod() map[s return nil } +// Deprecated: Do not use. func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsSucceededByMethod() map[string]int32 { if x != nil { return x.NumRpcsSucceededByMethod @@ -1224,6 +1238,7 @@ func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsSucceededByMethod() map return nil } +// Deprecated: Do not use. func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsFailedByMethod() map[string]int32 { if x != nil { return x.NumRpcsFailedByMethod @@ -1231,6 +1246,13 @@ func (x *LoadBalancerAccumulatedStatsResponse) GetNumRpcsFailedByMethod() map[st return nil } +func (x *LoadBalancerAccumulatedStatsResponse) GetStatsPerMethod() map[string]*LoadBalancerAccumulatedStatsResponse_MethodStats { + if x != nil { + return x.StatsPerMethod + } + return nil +} + // Configurations for a test client. type ClientConfigureRequest struct { state protoimpl.MessageState @@ -1241,6 +1263,9 @@ type ClientConfigureRequest struct { Types []ClientConfigureRequest_RpcType `protobuf:"varint,1,rep,packed,name=types,proto3,enum=grpc.testing.ClientConfigureRequest_RpcType" json:"types,omitempty"` // The collection of custom metadata to be attached to RPCs sent by the client. Metadata []*ClientConfigureRequest_Metadata `protobuf:"bytes,2,rep,name=metadata,proto3" json:"metadata,omitempty"` + // The deadline to use, in seconds, for all RPCs. If unset or zero, the + // client will use the default from the command-line. + TimeoutSec int32 `protobuf:"varint,3,opt,name=timeout_sec,json=timeoutSec,proto3" json:"timeout_sec,omitempty"` } func (x *ClientConfigureRequest) Reset() { @@ -1289,6 +1314,13 @@ func (x *ClientConfigureRequest) GetMetadata() []*ClientConfigureRequest_Metadat return nil } +func (x *ClientConfigureRequest) GetTimeoutSec() int32 { + if x != nil { + return x.TimeoutSec + } + return 0 +} + // Response for updating a test client's configuration. type ClientConfigureResponse struct { state protoimpl.MessageState @@ -1376,6 +1408,64 @@ func (x *LoadBalancerStatsResponse_RpcsByPeer) GetRpcsByPeer() map[string]int32 return nil } +type LoadBalancerAccumulatedStatsResponse_MethodStats struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The number of RPCs that were started for this method. + RpcsStarted int32 `protobuf:"varint,1,opt,name=rpcs_started,json=rpcsStarted,proto3" json:"rpcs_started,omitempty"` + // The number of RPCs that completed with each status for this method. The + // key is the integral value of a google.rpc.Code; the value is the count. + Result map[int32]int32 `protobuf:"bytes,2,rep,name=result,proto3" json:"result,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *LoadBalancerAccumulatedStatsResponse_MethodStats) Reset() { + *x = LoadBalancerAccumulatedStatsResponse_MethodStats{} + if protoimpl.UnsafeEnabled { + mi := &file_grpc_testing_messages_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoadBalancerAccumulatedStatsResponse_MethodStats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadBalancerAccumulatedStatsResponse_MethodStats) ProtoMessage() {} + +func (x *LoadBalancerAccumulatedStatsResponse_MethodStats) ProtoReflect() protoreflect.Message { + mi := &file_grpc_testing_messages_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadBalancerAccumulatedStatsResponse_MethodStats.ProtoReflect.Descriptor instead. +func (*LoadBalancerAccumulatedStatsResponse_MethodStats) Descriptor() ([]byte, []int) { + return file_grpc_testing_messages_proto_rawDescGZIP(), []int{15, 3} +} + +func (x *LoadBalancerAccumulatedStatsResponse_MethodStats) GetRpcsStarted() int32 { + if x != nil { + return x.RpcsStarted + } + return 0 +} + +func (x *LoadBalancerAccumulatedStatsResponse_MethodStats) GetResult() map[int32]int32 { + if x != nil { + return x.Result + } + return nil +} + // Metadata to be attached for the given type of RPCs. type ClientConfigureRequest_Metadata struct { state protoimpl.MessageState @@ -1390,7 +1480,7 @@ type ClientConfigureRequest_Metadata struct { func (x *ClientConfigureRequest_Metadata) Reset() { *x = ClientConfigureRequest_Metadata{} if protoimpl.UnsafeEnabled { - mi := &file_grpc_testing_messages_proto_msgTypes[25] + mi := &file_grpc_testing_messages_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1403,7 +1493,7 @@ func (x *ClientConfigureRequest_Metadata) String() string { func (*ClientConfigureRequest_Metadata) ProtoMessage() {} func (x *ClientConfigureRequest_Metadata) ProtoReflect() protoreflect.Message { - mi := &file_grpc_testing_messages_proto_msgTypes[25] + mi := &file_grpc_testing_messages_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1609,82 +1699,113 @@ var file_grpc_testing_messages_proto_rawDesc = []byte{ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x25, 0x0a, 0x23, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0xb2, 0x05, 0x0a, 0x24, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x22, 0x86, 0x09, 0x0a, 0x24, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x1a, 0x6e, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8e, 0x01, 0x0a, 0x1a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, - 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x16, - 0x6e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x42, 0x79, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x90, 0x01, 0x0a, 0x1c, 0x6e, 0x75, 0x6d, 0x5f, 0x72, - 0x70, 0x63, 0x73, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x79, - 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x50, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, - 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, - 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, - 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x18, 0x6e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, - 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x87, 0x01, 0x0a, 0x19, 0x6e, 0x75, - 0x6d, 0x5f, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x62, 0x79, - 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4d, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, - 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, - 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, - 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x15, 0x6e, 0x75, - 0x6d, 0x52, 0x70, 0x63, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x1a, 0x49, 0x0a, 0x1b, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4b, - 0x0a, 0x1d, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, - 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x48, 0x0a, 0x1a, 0x4e, - 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x02, + 0x18, 0x01, 0x52, 0x16, 0x6e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x94, 0x01, 0x0a, 0x1c, 0x6e, + 0x75, 0x6d, 0x5f, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, + 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x50, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, + 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x75, 0x63, + 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x42, 0x02, 0x18, 0x01, 0x52, 0x18, 0x6e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, + 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x12, 0x8b, 0x01, 0x0a, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x66, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, + 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x42, 0x02, 0x18, 0x01, 0x52, 0x15, 0x6e, 0x75, 0x6d, 0x52, 0x70, 0x63, + 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, + 0x70, 0x0a, 0x10, 0x73, 0x74, 0x61, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, + 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x73, 0x50, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x50, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x1a, 0x49, 0x0a, 0x1b, 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4b, 0x0a, 0x1d, + 0x4e, 0x75, 0x6d, 0x52, 0x70, 0x63, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, + 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x48, 0x0a, 0x1a, 0x4e, 0x75, 0x6d, + 0x52, 0x70, 0x63, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x79, 0x4d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0xcf, 0x01, 0x0a, 0x0b, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x74, + 0x61, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x70, 0x63, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x70, 0x63, 0x73, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x62, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc8, 0x02, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x81, 0x01, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x74, 0x73, 0x50, + 0x65, 0x72, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x54, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, + 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, + 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe9, 0x02, 0x0a, 0x16, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x49, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x42, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, - 0x2c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x12, 0x49, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, - 0x74, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x29, 0x0a, 0x07, 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x5f, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x00, - 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x01, - 0x22, 0x19, 0x0a, 0x17, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x1f, 0x0a, 0x0b, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x43, 0x4f, - 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x00, 0x2a, 0x6f, 0x0a, 0x0f, - 0x47, 0x72, 0x70, 0x63, 0x6c, 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x1d, 0x0a, 0x19, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x1e, - 0x0a, 0x1a, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x46, 0x41, 0x4c, 0x4c, 0x42, 0x41, 0x43, 0x4b, 0x10, 0x01, 0x12, 0x1d, - 0x0a, 0x19, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x10, 0x02, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, + 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x53, 0x65, 0x63, 0x1a, 0x74, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x40, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x70, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x29, 0x0a, 0x07, 0x52, 0x70, + 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x5f, 0x43, + 0x41, 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x43, + 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x22, 0x19, 0x0a, 0x17, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2a, 0x1f, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x10, 0x0a, 0x0c, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x10, + 0x00, 0x2a, 0x6f, 0x0a, 0x0f, 0x47, 0x72, 0x70, 0x63, 0x6c, 0x62, 0x52, 0x6f, 0x75, 0x74, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, + 0x4f, 0x55, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, 0x4f, + 0x55, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x41, 0x4c, 0x4c, 0x42, 0x41, 0x43, + 0x4b, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x47, 0x52, 0x50, 0x43, 0x4c, 0x42, 0x5f, 0x52, 0x4f, + 0x55, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, + 0x10, 0x02, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1700,7 +1821,7 @@ func file_grpc_testing_messages_proto_rawDescGZIP() []byte { } var file_grpc_testing_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_grpc_testing_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_grpc_testing_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 29) var file_grpc_testing_messages_proto_goTypes = []interface{}{ (PayloadType)(0), // 0: grpc.testing.PayloadType (GrpclbRouteType)(0), // 1: grpc.testing.GrpclbRouteType @@ -1724,13 +1845,16 @@ var file_grpc_testing_messages_proto_goTypes = []interface{}{ (*ClientConfigureRequest)(nil), // 19: grpc.testing.ClientConfigureRequest (*ClientConfigureResponse)(nil), // 20: grpc.testing.ClientConfigureResponse (*LoadBalancerStatsResponse_RpcsByPeer)(nil), // 21: grpc.testing.LoadBalancerStatsResponse.RpcsByPeer - nil, // 22: grpc.testing.LoadBalancerStatsResponse.RpcsByPeerEntry - nil, // 23: grpc.testing.LoadBalancerStatsResponse.RpcsByMethodEntry - nil, // 24: grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.RpcsByPeerEntry - nil, // 25: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsStartedByMethodEntry - nil, // 26: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsSucceededByMethodEntry - nil, // 27: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsFailedByMethodEntry - (*ClientConfigureRequest_Metadata)(nil), // 28: grpc.testing.ClientConfigureRequest.Metadata + nil, // 22: grpc.testing.LoadBalancerStatsResponse.RpcsByPeerEntry + nil, // 23: grpc.testing.LoadBalancerStatsResponse.RpcsByMethodEntry + nil, // 24: grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.RpcsByPeerEntry + nil, // 25: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsStartedByMethodEntry + nil, // 26: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsSucceededByMethodEntry + nil, // 27: grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsFailedByMethodEntry + (*LoadBalancerAccumulatedStatsResponse_MethodStats)(nil), // 28: grpc.testing.LoadBalancerAccumulatedStatsResponse.MethodStats + nil, // 29: grpc.testing.LoadBalancerAccumulatedStatsResponse.StatsPerMethodEntry + nil, // 30: grpc.testing.LoadBalancerAccumulatedStatsResponse.MethodStats.ResultEntry + (*ClientConfigureRequest_Metadata)(nil), // 31: grpc.testing.ClientConfigureRequest.Metadata } var file_grpc_testing_messages_proto_depIdxs = []int32{ 0, // 0: grpc.testing.Payload.type:type_name -> grpc.testing.PayloadType @@ -1754,16 +1878,19 @@ var file_grpc_testing_messages_proto_depIdxs = []int32{ 25, // 18: grpc.testing.LoadBalancerAccumulatedStatsResponse.num_rpcs_started_by_method:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsStartedByMethodEntry 26, // 19: grpc.testing.LoadBalancerAccumulatedStatsResponse.num_rpcs_succeeded_by_method:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsSucceededByMethodEntry 27, // 20: grpc.testing.LoadBalancerAccumulatedStatsResponse.num_rpcs_failed_by_method:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.NumRpcsFailedByMethodEntry - 2, // 21: grpc.testing.ClientConfigureRequest.types:type_name -> grpc.testing.ClientConfigureRequest.RpcType - 28, // 22: grpc.testing.ClientConfigureRequest.metadata:type_name -> grpc.testing.ClientConfigureRequest.Metadata - 24, // 23: grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.rpcs_by_peer:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.RpcsByPeerEntry - 21, // 24: grpc.testing.LoadBalancerStatsResponse.RpcsByMethodEntry.value:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByPeer - 2, // 25: grpc.testing.ClientConfigureRequest.Metadata.type:type_name -> grpc.testing.ClientConfigureRequest.RpcType - 26, // [26:26] is the sub-list for method output_type - 26, // [26:26] is the sub-list for method input_type - 26, // [26:26] is the sub-list for extension type_name - 26, // [26:26] is the sub-list for extension extendee - 0, // [0:26] is the sub-list for field type_name + 29, // 21: grpc.testing.LoadBalancerAccumulatedStatsResponse.stats_per_method:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.StatsPerMethodEntry + 2, // 22: grpc.testing.ClientConfigureRequest.types:type_name -> grpc.testing.ClientConfigureRequest.RpcType + 31, // 23: grpc.testing.ClientConfigureRequest.metadata:type_name -> grpc.testing.ClientConfigureRequest.Metadata + 24, // 24: grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.rpcs_by_peer:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByPeer.RpcsByPeerEntry + 21, // 25: grpc.testing.LoadBalancerStatsResponse.RpcsByMethodEntry.value:type_name -> grpc.testing.LoadBalancerStatsResponse.RpcsByPeer + 30, // 26: grpc.testing.LoadBalancerAccumulatedStatsResponse.MethodStats.result:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.MethodStats.ResultEntry + 28, // 27: grpc.testing.LoadBalancerAccumulatedStatsResponse.StatsPerMethodEntry.value:type_name -> grpc.testing.LoadBalancerAccumulatedStatsResponse.MethodStats + 2, // 28: grpc.testing.ClientConfigureRequest.Metadata.type:type_name -> grpc.testing.ClientConfigureRequest.RpcType + 29, // [29:29] is the sub-list for method output_type + 29, // [29:29] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name } func init() { file_grpc_testing_messages_proto_init() } @@ -2001,6 +2128,18 @@ func file_grpc_testing_messages_proto_init() { } } file_grpc_testing_messages_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoadBalancerAccumulatedStatsResponse_MethodStats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_grpc_testing_messages_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientConfigureRequest_Metadata); i { case 0: return &v.state @@ -2019,7 +2158,7 @@ func file_grpc_testing_messages_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_grpc_testing_messages_proto_rawDesc, NumEnums: 3, - NumMessages: 26, + NumMessages: 29, NumExtensions: 0, NumServices: 0, }, From 938f6e2f7550e542bd78f3b9e8812665db109e02 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Thu, 14 Jan 2021 14:28:25 -0800 Subject: [PATCH 14/37] cmd/protoc-gen-go-grpc: add gRPC-Go version comment and update release version (#4152) --- balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go | 1 + balancer/rls/internal/proto/grpc_lookup_v1/rls_grpc.pb.go | 1 + channelz/grpc_channelz_v1/channelz_grpc.pb.go | 1 + cmd/protoc-gen-go-grpc/grpc.go | 3 ++- cmd/protoc-gen-go-grpc/main.go | 2 +- credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go | 1 + .../tls/certprovider/meshca/internal/v1/meshca_grpc.pb.go | 1 + examples/features/proto/echo/echo_grpc.pb.go | 1 + examples/helloworld/helloworld/helloworld_grpc.pb.go | 1 + examples/route_guide/routeguide/route_guide_grpc.pb.go | 1 + health/grpc_health_v1/health_grpc.pb.go | 1 + interop/grpc_testing/benchmark_service_grpc.pb.go | 1 + interop/grpc_testing/report_qps_scenario_service_grpc.pb.go | 1 + interop/grpc_testing/test_grpc.pb.go | 1 + interop/grpc_testing/worker_service_grpc.pb.go | 1 + profiling/proto/service_grpc.pb.go | 1 + reflection/grpc_reflection_v1alpha/reflection_grpc.pb.go | 1 + reflection/grpc_testing/test_grpc.pb.go | 1 + rpc_util.go | 3 +-- stress/grpc_testing/metrics_grpc.pb.go | 1 + test/grpc_testing/test_grpc.pb.go | 1 + 21 files changed, 22 insertions(+), 4 deletions(-) diff --git a/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go b/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go index 41e7274a0f83..d56b77cca634 100644 --- a/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go +++ b/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // LoadBalancerClient is the client API for LoadBalancer service. diff --git a/balancer/rls/internal/proto/grpc_lookup_v1/rls_grpc.pb.go b/balancer/rls/internal/proto/grpc_lookup_v1/rls_grpc.pb.go index fe86d21cb107..b469089ed570 100644 --- a/balancer/rls/internal/proto/grpc_lookup_v1/rls_grpc.pb.go +++ b/balancer/rls/internal/proto/grpc_lookup_v1/rls_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // RouteLookupServiceClient is the client API for RouteLookupService service. diff --git a/channelz/grpc_channelz_v1/channelz_grpc.pb.go b/channelz/grpc_channelz_v1/channelz_grpc.pb.go index 15d664a4c64d..051d1ac440c7 100644 --- a/channelz/grpc_channelz_v1/channelz_grpc.pb.go +++ b/channelz/grpc_channelz_v1/channelz_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // ChannelzClient is the client API for Channelz service. diff --git a/cmd/protoc-gen-go-grpc/grpc.go b/cmd/protoc-gen-go-grpc/grpc.go index 0816ae4bd874..1e787344ebcc 100644 --- a/cmd/protoc-gen-go-grpc/grpc.go +++ b/cmd/protoc-gen-go-grpc/grpc.go @@ -58,7 +58,8 @@ func generateFileContent(gen *protogen.Plugin, file *protogen.File, g *protogen. g.P("// This is a compile-time assertion to ensure that this generated file") g.P("// is compatible with the grpc package it is being compiled against.") - g.P("const _ = ", grpcPackage.Ident("SupportPackageIsVersion7")) + g.P("// Requires gRPC-Go v1.32.0 or later.") + g.P("const _ = ", grpcPackage.Ident("SupportPackageIsVersion7")) // When changing, update version number above. g.P() for _, service := range file.Services { genService(gen, file, g, service) diff --git a/cmd/protoc-gen-go-grpc/main.go b/cmd/protoc-gen-go-grpc/main.go index 7e22561745e9..7f104da7d068 100644 --- a/cmd/protoc-gen-go-grpc/main.go +++ b/cmd/protoc-gen-go-grpc/main.go @@ -38,7 +38,7 @@ import ( "google.golang.org/protobuf/types/pluginpb" ) -const version = "1.0.1" +const version = "1.1.0" var requireUnimplemented *bool diff --git a/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go b/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go index 75bbf87dd55c..efdbd13fa304 100644 --- a/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go +++ b/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // HandshakerServiceClient is the client API for HandshakerService service. diff --git a/credentials/tls/certprovider/meshca/internal/v1/meshca_grpc.pb.go b/credentials/tls/certprovider/meshca/internal/v1/meshca_grpc.pb.go index 7b37a7c01b79..e53a61598aba 100644 --- a/credentials/tls/certprovider/meshca/internal/v1/meshca_grpc.pb.go +++ b/credentials/tls/certprovider/meshca/internal/v1/meshca_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // MeshCertificateServiceClient is the client API for MeshCertificateService service. diff --git a/examples/features/proto/echo/echo_grpc.pb.go b/examples/features/proto/echo/echo_grpc.pb.go index 7657b8bfb143..052087dae369 100644 --- a/examples/features/proto/echo/echo_grpc.pb.go +++ b/examples/features/proto/echo/echo_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // EchoClient is the client API for Echo service. diff --git a/examples/helloworld/helloworld/helloworld_grpc.pb.go b/examples/helloworld/helloworld/helloworld_grpc.pb.go index 51c64f65b3d0..39a0301c16b2 100644 --- a/examples/helloworld/helloworld/helloworld_grpc.pb.go +++ b/examples/helloworld/helloworld/helloworld_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // GreeterClient is the client API for Greeter service. diff --git a/examples/route_guide/routeguide/route_guide_grpc.pb.go b/examples/route_guide/routeguide/route_guide_grpc.pb.go index dd98bf5a89e0..66860e63c476 100644 --- a/examples/route_guide/routeguide/route_guide_grpc.pb.go +++ b/examples/route_guide/routeguide/route_guide_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // RouteGuideClient is the client API for RouteGuide service. diff --git a/health/grpc_health_v1/health_grpc.pb.go b/health/grpc_health_v1/health_grpc.pb.go index 8c3872664c22..386d16ce62d1 100644 --- a/health/grpc_health_v1/health_grpc.pb.go +++ b/health/grpc_health_v1/health_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // HealthClient is the client API for Health service. diff --git a/interop/grpc_testing/benchmark_service_grpc.pb.go b/interop/grpc_testing/benchmark_service_grpc.pb.go index b4badf5fe5d3..1dcba4587d29 100644 --- a/interop/grpc_testing/benchmark_service_grpc.pb.go +++ b/interop/grpc_testing/benchmark_service_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // BenchmarkServiceClient is the client API for BenchmarkService service. diff --git a/interop/grpc_testing/report_qps_scenario_service_grpc.pb.go b/interop/grpc_testing/report_qps_scenario_service_grpc.pb.go index fb6c22a00d09..b0fe8c8f5ee5 100644 --- a/interop/grpc_testing/report_qps_scenario_service_grpc.pb.go +++ b/interop/grpc_testing/report_qps_scenario_service_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // ReportQpsScenarioServiceClient is the client API for ReportQpsScenarioService service. diff --git a/interop/grpc_testing/test_grpc.pb.go b/interop/grpc_testing/test_grpc.pb.go index 6b1ae9eb4321..ad5310aed623 100644 --- a/interop/grpc_testing/test_grpc.pb.go +++ b/interop/grpc_testing/test_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // TestServiceClient is the client API for TestService service. diff --git a/interop/grpc_testing/worker_service_grpc.pb.go b/interop/grpc_testing/worker_service_grpc.pb.go index 76d24ca2e20a..cc49b22b9261 100644 --- a/interop/grpc_testing/worker_service_grpc.pb.go +++ b/interop/grpc_testing/worker_service_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // WorkerServiceClient is the client API for WorkerService service. diff --git a/profiling/proto/service_grpc.pb.go b/profiling/proto/service_grpc.pb.go index 37d2004eb599..bfdcc69bffb8 100644 --- a/profiling/proto/service_grpc.pb.go +++ b/profiling/proto/service_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // ProfilingClient is the client API for Profiling service. diff --git a/reflection/grpc_reflection_v1alpha/reflection_grpc.pb.go b/reflection/grpc_reflection_v1alpha/reflection_grpc.pb.go index 75b88186b20b..c2b7429a06b0 100644 --- a/reflection/grpc_reflection_v1alpha/reflection_grpc.pb.go +++ b/reflection/grpc_reflection_v1alpha/reflection_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // ServerReflectionClient is the client API for ServerReflection service. diff --git a/reflection/grpc_testing/test_grpc.pb.go b/reflection/grpc_testing/test_grpc.pb.go index cc322d75b2c8..76ec8d52d684 100644 --- a/reflection/grpc_testing/test_grpc.pb.go +++ b/reflection/grpc_testing/test_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // SearchServiceClient is the client API for SearchService service. diff --git a/rpc_util.go b/rpc_util.go index ea5bb8d0c2b9..c0a1208f2f30 100644 --- a/rpc_util.go +++ b/rpc_util.go @@ -888,8 +888,7 @@ type channelzData struct { // buffer files to ensure compatibility with the gRPC version used. The latest // support package version is 7. // -// Older versions are kept for compatibility. They may be removed if -// compatibility cannot be maintained. +// Older versions are kept for compatibility. // // These constants should not be referenced from any other code. const ( diff --git a/stress/grpc_testing/metrics_grpc.pb.go b/stress/grpc_testing/metrics_grpc.pb.go index 4bcd6c19c28f..2ece03255630 100644 --- a/stress/grpc_testing/metrics_grpc.pb.go +++ b/stress/grpc_testing/metrics_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // MetricsServiceClient is the client API for MetricsService service. diff --git a/test/grpc_testing/test_grpc.pb.go b/test/grpc_testing/test_grpc.pb.go index 98e33ba3ded5..ab3b68a92bcc 100644 --- a/test/grpc_testing/test_grpc.pb.go +++ b/test/grpc_testing/test_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // TestServiceClient is the client API for TestService service. From ef9850d4ff3e9e6e9af871a3cab00c8caa5c4d85 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Fri, 15 Jan 2021 11:20:58 -0800 Subject: [PATCH 15/37] xds bootstrap: support config content in env variable (#4153) --- xds/internal/client/bootstrap/bootstrap.go | 35 +++- .../client/bootstrap/bootstrap_test.go | 185 +++++++++++------- xds/internal/env/env.go | 23 ++- 3 files changed, 157 insertions(+), 86 deletions(-) diff --git a/xds/internal/client/bootstrap/bootstrap.go b/xds/internal/client/bootstrap/bootstrap.go index e833a4c91f4f..385ba87cd7df 100644 --- a/xds/internal/client/bootstrap/bootstrap.go +++ b/xds/internal/client/bootstrap/bootstrap.go @@ -96,6 +96,29 @@ type xdsServer struct { ServerFeatures []string `json:"server_features"` } +func bootstrapConfigFromEnvVariable() ([]byte, error) { + fName := env.BootstrapFileName + fContent := env.BootstrapFileContent + + // Bootstrap file name has higher priority than bootstrap content. + if fName != "" { + // If file name is set + // - If file not found (or other errors), fail + // - Otherwise, use the content. + // + // Note that even if the content is invalid, we don't failover to the + // file content env variable. + logger.Debugf("xds: using bootstrap file with name %q", fName) + return bootstrapFileReadFunc(fName) + } + + if fContent != "" { + return []byte(fContent), nil + } + + return nil, fmt.Errorf("none of the bootstrap environment variables (%q or %q) defined", env.BootstrapFileNameEnv, env.BootstrapFileContentEnv) +} + // NewConfig returns a new instance of Config initialized by reading the // bootstrap file found at ${GRPC_XDS_BOOTSTRAP}. // @@ -136,21 +159,15 @@ type xdsServer struct { func NewConfig() (*Config, error) { config := &Config{} - fName := env.BootstrapFileName - if fName == "" { - return nil, fmt.Errorf("xds: Environment variable %q not defined", "GRPC_XDS_BOOTSTRAP") - } - logger.Infof("Got bootstrap file location %q", fName) - - data, err := bootstrapFileReadFunc(fName) + data, err := bootstrapConfigFromEnvVariable() if err != nil { - return nil, fmt.Errorf("xds: Failed to read bootstrap file %s with error %v", fName, err) + return nil, fmt.Errorf("xds: Failed to read bootstrap config: %v", err) } logger.Debugf("Bootstrap content: %s", data) var jsonData map[string]json.RawMessage if err := json.Unmarshal(data, &jsonData); err != nil { - return nil, fmt.Errorf("xds: Failed to parse file %s (content %v) with error: %v", fName, string(data), err) + return nil, fmt.Errorf("xds: Failed to parse bootstrap config: %v", err) } serverSupportsV3 := false diff --git a/xds/internal/client/bootstrap/bootstrap_test.go b/xds/internal/client/bootstrap/bootstrap_test.go index 9d5aec26df71..3368af1f6a58 100644 --- a/xds/internal/client/bootstrap/bootstrap_test.go +++ b/xds/internal/client/bootstrap/bootstrap_test.go @@ -264,13 +264,17 @@ func (c *Config) compare(want *Config) error { return nil } +func fileReadFromFileMap(bootstrapFileMap map[string]string, name string) ([]byte, error) { + if b, ok := bootstrapFileMap[name]; ok { + return []byte(b), nil + } + return nil, os.ErrNotExist +} + func setupBootstrapOverride(bootstrapFileMap map[string]string) func() { oldFileReadFunc := bootstrapFileReadFunc - bootstrapFileReadFunc = func(name string) ([]byte, error) { - if b, ok := bootstrapFileMap[name]; ok { - return []byte(b), nil - } - return nil, os.ErrNotExist + bootstrapFileReadFunc = func(filename string) ([]byte, error) { + return fileReadFromFileMap(bootstrapFileMap, filename) } return func() { bootstrapFileReadFunc = oldFileReadFunc } } @@ -278,6 +282,49 @@ func setupBootstrapOverride(bootstrapFileMap map[string]string) func() { // TODO: enable leak check for this package when // https://github.com/googleapis/google-cloud-go/issues/2417 is fixed. +// This function overrides the bootstrap file NAME env variable, to test the +// code that reads file with the given fileName. +func testNewConfigWithFileNameEnv(t *testing.T, fileName string, wantError bool, wantConfig *Config) { + origBootstrapFileName := env.BootstrapFileName + env.BootstrapFileName = fileName + defer func() { env.BootstrapFileName = origBootstrapFileName }() + + c, err := NewConfig() + if (err != nil) != wantError { + t.Fatalf("NewConfig() returned error %v, wantError: %v", err, wantError) + } + if wantError { + return + } + if err := c.compare(wantConfig); err != nil { + t.Fatal(err) + } +} + +// This function overrides the bootstrap file CONTENT env variable, to test the +// code that uses the content from env directly. +func testNewConfigWithFileContentEnv(t *testing.T, fileName string, wantError bool, wantConfig *Config) { + b, err := bootstrapFileReadFunc(fileName) + if err != nil { + // If file reading failed, skip this test. + return + } + origBootstrapContent := env.BootstrapFileContent + env.BootstrapFileContent = string(b) + defer func() { env.BootstrapFileContent = origBootstrapContent }() + + c, err := NewConfig() + if (err != nil) != wantError { + t.Fatalf("NewConfig() returned error %v, wantError: %v", err, wantError) + } + if wantError { + return + } + if err := c.compare(wantConfig); err != nil { + t.Fatal(err) + } +} + // TestNewConfigV2ProtoFailure exercises the functionality in NewConfig with // different bootstrap file contents which are expected to fail. func TestNewConfigV2ProtoFailure(t *testing.T) { @@ -338,13 +385,8 @@ func TestNewConfigV2ProtoFailure(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - origBootstrapFileName := env.BootstrapFileName - env.BootstrapFileName = test.name - defer func() { env.BootstrapFileName = origBootstrapFileName }() - - if _, err := NewConfig(); err == nil { - t.Fatalf("NewConfig() returned nil error, expected to fail") - } + testNewConfigWithFileNameEnv(t, test.name, true, nil) + testNewConfigWithFileContentEnv(t, test.name, true, nil) }) } } @@ -382,17 +424,8 @@ func TestNewConfigV2ProtoSuccess(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - origBootstrapFileName := env.BootstrapFileName - env.BootstrapFileName = test.name - defer func() { env.BootstrapFileName = origBootstrapFileName }() - - c, err := NewConfig() - if err != nil { - t.Fatalf("NewConfig() failed: %v", err) - } - if err := c.compare(test.wantConfig); err != nil { - t.Fatal(err) - } + testNewConfigWithFileNameEnv(t, test.name, false, test.wantConfig) + testNewConfigWithFileContentEnv(t, test.name, false, test.wantConfig) }) } } @@ -419,17 +452,8 @@ func TestNewConfigV3SupportNotEnabledOnClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - origBootstrapFileName := env.BootstrapFileName - env.BootstrapFileName = test.name - defer func() { env.BootstrapFileName = origBootstrapFileName }() - - c, err := NewConfig() - if err != nil { - t.Fatalf("NewConfig() failed: %v", err) - } - if err := c.compare(test.wantConfig); err != nil { - t.Fatal(err) - } + testNewConfigWithFileNameEnv(t, test.name, false, test.wantConfig) + testNewConfigWithFileContentEnv(t, test.name, false, test.wantConfig) }) } } @@ -456,31 +480,66 @@ func TestNewConfigV3SupportEnabledOnClient(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - origBootstrapFileName := env.BootstrapFileName - env.BootstrapFileName = test.name - defer func() { env.BootstrapFileName = origBootstrapFileName }() - - c, err := NewConfig() - if err != nil { - t.Fatalf("NewConfig() failed: %v", err) - } - if err := c.compare(test.wantConfig); err != nil { - t.Fatal(err) - } + testNewConfigWithFileNameEnv(t, test.name, false, test.wantConfig) + testNewConfigWithFileContentEnv(t, test.name, false, test.wantConfig) }) } } -// TestNewConfigBootstrapFileEnvNotSet tests the case where the bootstrap file +// TestNewConfigBootstrapEnvPriority tests that the two env variables are read in correct priority +// +// the case where the bootstrap file // environment variable is not set. -func TestNewConfigBootstrapFileEnvNotSet(t *testing.T) { +func TestNewConfigBootstrapEnvPriority(t *testing.T) { + origV3Support := env.V3Support + env.V3Support = true + defer func() { env.V3Support = origV3Support }() + + oldFileReadFunc := bootstrapFileReadFunc + bootstrapFileReadFunc = func(filename string) ([]byte, error) { + return fileReadFromFileMap(v2BootstrapFileMap, filename) + } + defer func() { bootstrapFileReadFunc = oldFileReadFunc }() + + goodFileName1 := "goodBootstrap" + goodConfig1 := nonNilCredsConfigV2 + + goodFileName2 := "serverSupportsV3" + goodFileContent2 := v3BootstrapFileMap[goodFileName2] + goodConfig2 := nonNilCredsConfigV3 + origBootstrapFileName := env.BootstrapFileName env.BootstrapFileName = "" defer func() { env.BootstrapFileName = origBootstrapFileName }() + origBootstrapContent := env.BootstrapFileContent + env.BootstrapFileContent = "" + defer func() { env.BootstrapFileContent = origBootstrapContent }() + + // When both env variables are empty, NewConfig should fail. if _, err := NewConfig(); err == nil { t.Errorf("NewConfig() returned nil error, expected to fail") } + + // When one of them is set, it should be used. + env.BootstrapFileName = goodFileName1 + env.BootstrapFileContent = "" + if c, err := NewConfig(); err != nil || c.compare(goodConfig1) != nil { + t.Errorf("NewConfig() = %v, %v, want: %v, %v", c, err, goodConfig1, nil) + } + + env.BootstrapFileName = "" + env.BootstrapFileContent = goodFileContent2 + if c, err := NewConfig(); err != nil || c.compare(goodConfig2) != nil { + t.Errorf("NewConfig() = %v, %v, want: %v, %v", c, err, goodConfig1, nil) + } + + // Set both, file name should be read. + env.BootstrapFileName = goodFileName1 + env.BootstrapFileContent = goodFileContent2 + if c, err := NewConfig(); err != nil || c.compare(goodConfig1) != nil { + t.Errorf("NewConfig() = %v, %v, want: %v, %v", c, err, goodConfig1, nil) + } } func init() { @@ -686,20 +745,8 @@ func TestNewConfigWithCertificateProviders(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - origBootstrapFileName := env.BootstrapFileName - env.BootstrapFileName = test.name - defer func() { env.BootstrapFileName = origBootstrapFileName }() - - c, err := NewConfig() - if (err != nil) != test.wantErr { - t.Fatalf("NewConfig() returned: %v, wantErr: %v", err, test.wantErr) - } - if test.wantErr { - return - } - if err := c.compare(test.wantConfig); err != nil { - t.Fatal(err) - } + testNewConfigWithFileNameEnv(t, test.name, test.wantErr, test.wantConfig) + testNewConfigWithFileContentEnv(t, test.name, test.wantErr, test.wantConfig) }) } } @@ -764,20 +811,8 @@ func TestNewConfigWithServerResourceNameID(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - origBootstrapFileName := env.BootstrapFileName - env.BootstrapFileName = test.name - defer func() { env.BootstrapFileName = origBootstrapFileName }() - - c, err := NewConfig() - if (err != nil) != test.wantErr { - t.Fatalf("NewConfig() returned (%+v, %v), wantErr: %v", c, err, test.wantErr) - } - if test.wantErr { - return - } - if err := c.compare(test.wantConfig); err != nil { - t.Fatal(err) - } + testNewConfigWithFileNameEnv(t, test.name, test.wantErr, test.wantConfig) + testNewConfigWithFileContentEnv(t, test.name, test.wantErr, test.wantConfig) }) } } diff --git a/xds/internal/env/env.go b/xds/internal/env/env.go index c4b46bae171b..38b62808fa39 100644 --- a/xds/internal/env/env.go +++ b/xds/internal/env/env.go @@ -26,7 +26,18 @@ import ( ) const ( - bootstrapFileNameEnv = "GRPC_XDS_BOOTSTRAP" + // BootstrapFileNameEnv is the env variable to set bootstrap file name. + // Do not use this and read from env directly. Its value is read and kept in + // variable BootstrapFileName. + // + // When both bootstrap FileName and FileContent are set, FileName is used. + BootstrapFileNameEnv = "GRPC_XDS_BOOTSTRAP" + // BootstrapFileContentEnv is the env variable to set bootstrapp file + // content. Do not use this and read from env directly. Its value is read + // and kept in variable BootstrapFileName. + // + // When both bootstrap FileName and FileContent are set, FileName is used. + BootstrapFileContentEnv = "GRPC_XDS_BOOTSTRAP_CONFIG" xdsV3SupportEnv = "GRPC_XDS_EXPERIMENTAL_V3_SUPPORT" circuitBreakingSupportEnv = "GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING" timeoutSupportEnv = "GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT" @@ -36,7 +47,15 @@ var ( // BootstrapFileName holds the name of the file which contains xDS bootstrap // configuration. Users can specify the location of the bootstrap file by // setting the environment variable "GRPC_XDS_BOOSTRAP". - BootstrapFileName = os.Getenv(bootstrapFileNameEnv) + // + // When both bootstrap FileName and FileContent are set, FileName is used. + BootstrapFileName = os.Getenv(BootstrapFileNameEnv) + // BootstrapFileContent holds the content of the xDS bootstrap + // configuration. Users can specify the bootstrap config by + // setting the environment variable "GRPC_XDS_BOOSTRAP_CONFIG". + // + // When both bootstrap FileName and FileContent are set, FileName is used. + BootstrapFileContent = os.Getenv(BootstrapFileContentEnv) // V3Support indicates whether xDS v3 API support is enabled, which can be // done by setting the environment variable // "GRPC_XDS_EXPERIMENTAL_V3_SUPPORT" to "true". From 269d25366610aeef2aa632d1d88020ddba34aa12 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Fri, 15 Jan 2021 16:07:34 -0800 Subject: [PATCH 16/37] interop/xds: implement new stats response field (#4156) --- interop/xds/client/client.go | 107 ++++++++++++++++++++++------------- 1 file changed, 68 insertions(+), 39 deletions(-) diff --git a/interop/xds/client/client.go b/interop/xds/client/client.go index 0b8e9dee3af6..300cbc9122d4 100644 --- a/interop/xds/client/client.go +++ b/interop/xds/client/client.go @@ -34,6 +34,7 @@ import ( "google.golang.org/grpc/grpclog" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" + "google.golang.org/grpc/status" _ "google.golang.org/grpc/xds" testgrpc "google.golang.org/grpc/interop/grpc_testing" @@ -60,7 +61,7 @@ type statsWatcher struct { rpcsByPeer map[string]int32 rpcsByType map[string]map[string]int32 numFailures int32 - remainingRpcs int32 + remainingRPCs int32 chanHosts chan *rpcInfo } @@ -73,7 +74,7 @@ func (watcher *statsWatcher) buildResp() *testpb.LoadBalancerStatsResponse { } return &testpb.LoadBalancerStatsResponse{ - NumFailures: watcher.numFailures + watcher.remainingRpcs, + NumFailures: watcher.numFailures + watcher.remainingRPCs, RpcsByPeer: watcher.rpcsByPeer, RpcsByMethod: rpcsByType, } @@ -81,57 +82,85 @@ func (watcher *statsWatcher) buildResp() *testpb.LoadBalancerStatsResponse { type accumulatedStats struct { mu sync.Mutex - numRpcsStartedByMethod map[string]int32 - numRpcsSucceededByMethod map[string]int32 - numRpcsFailedByMethod map[string]int32 + numRPCsStartedByMethod map[string]int32 + numRPCsSucceededByMethod map[string]int32 + numRPCsFailedByMethod map[string]int32 + rpcStatusByMethod map[string]map[int32]int32 } -// copyStatsMap makes a copy of the map, and also replaces the RPC type string -// to the proto string. E.g. "UnaryCall" -> "UNARY_CALL". -func copyStatsMap(originalMap map[string]int32) (newMap map[string]int32) { - newMap = make(map[string]int32) +func convertRPCName(in string) string { + switch in { + case unaryCall: + return testpb.ClientConfigureRequest_UNARY_CALL.String() + case emptyCall: + return testpb.ClientConfigureRequest_EMPTY_CALL.String() + } + logger.Warningf("unrecognized rpc type: %s", in) + return in +} + +// copyStatsMap makes a copy of the map. +func copyStatsMap(originalMap map[string]int32) map[string]int32 { + newMap := make(map[string]int32, len(originalMap)) for k, v := range originalMap { - var kk string - switch k { - case unaryCall: - kk = testpb.ClientConfigureRequest_UNARY_CALL.String() - case emptyCall: - kk = testpb.ClientConfigureRequest_EMPTY_CALL.String() - default: - logger.Warningf("unrecognized rpc type: %s", k) - } - if kk == "" { - continue - } - newMap[kk] = v + newMap[k] = v } return newMap } +// copyStatsIntMap makes a copy of the map. +func copyStatsIntMap(originalMap map[int32]int32) map[int32]int32 { + newMap := make(map[int32]int32, len(originalMap)) + for k, v := range originalMap { + newMap[k] = v + } + return newMap +} + +func (as *accumulatedStats) makeStatsMap() map[string]*testpb.LoadBalancerAccumulatedStatsResponse_MethodStats { + m := make(map[string]*testpb.LoadBalancerAccumulatedStatsResponse_MethodStats) + for k, v := range as.numRPCsStartedByMethod { + m[k] = &testpb.LoadBalancerAccumulatedStatsResponse_MethodStats{RpcsStarted: v} + } + for k, v := range as.rpcStatusByMethod { + if m[k] == nil { + m[k] = &testpb.LoadBalancerAccumulatedStatsResponse_MethodStats{} + } + m[k].Result = copyStatsIntMap(v) + } + return m +} + func (as *accumulatedStats) buildResp() *testpb.LoadBalancerAccumulatedStatsResponse { as.mu.Lock() defer as.mu.Unlock() return &testpb.LoadBalancerAccumulatedStatsResponse{ - NumRpcsStartedByMethod: copyStatsMap(as.numRpcsStartedByMethod), - NumRpcsSucceededByMethod: copyStatsMap(as.numRpcsSucceededByMethod), - NumRpcsFailedByMethod: copyStatsMap(as.numRpcsFailedByMethod), + NumRpcsStartedByMethod: copyStatsMap(as.numRPCsStartedByMethod), + NumRpcsSucceededByMethod: copyStatsMap(as.numRPCsSucceededByMethod), + NumRpcsFailedByMethod: copyStatsMap(as.numRPCsFailedByMethod), + StatsPerMethod: as.makeStatsMap(), } } func (as *accumulatedStats) startRPC(rpcType string) { as.mu.Lock() defer as.mu.Unlock() - as.numRpcsStartedByMethod[rpcType]++ + as.numRPCsStartedByMethod[convertRPCName(rpcType)]++ } -func (as *accumulatedStats) finishRPC(rpcType string, failed bool) { +func (as *accumulatedStats) finishRPC(rpcType string, err error) { as.mu.Lock() defer as.mu.Unlock() - if failed { - as.numRpcsFailedByMethod[rpcType]++ + name := convertRPCName(rpcType) + if as.rpcStatusByMethod[name] == nil { + as.rpcStatusByMethod[name] = make(map[int32]int32) + } + as.rpcStatusByMethod[name][int32(status.Convert(err).Code())]++ + if err != nil { + as.numRPCsFailedByMethod[name]++ return } - as.numRpcsSucceededByMethod[rpcType]++ + as.numRPCsSucceededByMethod[name]++ } var ( @@ -152,9 +181,10 @@ var ( watchers = make(map[statsWatcherKey]*statsWatcher) accStats = accumulatedStats{ - numRpcsStartedByMethod: make(map[string]int32), - numRpcsSucceededByMethod: make(map[string]int32), - numRpcsFailedByMethod: make(map[string]int32), + numRPCsStartedByMethod: make(map[string]int32), + numRPCsSucceededByMethod: make(map[string]int32), + numRPCsFailedByMethod: make(map[string]int32), + rpcStatusByMethod: make(map[string]map[int32]int32), } // 0 or 1 representing an RPC has succeeded. Use hasRPCSucceeded and @@ -189,7 +219,7 @@ func (s *statsService) GetClientStats(ctx context.Context, in *testpb.LoadBalanc rpcsByPeer: make(map[string]int32), rpcsByType: make(map[string]map[string]int32), numFailures: 0, - remainingRpcs: in.GetNumRpcs(), + remainingRPCs: in.GetNumRpcs(), chanHosts: make(chan *rpcInfo), } watchers[watcherKey] = watcher @@ -221,8 +251,8 @@ func (s *statsService) GetClientStats(ctx context.Context, in *testpb.LoadBalanc } else { watcher.numFailures++ } - watcher.remainingRpcs-- - if watcher.remainingRpcs == 0 { + watcher.remainingRPCs-- + if watcher.remainingRPCs == 0 { return watcher.buildResp(), nil } case <-ctx.Done(): @@ -342,7 +372,7 @@ func main() { clients := make([]testgrpc.TestServiceClient, *numChannels) for i := 0; i < *numChannels; i++ { - conn, err := grpc.DialContext(context.Background(), *server, grpc.WithInsecure()) + conn, err := grpc.Dial(*server, grpc.WithInsecure()) if err != nil { logger.Fatalf("Fail to dial: %v", err) } @@ -381,11 +411,10 @@ func makeOneRPC(c testgrpc.TestServiceClient, cfg *rpcConfig) (*peer.Peer, *rpcI case emptyCall: _, err = c.EmptyCall(ctx, &testpb.Empty{}, grpc.Peer(&p), grpc.Header(&header)) } + accStats.finishRPC(cfg.typ, err) if err != nil { - accStats.finishRPC(cfg.typ, true) return nil, nil, err } - accStats.finishRPC(cfg.typ, false) hosts := header["hostname"] if len(hosts) > 0 { From 504caa93c53934ac0367ba2636aa1c8147372a43 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Fri, 15 Jan 2021 16:07:52 -0800 Subject: [PATCH 17/37] interop/xds: support ClientConfigureRequest.timeout_sec field (#4157) --- interop/xds/client/client.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/interop/xds/client/client.go b/interop/xds/client/client.go index 300cbc9122d4..5b755272d3e7 100644 --- a/interop/xds/client/client.go +++ b/interop/xds/client/client.go @@ -295,8 +295,9 @@ func (s *configureService) Configure(ctx context.Context, in *testpb.ClientConfi return nil, fmt.Errorf("unsupported RPC type: %v", typ) } cfgs = append(cfgs, &rpcConfig{ - typ: rpcType, - md: metadata.Pairs(md...), + typ: rpcType, + md: metadata.Pairs(md...), + timeout: in.GetTimeoutSec(), }) } rpcCfgs.Store(cfgs) @@ -327,8 +328,9 @@ func parseRPCTypes(rpcStr string) (ret []string) { } type rpcConfig struct { - typ string - md metadata.MD + typ string + md metadata.MD + timeout int32 } // parseRPCMetadata turns EmptyCall:key1:value1 into @@ -385,7 +387,11 @@ func main() { } func makeOneRPC(c testgrpc.TestServiceClient, cfg *rpcConfig) (*peer.Peer, *rpcInfo, error) { - ctx, cancel := context.WithTimeout(context.Background(), *rpcTimeout) + timeout := *rpcTimeout + if cfg.timeout != 0 { + timeout = time.Duration(cfg.timeout) * time.Second + } + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() if len(cfg.md) != 0 { From f579b61a694cfecb7287d6833347128422006b55 Mon Sep 17 00:00:00 2001 From: Easwar Swaminathan Date: Tue, 19 Jan 2021 18:00:32 -0800 Subject: [PATCH 18/37] test: Run e2e authority tests only on linux. (#4160) Although darwin supports UDS, these tests need some non-trivial amount of work to get them to pass on darwin. This build constraint will make a top-level `go test` happy on darwin. --- test/authority_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/authority_test.go b/test/authority_test.go index 2839f01e228e..17ae178b73c9 100644 --- a/test/authority_test.go +++ b/test/authority_test.go @@ -1,3 +1,5 @@ +// +build linux + /* * * Copyright 2020 gRPC authors. From 7f2581f910fc21497091c4109b56d310276fc943 Mon Sep 17 00:00:00 2001 From: ZHANG Dapeng Date: Wed, 20 Jan 2021 17:24:22 -0800 Subject: [PATCH 19/37] xds interop: add xds v3 kokoro tests (#4165) --- test/kokoro/xds.sh | 2 ++ test/kokoro/xds_v3.cfg | 11 +++++++++++ test/kokoro/xds_v3.sh | 3 +++ 3 files changed, 16 insertions(+) create mode 100644 test/kokoro/xds_v3.cfg create mode 100755 test/kokoro/xds_v3.sh diff --git a/test/kokoro/xds.sh b/test/kokoro/xds.sh index 565d55aa116c..ee98399319bc 100755 --- a/test/kokoro/xds.sh +++ b/test/kokoro/xds.sh @@ -29,10 +29,12 @@ GRPC_GO_LOG_VERBOSITY_LEVEL=99 GRPC_GO_LOG_SEVERITY_LEVEL=info \ python3 grpc/tools/run_tests/run_xds_tests.py \ --test_case="all,path_matching,header_matching,circuit_breaking" \ --project_id=grpc-testing \ + --project_num=830293263384 \ --source_image=projects/grpc-testing/global/images/xds-test-server-3 \ --path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \ --gcp_suffix=$(date '+%s') \ --verbose \ + ${XDS_V3_OPT-} \ --client_cmd="grpc-go/interop/xds/client/client \ --server=xds:///{server_uri} \ --stats_port={stats_port} \ diff --git a/test/kokoro/xds_v3.cfg b/test/kokoro/xds_v3.cfg new file mode 100644 index 000000000000..fc4949e280d9 --- /dev/null +++ b/test/kokoro/xds_v3.cfg @@ -0,0 +1,11 @@ +# Config file for internal CI + +# Location of the continuous shell script in repository. +build_file: "grpc-go/test/kokoro/xds_v3.sh" +timeout_mins: 90 +action { + define_artifacts { + regex: "**/*sponge_log.*" + regex: "github/grpc/reports/**" + } +} diff --git a/test/kokoro/xds_v3.sh b/test/kokoro/xds_v3.sh new file mode 100755 index 000000000000..73eb50d248a2 --- /dev/null +++ b/test/kokoro/xds_v3.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +XDS_V3_OPT="--xds_v3_support" `dirname $0`/xds.sh From 2c42474aca0cd9410911a4dbcb4ae7e13cecdb14 Mon Sep 17 00:00:00 2001 From: Easwar Swaminathan Date: Thu, 21 Jan 2021 17:21:34 -0800 Subject: [PATCH 20/37] pemfile: Make test happy with Go1.16 (#4164) Go1.16 adds a new unexported field to x509.CertPool which causes our tests to fail because cmp.Equal() isn't happy. This change introduces a helper function which compares certprovider.KeyMaterial in a way that makes the test happy with the new Go version. --- .../tls/certprovider/pemfile/watcher_test.go | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/credentials/tls/certprovider/pemfile/watcher_test.go b/credentials/tls/certprovider/pemfile/watcher_test.go index d5ce5ab7e94d..e43cf7358eca 100644 --- a/credentials/tls/certprovider/pemfile/watcher_test.go +++ b/credentials/tls/certprovider/pemfile/watcher_test.go @@ -20,7 +20,7 @@ package pemfile import ( "context" - "crypto/x509" + "fmt" "io/ioutil" "math/big" "os" @@ -29,6 +29,7 @@ import ( "time" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "google.golang.org/grpc/credentials/tls/certprovider" "google.golang.org/grpc/internal/grpctest" @@ -55,6 +56,30 @@ func Test(t *testing.T) { grpctest.RunSubTests(t, s{}) } +func compareKeyMaterial(got, want *certprovider.KeyMaterial) error { + // x509.Certificate type defines an Equal() method, but does not check for + // nil. This has been fixed in + // https://github.com/golang/go/commit/89865f8ba64ccb27f439cce6daaa37c9aa38f351, + // but this is only available starting go1.14. + // TODO(easwars): Remove this check once we remove support for go1.13. + if (got.Certs == nil && want.Certs != nil) || (want.Certs == nil && got.Certs != nil) { + return fmt.Errorf("keyMaterial certs = %+v, want %+v", got, want) + } + if !cmp.Equal(got.Certs, want.Certs, cmp.AllowUnexported(big.Int{})) { + return fmt.Errorf("keyMaterial certs = %+v, want %+v", got, want) + } + // x509.CertPool contains only unexported fields some of which contain other + // unexported fields. So usage of cmp.AllowUnexported() or + // cmpopts.IgnoreUnexported() does not help us much here. Also, the standard + // library does not provide a way to compare CertPool values. Comparing the + // subjects field of the certs in the CertPool seems like a reasonable + // approach. + if gotR, wantR := got.Roots.Subjects(), want.Roots.Subjects(); !cmp.Equal(gotR, wantR, cmpopts.EquateEmpty()) { + return fmt.Errorf("keyMaterial roots = %v, want %v", gotR, wantR) + } + return nil +} + // TestNewProvider tests the NewProvider() function with different inputs. func (s) TestNewProvider(t *testing.T) { tests := []struct { @@ -263,7 +288,7 @@ func (s) TestProvider_UpdateSuccess(t *testing.T) { if err != nil { t.Fatalf("provider.KeyMaterial() failed: %v", err) } - if cmp.Equal(km1, km2, cmp.AllowUnexported(big.Int{}, x509.CertPool{})) { + if err := compareKeyMaterial(km1, km2); err == nil { t.Fatal("expected provider to return new key material after update to underlying file") } @@ -279,7 +304,7 @@ func (s) TestProvider_UpdateSuccess(t *testing.T) { if err != nil { t.Fatalf("provider.KeyMaterial() failed: %v", err) } - if cmp.Equal(km2, km3, cmp.AllowUnexported(big.Int{}, x509.CertPool{})) { + if err := compareKeyMaterial(km2, km3); err == nil { t.Fatal("expected provider to return new key material after update to underlying file") } } @@ -363,7 +388,7 @@ func (s) TestProvider_UpdateSuccessWithSymlink(t *testing.T) { t.Fatalf("provider.KeyMaterial() failed: %v", err) } - if cmp.Equal(km1, km2, cmp.AllowUnexported(big.Int{}, x509.CertPool{})) { + if err := compareKeyMaterial(km1, km2); err == nil { t.Fatal("expected provider to return new key material after symlink update") } } @@ -403,8 +428,8 @@ func (s) TestProvider_UpdateFailure_ThenSuccess(t *testing.T) { if err != nil { t.Fatalf("provider.KeyMaterial() failed: %v", err) } - if !cmp.Equal(km1, km2, cmp.AllowUnexported(big.Int{}, x509.CertPool{})) { - t.Fatal("expected provider to not update key material") + if err := compareKeyMaterial(km1, km2); err != nil { + t.Fatalf("expected provider to not update key material: %v", err) } // Update the key file to match the cert file. @@ -418,7 +443,7 @@ func (s) TestProvider_UpdateFailure_ThenSuccess(t *testing.T) { if err != nil { t.Fatalf("provider.KeyMaterial() failed: %v", err) } - if cmp.Equal(km2, km3, cmp.AllowUnexported(big.Int{}, x509.CertPool{})) { + if err := compareKeyMaterial(km2, km3); err == nil { t.Fatal("expected provider to return new key material after update to underlying file") } } From 7bb497f78432890caa760b51fcfc077498b1fee2 Mon Sep 17 00:00:00 2001 From: Easwar Swaminathan Date: Wed, 27 Jan 2021 16:36:06 -0800 Subject: [PATCH 21/37] grpc: Update protobuf regenrate script (#4177) - Pull in protobuf repo since one of our protos pulls in duration.proto - Update grpc_testing/messages.pb.go to pull in a recent change --- interop/grpc_testing/messages.pb.go | 4 ++-- regenerate.sh | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/interop/grpc_testing/messages.pb.go b/interop/grpc_testing/messages.pb.go index 6ca348b6201d..f956a5ad771f 100644 --- a/interop/grpc_testing/messages.pb.go +++ b/interop/grpc_testing/messages.pb.go @@ -1185,8 +1185,8 @@ type LoadBalancerAccumulatedStatsResponse struct { // // Deprecated: Do not use. NumRpcsFailedByMethod map[string]int32 `protobuf:"bytes,3,rep,name=num_rpcs_failed_by_method,json=numRpcsFailedByMethod,proto3" json:"num_rpcs_failed_by_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // Per-method RPC statistics. The key is the full method path; i.e. - // "/proto.package.ServiceName/MethodName". + // Per-method RPC statistics. The key is the RpcType in string form; e.g. + // 'EMPTY_CALL' or 'UNARY_CALL' StatsPerMethod map[string]*LoadBalancerAccumulatedStatsResponse_MethodStats `protobuf:"bytes,4,rep,name=stats_per_method,json=statsPerMethod,proto3" json:"stats_per_method,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } diff --git a/regenerate.sh b/regenerate.sh index ed52187df660..fc6725b89f84 100755 --- a/regenerate.sh +++ b/regenerate.sh @@ -40,6 +40,9 @@ echo "go install cmd/protoc-gen-go-grpc" echo "git clone https://github.com/grpc/grpc-proto" git clone --quiet https://github.com/grpc/grpc-proto ${WORKDIR}/grpc-proto +echo "git clone https://github.com/protocolbuffers/protobuf" +git clone --quiet https://github.com/protocolbuffers/protobuf ${WORKDIR}/protobuf + # Pull in code.proto as a proto dependency mkdir -p ${WORKDIR}/googleapis/google/rpc echo "curl https://raw.githubusercontent.com/googleapis/googleapis/master/google/rpc/code.proto" @@ -87,6 +90,7 @@ for src in ${SOURCES[@]}; do -I"." \ -I${WORKDIR}/grpc-proto \ -I${WORKDIR}/googleapis \ + -I${WORKDIR}/protobuf/src \ -I${WORKDIR}/istio \ ${src} done @@ -97,6 +101,7 @@ for src in ${LEGACY_SOURCES[@]}; do -I"." \ -I${WORKDIR}/grpc-proto \ -I${WORKDIR}/googleapis \ + -I${WORKDIR}/protobuf/src \ -I${WORKDIR}/istio \ ${src} done From e526a29227471c90813ef4d5c1b2df98e627bb28 Mon Sep 17 00:00:00 2001 From: Easwar Swaminathan Date: Wed, 27 Jan 2021 16:48:32 -0800 Subject: [PATCH 22/37] xds: Remove v3Support environment variable (#4174) --- xds/internal/client/bootstrap/bootstrap.go | 12 ++--- .../client/bootstrap/bootstrap_test.go | 52 +++---------------- xds/internal/env/env.go | 5 -- .../test/xds_server_integration_test.go | 6 --- 4 files changed, 10 insertions(+), 65 deletions(-) diff --git a/xds/internal/client/bootstrap/bootstrap.go b/xds/internal/client/bootstrap/bootstrap.go index 385ba87cd7df..c48bb797f36a 100644 --- a/xds/internal/client/bootstrap/bootstrap.go +++ b/xds/internal/client/bootstrap/bootstrap.go @@ -258,14 +258,10 @@ func NewConfig() (*Config, error) { return nil, fmt.Errorf("xds: Required field %q doesn't contain valid value in bootstrap %s", "xds_servers.channel_creds", jsonData["xds_servers"]) } - // We end up using v3 transport protocol version only if the following - // conditions are met: - // 1. Server supports v3, indicated by the presence of "xds_v3" in - // server_features. - // 2. Environment variable "GRPC_XDS_EXPERIMENTAL_V3_SUPPORT" is set to - // true. - // The default value of the enum type "version.TransportAPI" is v2. - if env.V3Support && serverSupportsV3 { + // We end up using v3 transport protocol version only if the server supports + // v3, indicated by the presence of "xds_v3" in server_features. The default + // value of the enum type "version.TransportAPI" is v2. + if serverSupportsV3 { config.TransportAPI = version.TransportV3 } diff --git a/xds/internal/client/bootstrap/bootstrap_test.go b/xds/internal/client/bootstrap/bootstrap_test.go index 3368af1f6a58..e881594b8770 100644 --- a/xds/internal/client/bootstrap/bootstrap_test.go +++ b/xds/internal/client/bootstrap/bootstrap_test.go @@ -430,43 +430,10 @@ func TestNewConfigV2ProtoSuccess(t *testing.T) { } } -// TestNewConfigV3SupportNotEnabledOnClient verifies bootstrap functionality -// when the GRPC_XDS_EXPERIMENTAL_V3_SUPPORT environment variable is not enabled -// on the client. In this case, whether the server supports v3 or not, the -// client will end up using v2. -func TestNewConfigV3SupportNotEnabledOnClient(t *testing.T) { - origV3Support := env.V3Support - env.V3Support = false - defer func() { env.V3Support = origV3Support }() - - cancel := setupBootstrapOverride(v3BootstrapFileMap) - defer cancel() - - tests := []struct { - name string - wantConfig *Config - }{ - {"serverDoesNotSupportsV3", nonNilCredsConfigV2}, - {"serverSupportsV3", nonNilCredsConfigV2}, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - testNewConfigWithFileNameEnv(t, test.name, false, test.wantConfig) - testNewConfigWithFileContentEnv(t, test.name, false, test.wantConfig) - }) - } -} - -// TestNewConfigV3SupportEnabledOnClient verifies bootstrap functionality when -// the GRPC_XDS_EXPERIMENTAL_V3_SUPPORT environment variable is enabled on the -// client. Here the client ends up using v2 or v3 based on what the server -// supports. -func TestNewConfigV3SupportEnabledOnClient(t *testing.T) { - origV3Support := env.V3Support - env.V3Support = true - defer func() { env.V3Support = origV3Support }() - +// TestNewConfigV3Support verifies bootstrap functionality involving support for +// the xDS v3 transport protocol. Here the client ends up using v2 or v3 based +// on what the server supports. +func TestNewConfigV3Support(t *testing.T) { cancel := setupBootstrapOverride(v3BootstrapFileMap) defer cancel() @@ -486,15 +453,12 @@ func TestNewConfigV3SupportEnabledOnClient(t *testing.T) { } } -// TestNewConfigBootstrapEnvPriority tests that the two env variables are read in correct priority +// TestNewConfigBootstrapEnvPriority tests that the two env variables are read +// in correct priority. // // the case where the bootstrap file // environment variable is not set. func TestNewConfigBootstrapEnvPriority(t *testing.T) { - origV3Support := env.V3Support - env.V3Support = true - defer func() { env.V3Support = origV3Support }() - oldFileReadFunc := bootstrapFileReadFunc bootstrapFileReadFunc = func(filename string) ([]byte, error) { return fileReadFromFileMap(v2BootstrapFileMap, filename) @@ -702,10 +666,6 @@ func TestNewConfigWithCertificateProviders(t *testing.T) { t.Fatalf("config parsing for plugin %q failed: %v", fakeCertProviderName, err) } - origV3Support := env.V3Support - env.V3Support = true - defer func() { env.V3Support = origV3Support }() - cancel := setupBootstrapOverride(bootstrapFileMap) defer cancel() diff --git a/xds/internal/env/env.go b/xds/internal/env/env.go index 38b62808fa39..3d75bc3e86f4 100644 --- a/xds/internal/env/env.go +++ b/xds/internal/env/env.go @@ -38,7 +38,6 @@ const ( // // When both bootstrap FileName and FileContent are set, FileName is used. BootstrapFileContentEnv = "GRPC_XDS_BOOTSTRAP_CONFIG" - xdsV3SupportEnv = "GRPC_XDS_EXPERIMENTAL_V3_SUPPORT" circuitBreakingSupportEnv = "GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING" timeoutSupportEnv = "GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT" ) @@ -56,10 +55,6 @@ var ( // // When both bootstrap FileName and FileContent are set, FileName is used. BootstrapFileContent = os.Getenv(BootstrapFileContentEnv) - // V3Support indicates whether xDS v3 API support is enabled, which can be - // done by setting the environment variable - // "GRPC_XDS_EXPERIMENTAL_V3_SUPPORT" to "true". - V3Support = strings.EqualFold(os.Getenv(xdsV3SupportEnv), "true") // CircuitBreakingSupport indicates whether circuit breaking support is // enabled, which can be done by setting the environment variable // "GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING" to "true". diff --git a/xds/internal/test/xds_server_integration_test.go b/xds/internal/test/xds_server_integration_test.go index 300aab3a737b..e55e048e6a36 100644 --- a/xds/internal/test/xds_server_integration_test.go +++ b/xds/internal/test/xds_server_integration_test.go @@ -50,7 +50,6 @@ import ( testpb "google.golang.org/grpc/test/grpc_testing" "google.golang.org/grpc/testdata" "google.golang.org/grpc/xds" - "google.golang.org/grpc/xds/internal/env" "google.golang.org/grpc/xds/internal/testutils" "google.golang.org/grpc/xds/internal/testutils/e2e" "google.golang.org/grpc/xds/internal/version" @@ -136,10 +135,6 @@ func createClientTLSCredentials(t *testing.T) credentials.TransportCredentials { func commonSetup(t *testing.T) (*e2e.ManagementServer, string, net.Listener, func()) { t.Helper() - // Turn on xDS V3 support. - origV3Support := env.V3Support - env.V3Support = true - // Spin up a xDS management server on a local port. nodeID := uuid.New().String() fs, err := e2e.StartManagementServer() @@ -189,7 +184,6 @@ func commonSetup(t *testing.T) (*e2e.ManagementServer, string, net.Listener, fun }() return fs, nodeID, lis, func() { - env.V3Support = origV3Support fs.Stop() bootstrapCleanup() server.Stop() From 0bc741730b8171fc51cdaf826caea5119c411009 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 28 Jan 2021 16:47:07 -0800 Subject: [PATCH 23/37] xds: report drops by circuit breaking (#4171) --- xds/internal/balancer/edsbalancer/eds_impl.go | 5 ++ .../balancer/edsbalancer/eds_impl_test.go | 48 ++++++++++++++++--- .../client/client_requests_counter.go | 13 +++++ xds/internal/client/load/store.go | 7 ++- xds/internal/client/load/store_test.go | 3 +- xds/internal/testutils/protos.go | 7 ++- 6 files changed, 71 insertions(+), 12 deletions(-) diff --git a/xds/internal/balancer/edsbalancer/eds_impl.go b/xds/internal/balancer/edsbalancer/eds_impl.go index 17a41ef18e75..8c34e4b9d436 100644 --- a/xds/internal/balancer/edsbalancer/eds_impl.go +++ b/xds/internal/balancer/edsbalancer/eds_impl.go @@ -515,6 +515,11 @@ func (d *dropPicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { } if d.counter != nil { if err := d.counter.StartRequest(); err != nil { + // Drops by circuit breaking are reported with empty category. They + // will be reported only in total drops, but not in per category. + if d.loadStore != nil { + d.loadStore.CallDropped("") + } return balancer.PickResult{}, status.Errorf(codes.Unavailable, err.Error()) } pr, err := d.p.Pick(info) diff --git a/xds/internal/balancer/edsbalancer/eds_impl_test.go b/xds/internal/balancer/edsbalancer/eds_impl_test.go index 2eec6be30f10..b4349a021dca 100644 --- a/xds/internal/balancer/edsbalancer/eds_impl_test.go +++ b/xds/internal/balancer/edsbalancer/eds_impl_test.go @@ -142,7 +142,7 @@ func (s) TestEDS_OneLocality(t *testing.T) { } // The same locality, different drop rate, dropping 50%. - clab5 := testutils.NewClusterLoadAssignmentBuilder(testClusterNames[0], []uint32{50}) + clab5 := testutils.NewClusterLoadAssignmentBuilder(testClusterNames[0], map[string]uint32{"test-drop": 50}) clab5.AddLocality(testSubZones[0], 1, 0, testEndpointAddrs[2:3], nil) edsb.handleEDSResponse(parseEDSRespProtoForTesting(clab5.Build())) @@ -746,6 +746,10 @@ func (s) TestDropPicker(t *testing.T) { } func (s) TestEDS_LoadReport(t *testing.T) { + origCircuitBreakingSupport := env.CircuitBreakingSupport + env.CircuitBreakingSupport = true + defer func() { env.CircuitBreakingSupport = origCircuitBreakingSupport }() + // We create an xdsClientWrapper with a dummy xdsClientInterface which only // implements the LoadStore() method to return the underlying load.Store to // be used. @@ -758,10 +762,20 @@ func (s) TestEDS_LoadReport(t *testing.T) { edsb := newEDSBalancerImpl(cc, nil, lsWrapper, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState + const ( + testServiceName = "test-service" + cbMaxRequests = 20 + ) + var maxRequestsTemp uint32 = cbMaxRequests + client.SetMaxRequests(testServiceName, &maxRequestsTemp) + defer client.ClearCounterForTesting(testServiceName) + edsb.updateServiceRequestsCounter(testServiceName) + backendToBalancerID := make(map[balancer.SubConn]internal.LocalityID) + const testDropCategory = "test-drop" // Two localities, each with one backend. - clab1 := testutils.NewClusterLoadAssignmentBuilder(testClusterNames[0], nil) + clab1 := testutils.NewClusterLoadAssignmentBuilder(testClusterNames[0], map[string]uint32{testDropCategory: 50}) clab1.AddLocality(testSubZones[0], 1, 0, testEndpointAddrs[:1], nil) edsb.handleEDSResponse(parseEDSRespProtoForTesting(clab1.Build())) sc1 := <-cc.NewSubConnCh @@ -788,20 +802,42 @@ func (s) TestEDS_LoadReport(t *testing.T) { // the picks on sc1 should show up as inProgress. locality1JSON, _ := locality1.ToString() locality2JSON, _ := locality2.ToString() + const ( + rpcCount = 100 + // 50% will be dropped with category testDropCategory. + dropWithCategory = rpcCount / 2 + // In the remaining RPCs, only cbMaxRequests are allowed by circuit + // breaking. Others will be dropped by CB. + dropWithCB = rpcCount - dropWithCategory - cbMaxRequests + + rpcInProgress = cbMaxRequests / 2 // 50% of RPCs will be never done. + rpcSucceeded = cbMaxRequests / 2 // 50% of RPCs will succeed. + ) wantStoreData := []*load.Data{{ Cluster: testClusterNames[0], Service: "", LocalityStats: map[string]load.LocalityData{ - locality1JSON: {RequestStats: load.RequestData{InProgress: 5}}, - locality2JSON: {RequestStats: load.RequestData{Succeeded: 5}}, + locality1JSON: {RequestStats: load.RequestData{InProgress: rpcInProgress}}, + locality2JSON: {RequestStats: load.RequestData{Succeeded: rpcSucceeded}}, + }, + TotalDrops: dropWithCategory + dropWithCB, + Drops: map[string]uint64{ + testDropCategory: dropWithCategory, }, }} - for i := 0; i < 10; i++ { + + var rpcsToBeDone []balancer.PickResult + // Run the picks, but only pick with sc1 will be done later. + for i := 0; i < rpcCount; i++ { scst, _ := p1.Pick(balancer.PickInfo{}) if scst.Done != nil && scst.SubConn != sc1 { - scst.Done(balancer.DoneInfo{}) + rpcsToBeDone = append(rpcsToBeDone, scst) } } + // Call done on those sc1 picks. + for _, scst := range rpcsToBeDone { + scst.Done(balancer.DoneInfo{}) + } gotStoreData := loadStore.Stats(testClusterNames[0:1]) if diff := cmp.Diff(wantStoreData, gotStoreData, cmpopts.EquateEmpty(), cmpopts.IgnoreFields(load.Data{}, "ReportInterval")); diff != "" { diff --git a/xds/internal/client/client_requests_counter.go b/xds/internal/client/client_requests_counter.go index 1e28fc003ff3..74b80f1c3f7c 100644 --- a/xds/internal/client/client_requests_counter.go +++ b/xds/internal/client/client_requests_counter.go @@ -87,3 +87,16 @@ func (c *ServiceRequestsCounter) StartRequest() error { func (c *ServiceRequestsCounter) EndRequest() { atomic.AddUint32(&c.numRequests, ^uint32(0)) } + +// ClearCounterForTesting clears the counter for the service. Should be only +// used in tests. +func ClearCounterForTesting(serviceName string) { + src.mu.Lock() + defer src.mu.Unlock() + c, ok := src.services[serviceName] + if !ok { + return + } + c.maxRequests = defaultMaxRequests + c.numRequests = 0 +} diff --git a/xds/internal/client/load/store.go b/xds/internal/client/load/store.go index a6ec1ec337cd..551a5147b6bd 100644 --- a/xds/internal/client/load/store.go +++ b/xds/internal/client/load/store.go @@ -283,7 +283,12 @@ func (ls *perClusterStore) stats() *Data { return true } sd.TotalDrops += d - sd.Drops[key.(string)] = d + keyStr := key.(string) + if keyStr != "" { + // Skip drops without category. They are counted in total_drops, but + // not in per category. One example is drops by circuit breaking. + sd.Drops[keyStr] = d + } return true }) ls.localityRPCCount.Range(func(key, val interface{}) bool { diff --git a/xds/internal/client/load/store_test.go b/xds/internal/client/load/store_test.go index 4d62ebc4c621..46568591f9e4 100644 --- a/xds/internal/client/load/store_test.go +++ b/xds/internal/client/load/store_test.go @@ -47,9 +47,10 @@ func TestDrops(t *testing.T) { drops = map[string]int{ dropCategories[0]: 30, dropCategories[1]: 40, + "": 10, } wantStoreData = &Data{ - TotalDrops: 70, + TotalDrops: 80, Drops: map[string]uint64{ dropCategories[0]: 30, dropCategories[1]: 40, diff --git a/xds/internal/testutils/protos.go b/xds/internal/testutils/protos.go index 25a0944d96dc..e0dba0e2b301 100644 --- a/xds/internal/testutils/protos.go +++ b/xds/internal/testutils/protos.go @@ -18,7 +18,6 @@ package testutils import ( - "fmt" "net" "strconv" @@ -59,11 +58,11 @@ type ClusterLoadAssignmentBuilder struct { } // NewClusterLoadAssignmentBuilder creates a ClusterLoadAssignmentBuilder. -func NewClusterLoadAssignmentBuilder(clusterName string, dropPercents []uint32) *ClusterLoadAssignmentBuilder { +func NewClusterLoadAssignmentBuilder(clusterName string, dropPercents map[string]uint32) *ClusterLoadAssignmentBuilder { var drops []*v2xdspb.ClusterLoadAssignment_Policy_DropOverload - for i, d := range dropPercents { + for n, d := range dropPercents { drops = append(drops, &v2xdspb.ClusterLoadAssignment_Policy_DropOverload{ - Category: fmt.Sprintf("test-drop-%d", i), + Category: n, DropPercentage: &v2typepb.FractionalPercent{ Numerator: d, Denominator: v2typepb.FractionalPercent_HUNDRED, From f005af03c24d49a4ec379884392cc4a557a0d047 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Wed, 3 Feb 2021 13:21:42 -0800 Subject: [PATCH 24/37] examples: delete profiling example since profiling support was rolled back (#4182) --- examples/features/profiling/README.md | 261 --------------------- examples/features/profiling/client/main.go | 89 ------- examples/features/profiling/server/main.go | 69 ------ 3 files changed, 419 deletions(-) delete mode 100644 examples/features/profiling/README.md delete mode 100644 examples/features/profiling/client/main.go delete mode 100644 examples/features/profiling/server/main.go diff --git a/examples/features/profiling/README.md b/examples/features/profiling/README.md deleted file mode 100644 index 1fd80e9ada2d..000000000000 --- a/examples/features/profiling/README.md +++ /dev/null @@ -1,261 +0,0 @@ -# gRPC-Go Profiling - -- Author(s): adtac -- Status: Experimental -- Availability: gRPC-Go >= 1.27 -- Last updated: December 17, 2019 - -gRPC-Go has built-in profiling that can be used to generate a detailed timeline -of the lifecycle of an RPC request. This can be done on the client-side and the -server-side. This directory contains an example client-server implementation -with profiling enabled and some example commands you can run to remotely manage -profiling. - -Typically, there are three logically separate parts involved in integrating -profiling into your application: - -1. Register the `Profiling` service: this requires a simple code change in your - application. -1. Enable profiling when required: profiling is disabled by default and must be - enabled remotely or at server initialization. -1. Download and process profiling data: once your application has collected - enough profiling data, you must use a bundled command-line application to - download your data and process it to generate human-friendly visualization. - -## Registering the `Profiling` Service - -### Server-Side - -Typically, you would create and register a server like so (some Go is shortened -in the interest of brevity; please see the `server` subdirectory for a full -implementation): - -```go -import ( - "google.golang.org/grpc" - profsvc "google.golang.org/grpc/profiling/service" - pb "google.golang.org/grpc/examples/features/proto/echo" -) - -type server struct{} - -func main() error { - s := grpc.NewServer() - pb.RegisterEchoServer(s, &server{}) - - // Include this to register a profiling-specific service within your server. - if err := profsvc.Init(&profsvc.ProfilingConfig{Server: s}); err != nil { - fmt.Printf("error calling profsvc.Init: %v\n", err) - return - } - - lis, _ := net.Listen("tcp", address) - s.Serve(lis) -} -``` - -To register your server for profiling, simply call the `profsvc.Init` method -as shown above. The passed `ProfilingConfig` parameter must set the `Server` -field to a server that is being served on a TCP address. - -### Client-Side - -To register profiling on the client-side, you must create a server to expose -your profiling data in order for it to be retrievable. To do this, it is -recommended that you create a dummy, dedicated server with no service other -than profiling's. See the `client` directory for an example client. - -## Enabling/Disabling Profiling - -Once profiling is baked into your server (unless otherwise specified, from here -on, the word "server" will be used to refer to a `grpc.Server`, not the -server/client distinction from the previous subsection), you need to enable -profiling. There are three ways to do this -- at initialization, remotely -post-initialization, or programmatically within Go. - -### Enabling Profiling at Initialization - -To force profiling to start measuring data right from the first RPC, set the -`Enabled` attribute of the `ProfilingConfig` struct to `true` when you are -initializing profiling. - -```go - // Set Enabled: true to turn profiling on at initialization time. - profsvc.Init(&profsvc.ProfilingConfig{ - Server: s, - Enabled: true, - }) -``` - -### Enabling/Disabling Remotely - -Alternatively, you can enable/disable profiling any time after server -initialization by using a bundled command-line tool designed for remote -profiling management. Assuming `example.com:50051` is the address of the server -that you would like to enable profiling in, do the following: - -```bash -$ go run google.golang.org/grpc/profiling/cmd \ - -address example.com:50051 \ - -enable-profiling -``` - -Similarly, running the command with `-disable-profiling` can be used to disable -profiling remotely. - - -### Enabling/Disabling Within Go - -In addition to the remote service that is exposed, you may enable/disable -profiling within your application in Go: - -```go -import ( - "google.golang.org/grpc/profiling" -) - -func setProfiling(enable bool) { - profiling.Enable(true) -} -``` - -The `profiling.Enable` function can be safely accessed and called concurrently. - -## Downloading and Processing Profiling Data - -Once your server has collected enough profiling data, you may want to download -that data and perform some analysis on the retrieved data. The aforementioned -command-line application within gRPC comes bundled with support for both -operations. - -To retrieve profiling data from a remote server, run the following command: - -```bash -$ go run google.golang.org/grpc/profiling/cmd \ - -address example.com:50051 \ - -retrieve-snapshot \ - -snapshot /path/to/snapshot -``` - -You must provide a path to `-snapshot` that can be written to. This file will -store the retrieved data in a raw and binary form. - -To process this data into a human-consumable such as -[Catapult's trace-viewer format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview): - -```bash -$ go run google.golang.org/grpc/profiling/cmd \ - -snapshot /path/to/snapshot \ - -stream-stats-catapult-json /path/to/json -``` - -This would read the data stored in `/path/to/snapshot` and process it to -generate a JSON format that is understood by Chromium's -[Catapult project](https://chromium.googlesource.com/catapult). -The Catapult project comes with a utility called -[trace-viewer](https://chromium.googlesource.com/catapult/+/HEAD/tracing/README.md), -which can be used to generate human-readable visualizations: - -```bash -$ git clone https://chromium.googlesource.com/catapult /path/to/catapult -$ /path/to/catapult/tracing/bin/trace2html /path/to/json --output=/path/to/html -``` - -When the generated `/path/to/html` file is opened with a browser, you will be -presented with a detailed visualization of the lifecycle of all RPC requests. -To learn more about trace-viewer and how to navigate the generated HTML, see -[this](https://chromium.googlesource.com/catapult/+/HEAD/tracing/README.md). - -## Frequently Asked Questions - -##### I have multiple `grpc.Server`s in my application. Can I register profiling with just one of them? - -You may not call `profsvc.Init` more than once -- all calls except for the -first one will return an error. As a corollary, it is also not possible to -register or enable/disable profiling for just one `grpc.Server` or operation. -That is, you can enable/disable profiling globally for all gRPC operations or -none at all. - -##### Is `google.golang.org/grpc/profiling/cmd` the canonical implementation of a client that can talk to the profiling service? - -No, the command-line tool is simply provided as a reference implementation and -as a convenience. You are free to write your own tool as long as it can -communicate using the underlying protocol buffers. - -##### Is Catapult's `trace-viewer` the only option that is supported? - -Currently, yes. However, support for other (or better) visualization tools is -welcome. - -##### What is the impact of profiling on application performance? - -When turned off, profiling has virtually no impact on the performance (QPS, -latency, memory footprint) of your application. However, when turned on, expect -a 5-10% throughput/latency penalty and double the memory footprint. - -Profiling is mostly used by gRPC-Go devs. However, if you foresee using -profiling in production machines, because of the negligible impact of profiling -when turned off, you may want to register/initialize your applications with -profiling (but leave it turned off). This will be useful in the off-chance you -want to debug an application later -- in such an event, you can simply remotely -toggle profiling using the `go run` command previously described to enable -profiling data collection. Once you're confident that enough profiling data has -been measured, you can turn it off again and retrieve the data for -post-processing (see previous section). - -##### How many RPCs worth of data is stored by profiling? I'd like to restrict the memory footprint of gRPC's profiling framework to a fixed amount. - -By default, at any given time, the last 214 RPCs worth of data is -stored by profiling. Newly generated profiling data overwrites older data. Note -that the internal data structure is not strictly LIFO in order to be performant -(but is approximately LIFO). All profiling data is timestamped anyway, so -a LIFO property is unnecessary. - -This number is configurable. When registering your server with profiling, you -may specify the number of samples that should be stored, like so: - -```go - // Setting StreamStatsSize: 1024 will make profiling store the last 1024 - // RPCs' data (if profiling is enabled, of course). - profsvc.Init(&profsvc.ProfilingConfig{ - Server: s, - StreamStatsSize: 1024, - }) -``` - -As an estimate, a typical unary RPC is expected produce ~2-3 KiB of profiling -data in memory. This may be useful in estimating how many RPCs worth of data -you can afford depending on your memory capacity. For more complex RPCs such as -streaming RPCs, each RPC will consume more data. The amount of memory consumed -by profiling is mostly independent of the size of messages your application -handles. - -##### The generated visualization is flat and has no flows/arrows. How do I distinguish between different RPCs? - -Unfortunately, there isn't any way to do this without some changes to the way -your application is compiled. This is because gRPC's profiling relies on the -Goroutine ID to uniquely identify different components. - -To enable this, first apply the following patch to your Go runtime installation -directory: - -```diff -diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go ---- a/src/runtime/runtime2.go -+++ b/src/runtime/runtime2.go -@@ -392,6 +392,10 @@ type stack struct { - hi uintptr - } - -+func Goid() int64 { -+ return getg().goid -+} -+ - type g struct { - // Stack parameters. - // stack describes the actual stack memory: [stack.lo, stack.hi). -``` - -Then, recompile your application with `-tags grpcgoid` to generate a new -binary. This binary should produce profiling data that is much nicer when -visualized. diff --git a/examples/features/profiling/client/main.go b/examples/features/profiling/client/main.go deleted file mode 100644 index d899e47dadb0..000000000000 --- a/examples/features/profiling/client/main.go +++ /dev/null @@ -1,89 +0,0 @@ -/* - * - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// Binary client is an example client. -package main - -import ( - "context" - "flag" - "fmt" - "log" - "net" - "time" - - "google.golang.org/grpc" - pb "google.golang.org/grpc/examples/features/proto/echo" - profsvc "google.golang.org/grpc/profiling/service" -) - -var addr = flag.String("addr", "localhost:50051", "the address to connect to") -var profilingPort = flag.Int("profilingPort", 50052, "port to expose the profiling service on") - -func setupClientProfiling() error { - lis, err := net.Listen("tcp", fmt.Sprintf(":%d", *profilingPort)) - if err != nil { - log.Printf("failed to listen: %v\n", err) - return err - } - fmt.Printf("server listening at %v\n", lis.Addr()) - - s := grpc.NewServer() - - // Register this grpc.Server with profiling. - pc := &profsvc.ProfilingConfig{ - Server: s, - Enabled: true, - StreamStatsSize: 1024, - } - if err = profsvc.Init(pc); err != nil { - fmt.Printf("error calling profsvc.Init: %v\n", err) - return err - } - - go s.Serve(lis) - return nil -} - -func main() { - flag.Parse() - - if err := setupClientProfiling(); err != nil { - log.Fatalf("error setting up profiling: %v\n", err) - } - - // Set up a connection to the server. - conn, err := grpc.Dial(*addr, grpc.WithInsecure(), grpc.WithBlock()) - if err != nil { - log.Fatalf("did not connect: %v", err) - } - defer conn.Close() - - c := pb.NewEchoClient(conn) - - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - res, err := c.UnaryEcho(ctx, &pb.EchoRequest{Message: "hello, profiling"}) - fmt.Printf("UnaryEcho call returned %q, %v\n", res.GetMessage(), err) - if err != nil { - log.Fatalf("error calling UnaryEcho: %v", err) - } - - log.Printf("sleeping for 30 seconds with exposed profiling service on :%d\n", *profilingPort) - time.Sleep(30 * time.Second) -} diff --git a/examples/features/profiling/server/main.go b/examples/features/profiling/server/main.go deleted file mode 100644 index ee0a4f55ab2e..000000000000 --- a/examples/features/profiling/server/main.go +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// Binary server is an example server. -package main - -import ( - "context" - "flag" - "fmt" - "log" - "net" - - "google.golang.org/grpc" - pb "google.golang.org/grpc/examples/features/proto/echo" - profsvc "google.golang.org/grpc/profiling/service" -) - -var port = flag.Int("port", 50051, "the port to serve on") - -type server struct { - pb.UnimplementedEchoServer -} - -func (s *server) UnaryEcho(ctx context.Context, in *pb.EchoRequest) (*pb.EchoResponse, error) { - fmt.Printf("UnaryEcho called with message %q\n", in.GetMessage()) - return &pb.EchoResponse{Message: in.Message}, nil -} - -func main() { - flag.Parse() - - lis, err := net.Listen("tcp", fmt.Sprintf(":%d", *port)) - if err != nil { - log.Fatalf("failed to listen: %v", err) - } - fmt.Printf("server listening at %v\n", lis.Addr()) - - s := grpc.NewServer() - pb.RegisterEchoServer(s, &server{}) - - // Register your grpc.Server with profiling. - pc := &profsvc.ProfilingConfig{ - Server: s, - Enabled: true, - StreamStatsSize: 1024, - } - if err = profsvc.Init(pc); err != nil { - fmt.Printf("error calling profsvc.Init: %v\n", err) - return - } - - s.Serve(lis) -} From 7b8d65a7bc4446f61cceb8ee679847c100a07695 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Thu, 4 Feb 2021 14:11:50 -0800 Subject: [PATCH 25/37] xds: rename internal/client files to remove client prefix (#4188) --- xds/internal/client/{client_callback.go => callback.go} | 0 xds/internal/client/{client_cds_test.go => cds_test.go} | 0 xds/internal/client/{client_eds_test.go => eds_test.go} | 0 xds/internal/client/{client_lds_test.go => lds_test.go} | 0 xds/internal/client/{client_loadreport.go => loadreport.go} | 0 .../client/{client_loadreport_test.go => loadreport_test.go} | 0 xds/internal/client/{client_logging.go => logging.go} | 0 xds/internal/client/{client_rds_test.go => rds_test.go} | 0 .../client/{client_requests_counter.go => requests_counter.go} | 0 .../{client_requests_counter_test.go => requests_counter_test.go} | 0 xds/internal/client/{client_singleton.go => singleton.go} | 0 xds/internal/client/v2/{client_ack_test.go => ack_test.go} | 0 xds/internal/client/v2/{client_cds_test.go => cds_test.go} | 0 xds/internal/client/v2/{client_eds_test.go => eds_test.go} | 0 xds/internal/client/v2/{client_lds_test.go => lds_test.go} | 0 xds/internal/client/v2/{client_rds_test.go => rds_test.go} | 0 xds/internal/client/{client_watchers.go => watchers.go} | 0 .../{client_watchers_cluster_test.go => watchers_cluster_test.go} | 0 ...ient_watchers_endpoints_test.go => watchers_endpoints_test.go} | 0 ...client_watchers_listener_test.go => watchers_listener_test.go} | 0 .../{client_watchers_route_test.go => watchers_route_test.go} | 0 xds/internal/client/{client_xds.go => xds.go} | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename xds/internal/client/{client_callback.go => callback.go} (100%) rename xds/internal/client/{client_cds_test.go => cds_test.go} (100%) rename xds/internal/client/{client_eds_test.go => eds_test.go} (100%) rename xds/internal/client/{client_lds_test.go => lds_test.go} (100%) rename xds/internal/client/{client_loadreport.go => loadreport.go} (100%) rename xds/internal/client/{client_loadreport_test.go => loadreport_test.go} (100%) rename xds/internal/client/{client_logging.go => logging.go} (100%) rename xds/internal/client/{client_rds_test.go => rds_test.go} (100%) rename xds/internal/client/{client_requests_counter.go => requests_counter.go} (100%) rename xds/internal/client/{client_requests_counter_test.go => requests_counter_test.go} (100%) rename xds/internal/client/{client_singleton.go => singleton.go} (100%) rename xds/internal/client/v2/{client_ack_test.go => ack_test.go} (100%) rename xds/internal/client/v2/{client_cds_test.go => cds_test.go} (100%) rename xds/internal/client/v2/{client_eds_test.go => eds_test.go} (100%) rename xds/internal/client/v2/{client_lds_test.go => lds_test.go} (100%) rename xds/internal/client/v2/{client_rds_test.go => rds_test.go} (100%) rename xds/internal/client/{client_watchers.go => watchers.go} (100%) rename xds/internal/client/{client_watchers_cluster_test.go => watchers_cluster_test.go} (100%) rename xds/internal/client/{client_watchers_endpoints_test.go => watchers_endpoints_test.go} (100%) rename xds/internal/client/{client_watchers_listener_test.go => watchers_listener_test.go} (100%) rename xds/internal/client/{client_watchers_route_test.go => watchers_route_test.go} (100%) rename xds/internal/client/{client_xds.go => xds.go} (100%) diff --git a/xds/internal/client/client_callback.go b/xds/internal/client/callback.go similarity index 100% rename from xds/internal/client/client_callback.go rename to xds/internal/client/callback.go diff --git a/xds/internal/client/client_cds_test.go b/xds/internal/client/cds_test.go similarity index 100% rename from xds/internal/client/client_cds_test.go rename to xds/internal/client/cds_test.go diff --git a/xds/internal/client/client_eds_test.go b/xds/internal/client/eds_test.go similarity index 100% rename from xds/internal/client/client_eds_test.go rename to xds/internal/client/eds_test.go diff --git a/xds/internal/client/client_lds_test.go b/xds/internal/client/lds_test.go similarity index 100% rename from xds/internal/client/client_lds_test.go rename to xds/internal/client/lds_test.go diff --git a/xds/internal/client/client_loadreport.go b/xds/internal/client/loadreport.go similarity index 100% rename from xds/internal/client/client_loadreport.go rename to xds/internal/client/loadreport.go diff --git a/xds/internal/client/client_loadreport_test.go b/xds/internal/client/loadreport_test.go similarity index 100% rename from xds/internal/client/client_loadreport_test.go rename to xds/internal/client/loadreport_test.go diff --git a/xds/internal/client/client_logging.go b/xds/internal/client/logging.go similarity index 100% rename from xds/internal/client/client_logging.go rename to xds/internal/client/logging.go diff --git a/xds/internal/client/client_rds_test.go b/xds/internal/client/rds_test.go similarity index 100% rename from xds/internal/client/client_rds_test.go rename to xds/internal/client/rds_test.go diff --git a/xds/internal/client/client_requests_counter.go b/xds/internal/client/requests_counter.go similarity index 100% rename from xds/internal/client/client_requests_counter.go rename to xds/internal/client/requests_counter.go diff --git a/xds/internal/client/client_requests_counter_test.go b/xds/internal/client/requests_counter_test.go similarity index 100% rename from xds/internal/client/client_requests_counter_test.go rename to xds/internal/client/requests_counter_test.go diff --git a/xds/internal/client/client_singleton.go b/xds/internal/client/singleton.go similarity index 100% rename from xds/internal/client/client_singleton.go rename to xds/internal/client/singleton.go diff --git a/xds/internal/client/v2/client_ack_test.go b/xds/internal/client/v2/ack_test.go similarity index 100% rename from xds/internal/client/v2/client_ack_test.go rename to xds/internal/client/v2/ack_test.go diff --git a/xds/internal/client/v2/client_cds_test.go b/xds/internal/client/v2/cds_test.go similarity index 100% rename from xds/internal/client/v2/client_cds_test.go rename to xds/internal/client/v2/cds_test.go diff --git a/xds/internal/client/v2/client_eds_test.go b/xds/internal/client/v2/eds_test.go similarity index 100% rename from xds/internal/client/v2/client_eds_test.go rename to xds/internal/client/v2/eds_test.go diff --git a/xds/internal/client/v2/client_lds_test.go b/xds/internal/client/v2/lds_test.go similarity index 100% rename from xds/internal/client/v2/client_lds_test.go rename to xds/internal/client/v2/lds_test.go diff --git a/xds/internal/client/v2/client_rds_test.go b/xds/internal/client/v2/rds_test.go similarity index 100% rename from xds/internal/client/v2/client_rds_test.go rename to xds/internal/client/v2/rds_test.go diff --git a/xds/internal/client/client_watchers.go b/xds/internal/client/watchers.go similarity index 100% rename from xds/internal/client/client_watchers.go rename to xds/internal/client/watchers.go diff --git a/xds/internal/client/client_watchers_cluster_test.go b/xds/internal/client/watchers_cluster_test.go similarity index 100% rename from xds/internal/client/client_watchers_cluster_test.go rename to xds/internal/client/watchers_cluster_test.go diff --git a/xds/internal/client/client_watchers_endpoints_test.go b/xds/internal/client/watchers_endpoints_test.go similarity index 100% rename from xds/internal/client/client_watchers_endpoints_test.go rename to xds/internal/client/watchers_endpoints_test.go diff --git a/xds/internal/client/client_watchers_listener_test.go b/xds/internal/client/watchers_listener_test.go similarity index 100% rename from xds/internal/client/client_watchers_listener_test.go rename to xds/internal/client/watchers_listener_test.go diff --git a/xds/internal/client/client_watchers_route_test.go b/xds/internal/client/watchers_route_test.go similarity index 100% rename from xds/internal/client/client_watchers_route_test.go rename to xds/internal/client/watchers_route_test.go diff --git a/xds/internal/client/client_xds.go b/xds/internal/client/xds.go similarity index 100% rename from xds/internal/client/client_xds.go rename to xds/internal/client/xds.go From b753f4903c1b09ced50ae223b439a771aff798f9 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 4 Feb 2021 20:13:54 -0800 Subject: [PATCH 26/37] xds testing: increase timeout from 90 minutes to 120 minutes (#4191) This is the timeout for all the tests, after which the VM will be termiated. Since now we have more tests, we need more time. The current average is around 85-90 minutes. The extra 30 minutes should be enough for several new tests. --- test/kokoro/xds.cfg | 2 +- test/kokoro/xds_v3.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/kokoro/xds.cfg b/test/kokoro/xds.cfg index 09ab0dacc463..d1a078217b84 100644 --- a/test/kokoro/xds.cfg +++ b/test/kokoro/xds.cfg @@ -2,7 +2,7 @@ # Location of the continuous shell script in repository. build_file: "grpc-go/test/kokoro/xds.sh" -timeout_mins: 90 +timeout_mins: 120 action { define_artifacts { regex: "**/*sponge_log.*" diff --git a/test/kokoro/xds_v3.cfg b/test/kokoro/xds_v3.cfg index fc4949e280d9..c4c8aad9e6f2 100644 --- a/test/kokoro/xds_v3.cfg +++ b/test/kokoro/xds_v3.cfg @@ -2,7 +2,7 @@ # Location of the continuous shell script in repository. build_file: "grpc-go/test/kokoro/xds_v3.sh" -timeout_mins: 90 +timeout_mins: 120 action { define_artifacts { regex: "**/*sponge_log.*" From 9280052d36656451dd7568a18a836c2a74edaf6c Mon Sep 17 00:00:00 2001 From: Easwar Swaminathan Date: Sun, 7 Feb 2021 19:55:33 -0800 Subject: [PATCH 27/37] balancergroup: Propagate balancer.BuildOptions to child policies (#4184) --- .../balancer/balancergroup/balancergroup.go | 11 +++- .../balancergroup/balancergroup_test.go | 58 +++++++++++++++++-- .../balancer/clustermanager/clustermanager.go | 4 +- .../clustermanager/clustermanager_test.go | 55 ++++++++++++++++++ xds/internal/balancer/edsbalancer/eds.go | 8 +-- xds/internal/balancer/edsbalancer/eds_impl.go | 7 ++- .../edsbalancer/eds_impl_priority_test.go | 20 +++---- .../balancer/edsbalancer/eds_impl_test.go | 49 +++++++++++----- xds/internal/balancer/edsbalancer/eds_test.go | 2 +- .../balancer/weightedtarget/weightedtarget.go | 4 +- xds/internal/client/v3/client.go | 2 +- xds/internal/testutils/balancer.go | 40 ------------- 12 files changed, 175 insertions(+), 85 deletions(-) diff --git a/xds/internal/balancer/balancergroup/balancergroup.go b/xds/internal/balancer/balancergroup/balancergroup.go index d646355191c3..2ec576a4b572 100644 --- a/xds/internal/balancer/balancergroup/balancergroup.go +++ b/xds/internal/balancer/balancergroup/balancergroup.go @@ -60,6 +60,8 @@ type subBalancerWrapper struct { // The static part of sub-balancer. Keeps balancerBuilders and addresses. // To be used when restarting sub-balancer. builder balancer.Builder + // Options to be passed to sub-balancer at the time of creation. + buildOpts balancer.BuildOptions // ccState is a cache of the addresses/balancer config, so when the balancer // is restarted after close, it will get the previous update. It's a pointer // and is set to nil at init, so when the balancer is built for the first @@ -94,7 +96,7 @@ func (sbc *subBalancerWrapper) updateBalancerStateWithCachedPicker() { } func (sbc *subBalancerWrapper) startBalancer() { - b := sbc.builder.Build(sbc, balancer.BuildOptions{}) + b := sbc.builder.Build(sbc, sbc.buildOpts) sbc.group.logger.Infof("Created child policy %p of type %v", b, sbc.builder.Name()) sbc.balancer = b if sbc.ccState != nil { @@ -179,6 +181,7 @@ func (sbc *subBalancerWrapper) stopBalancer() { // balancer group. type BalancerGroup struct { cc balancer.ClientConn + buildOpts balancer.BuildOptions logger *grpclog.PrefixLogger loadStore load.PerClusterReporter @@ -235,9 +238,12 @@ var DefaultSubBalancerCloseTimeout = 15 * time.Minute // New creates a new BalancerGroup. Note that the BalancerGroup // needs to be started to work. -func New(cc balancer.ClientConn, stateAggregator BalancerStateAggregator, loadStore load.PerClusterReporter, logger *grpclog.PrefixLogger) *BalancerGroup { +// +// TODO(easwars): Pass an options struct instead of N args. +func New(cc balancer.ClientConn, bOpts balancer.BuildOptions, stateAggregator BalancerStateAggregator, loadStore load.PerClusterReporter, logger *grpclog.PrefixLogger) *BalancerGroup { return &BalancerGroup{ cc: cc, + buildOpts: bOpts, logger: logger, loadStore: loadStore, @@ -305,6 +311,7 @@ func (bg *BalancerGroup) Add(id string, builder balancer.Builder) { id: id, group: bg, builder: builder, + buildOpts: bg.buildOpts, } if bg.outgoingStarted { // Only start the balancer if bg is started. Otherwise, we only keep the diff --git a/xds/internal/balancer/balancergroup/balancergroup_test.go b/xds/internal/balancer/balancergroup/balancergroup_test.go index 0474e7c722e8..0ad4bf8df10f 100644 --- a/xds/internal/balancer/balancergroup/balancergroup_test.go +++ b/xds/internal/balancer/balancergroup/balancergroup_test.go @@ -38,6 +38,8 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/roundrobin" "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/internal/balancer/stub" "google.golang.org/grpc/resolver" "google.golang.org/grpc/xds/internal/balancer/weightedtarget/weightedaggregator" "google.golang.org/grpc/xds/internal/client/load" @@ -74,7 +76,7 @@ func newTestBalancerGroup(t *testing.T, loadStore load.PerClusterReporter) (*tes cc := testutils.NewTestClientConn(t) gator := weightedaggregator.New(cc, nil, testutils.NewTestWRR) gator.Start() - bg := New(cc, gator, loadStore, nil) + bg := New(cc, balancer.BuildOptions{}, gator, loadStore, nil) bg.Start() return cc, gator, bg } @@ -501,7 +503,7 @@ func (s) TestBalancerGroup_start_close(t *testing.T) { cc := testutils.NewTestClientConn(t) gator := weightedaggregator.New(cc, nil, testutils.NewTestWRR) gator.Start() - bg := New(cc, gator, nil, nil) + bg := New(cc, balancer.BuildOptions{}, gator, nil, nil) // Add two balancers to group and send two resolved addresses to both // balancers. @@ -590,16 +592,20 @@ func (s) TestBalancerGroup_start_close(t *testing.T) { // whenever it gets an address update. It's expected that start() doesn't block // because of deadlock. func (s) TestBalancerGroup_start_close_deadlock(t *testing.T) { + const balancerName = "stub-TestBalancerGroup_start_close_deadlock" + stub.Register(balancerName, stub.BalancerFuncs{}) + builder := balancer.Get(balancerName) + cc := testutils.NewTestClientConn(t) gator := weightedaggregator.New(cc, nil, testutils.NewTestWRR) gator.Start() - bg := New(cc, gator, nil, nil) + bg := New(cc, balancer.BuildOptions{}, gator, nil, nil) gator.Add(testBalancerIDs[0], 2) - bg.Add(testBalancerIDs[0], &testutils.TestConstBalancerBuilder{}) + bg.Add(testBalancerIDs[0], builder) bg.UpdateClientConnState(testBalancerIDs[0], balancer.ClientConnState{ResolverState: resolver.State{Addresses: testBackendAddrs[0:2]}}) gator.Add(testBalancerIDs[1], 1) - bg.Add(testBalancerIDs[1], &testutils.TestConstBalancerBuilder{}) + bg.Add(testBalancerIDs[1], builder) bg.UpdateClientConnState(testBalancerIDs[1], balancer.ClientConnState{ResolverState: resolver.State{Addresses: testBackendAddrs[2:4]}}) bg.Start() @@ -695,7 +701,7 @@ func initBalancerGroupForCachingTest(t *testing.T) (*weightedaggregator.Aggregat cc := testutils.NewTestClientConn(t) gator := weightedaggregator.New(cc, nil, testutils.NewTestWRR) gator.Start() - bg := New(cc, gator, nil, nil) + bg := New(cc, balancer.BuildOptions{}, gator, nil, nil) // Add two balancers to group and send two resolved addresses to both // balancers. @@ -931,3 +937,43 @@ func (s) TestBalancerGroup_locality_caching_readd_with_different_builder(t *test t.Fatalf("want %v, got %v", want, err) } } + +// TestBalancerGroupBuildOptions verifies that the balancer.BuildOptions passed +// to the balancergroup at creation time is passed to child policies. +func (s) TestBalancerGroupBuildOptions(t *testing.T) { + const ( + balancerName = "stubBalancer-TestBalancerGroupBuildOptions" + parent = int64(1234) + userAgent = "ua" + defaultTestTimeout = 1 * time.Second + ) + + // Setup the stub balancer such that we can read the build options passed to + // it in the UpdateClientConnState method. + bOpts := balancer.BuildOptions{ + DialCreds: insecure.NewCredentials(), + ChannelzParentID: parent, + CustomUserAgent: userAgent, + } + stub.Register(balancerName, stub.BalancerFuncs{ + UpdateClientConnState: func(bd *stub.BalancerData, _ balancer.ClientConnState) error { + if !cmp.Equal(bd.BuildOptions, bOpts) { + return fmt.Errorf("buildOptions in child balancer: %v, want %v", bd, bOpts) + } + return nil + }, + }) + cc := testutils.NewTestClientConn(t) + bg := New(cc, bOpts, nil, nil, nil) + bg.Start() + + // Add the stub balancer build above as a child policy. + balancerBuilder := balancer.Get(balancerName) + bg.Add(testBalancerIDs[0], balancerBuilder) + + // Send an empty clientConn state change. This should trigger the + // verification of the buildOptions being passed to the child policy. + if err := bg.UpdateClientConnState(testBalancerIDs[0], balancer.ClientConnState{}); err != nil { + t.Fatal(err) + } +} diff --git a/xds/internal/balancer/clustermanager/clustermanager.go b/xds/internal/balancer/clustermanager/clustermanager.go index da5900ac75cf..1e4dee7f5d3a 100644 --- a/xds/internal/balancer/clustermanager/clustermanager.go +++ b/xds/internal/balancer/clustermanager/clustermanager.go @@ -40,12 +40,12 @@ func init() { type builder struct{} -func (builder) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer { +func (builder) Build(cc balancer.ClientConn, opts balancer.BuildOptions) balancer.Balancer { b := &bal{} b.logger = prefixLogger(b) b.stateAggregator = newBalancerStateAggregator(cc, b.logger) b.stateAggregator.start() - b.bg = balancergroup.New(cc, b.stateAggregator, nil, b.logger) + b.bg = balancergroup.New(cc, opts, b.stateAggregator, nil, b.logger) b.bg.Start() b.logger.Infof("Created") return b diff --git a/xds/internal/balancer/clustermanager/clustermanager_test.go b/xds/internal/balancer/clustermanager/clustermanager_test.go index 86c377937f36..a40d954ad64f 100644 --- a/xds/internal/balancer/clustermanager/clustermanager_test.go +++ b/xds/internal/balancer/clustermanager/clustermanager_test.go @@ -29,8 +29,11 @@ import ( "google.golang.org/grpc/balancer/roundrobin" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/internal/balancer/stub" "google.golang.org/grpc/internal/grpctest" "google.golang.org/grpc/internal/hierarchy" + itestutils "google.golang.org/grpc/internal/testutils" "google.golang.org/grpc/resolver" "google.golang.org/grpc/status" "google.golang.org/grpc/xds/internal/balancer/balancergroup" @@ -510,3 +513,55 @@ func TestRoutingConfigUpdateDeleteAll(t *testing.T) { testPick(t, p3, tt.pickInfo, tt.wantSC, tt.wantErr) } } + +func TestClusterManagerForwardsBalancerBuildOptions(t *testing.T) { + const ( + balancerName = "stubBalancer-TestClusterManagerForwardsBalancerBuildOptions" + parent = int64(1234) + userAgent = "ua" + defaultTestTimeout = 1 * time.Second + ) + + // Setup the stub balancer such that we can read the build options passed to + // it in the UpdateClientConnState method. + ccsCh := itestutils.NewChannel() + bOpts := balancer.BuildOptions{ + DialCreds: insecure.NewCredentials(), + ChannelzParentID: parent, + CustomUserAgent: userAgent, + } + stub.Register(balancerName, stub.BalancerFuncs{ + UpdateClientConnState: func(bd *stub.BalancerData, _ balancer.ClientConnState) error { + if !cmp.Equal(bd.BuildOptions, bOpts) { + err := fmt.Errorf("buildOptions in child balancer: %v, want %v", bd, bOpts) + ccsCh.Send(err) + return err + } + ccsCh.Send(nil) + return nil + }, + }) + + cc := testutils.NewTestClientConn(t) + rtb := rtBuilder.Build(cc, bOpts) + + configJSON1 := fmt.Sprintf(`{ +"children": { + "cds:cluster_1":{ "childPolicy": [{"%s":""}] } +} +}`, balancerName) + config1, err := rtParser.ParseConfig([]byte(configJSON1)) + if err != nil { + t.Fatalf("failed to parse balancer config: %v", err) + } + + if err := rtb.UpdateClientConnState(balancer.ClientConnState{BalancerConfig: config1}); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) + defer cancel() + if v, err := ccsCh.Receive(ctx); err != nil { + err2 := v.(error) + t.Fatal(err2) + } +} diff --git a/xds/internal/balancer/edsbalancer/eds.go b/xds/internal/balancer/edsbalancer/eds.go index 12a1251abe9f..a6b37f6277a1 100644 --- a/xds/internal/balancer/edsbalancer/eds.go +++ b/xds/internal/balancer/edsbalancer/eds.go @@ -48,8 +48,8 @@ type xdsClientInterface interface { } var ( - newEDSBalancer = func(cc balancer.ClientConn, enqueueState func(priorityType, balancer.State), lw load.PerClusterReporter, logger *grpclog.PrefixLogger) edsBalancerImplInterface { - return newEDSBalancerImpl(cc, enqueueState, lw, logger) + newEDSBalancer = func(cc balancer.ClientConn, opts balancer.BuildOptions, enqueueState func(priorityType, balancer.State), lw load.PerClusterReporter, logger *grpclog.PrefixLogger) edsBalancerImplInterface { + return newEDSBalancerImpl(cc, opts, enqueueState, lw, logger) } newXDSClient = func() (xdsClientInterface, error) { return xdsclient.New() } ) @@ -61,7 +61,7 @@ func init() { type edsBalancerBuilder struct{} // Build helps implement the balancer.Builder interface. -func (b *edsBalancerBuilder) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer { +func (b *edsBalancerBuilder) Build(cc balancer.ClientConn, opts balancer.BuildOptions) balancer.Balancer { x := &edsBalancer{ cc: cc, closed: grpcsync.NewEvent(), @@ -80,7 +80,7 @@ func (b *edsBalancerBuilder) Build(cc balancer.ClientConn, _ balancer.BuildOptio } x.xdsClient = client - x.edsImpl = newEDSBalancer(x.cc, x.enqueueChildBalancerState, x.lsw, x.logger) + x.edsImpl = newEDSBalancer(x.cc, opts, x.enqueueChildBalancerState, x.lsw, x.logger) x.logger.Infof("Created") go x.run() return x diff --git a/xds/internal/balancer/edsbalancer/eds_impl.go b/xds/internal/balancer/edsbalancer/eds_impl.go index 8c34e4b9d436..499ea5243b64 100644 --- a/xds/internal/balancer/edsbalancer/eds_impl.go +++ b/xds/internal/balancer/edsbalancer/eds_impl.go @@ -23,6 +23,7 @@ import ( "time" "github.com/google/go-cmp/cmp" + "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" "google.golang.org/grpc/balancer/roundrobin" @@ -65,6 +66,7 @@ type balancerGroupWithConfig struct { // policy is used to manage endpoints in each locality. type edsBalancerImpl struct { cc balancer.ClientConn + buildOpts balancer.BuildOptions logger *grpclog.PrefixLogger loadReporter load.PerClusterReporter @@ -102,9 +104,10 @@ type edsBalancerImpl struct { } // newEDSBalancerImpl create a new edsBalancerImpl. -func newEDSBalancerImpl(cc balancer.ClientConn, enqueueState func(priorityType, balancer.State), lr load.PerClusterReporter, logger *grpclog.PrefixLogger) *edsBalancerImpl { +func newEDSBalancerImpl(cc balancer.ClientConn, bOpts balancer.BuildOptions, enqueueState func(priorityType, balancer.State), lr load.PerClusterReporter, logger *grpclog.PrefixLogger) *edsBalancerImpl { edsImpl := &edsBalancerImpl{ cc: cc, + buildOpts: bOpts, logger: logger, subBalancerBuilder: balancer.Get(roundrobin.Name), loadReporter: lr, @@ -248,7 +251,7 @@ func (edsImpl *edsBalancerImpl) handleEDSResponse(edsResp xdsclient.EndpointsUpd ccPriorityWrapper := edsImpl.ccWrapperWithPriority(priority) stateAggregator := weightedaggregator.New(ccPriorityWrapper, edsImpl.logger, newRandomWRR) bgwc = &balancerGroupWithConfig{ - bg: balancergroup.New(ccPriorityWrapper, stateAggregator, edsImpl.loadReporter, edsImpl.logger), + bg: balancergroup.New(ccPriorityWrapper, edsImpl.buildOpts, stateAggregator, edsImpl.loadReporter, edsImpl.logger), stateAggregator: stateAggregator, configs: make(map[internal.LocalityID]*localityConfig), } diff --git a/xds/internal/balancer/edsbalancer/eds_impl_priority_test.go b/xds/internal/balancer/edsbalancer/eds_impl_priority_test.go index 1ce4f36ca73f..7696feb5bd04 100644 --- a/xds/internal/balancer/edsbalancer/eds_impl_priority_test.go +++ b/xds/internal/balancer/edsbalancer/eds_impl_priority_test.go @@ -35,7 +35,7 @@ import ( // Init 0 and 1; 0 is up, use 0; add 2, use 0; remove 2, use 0. func (s) TestEDSPriority_HighPriorityReady(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // Two localities, with priorities [0, 1], each with one backend. @@ -101,7 +101,7 @@ func (s) TestEDSPriority_HighPriorityReady(t *testing.T) { // down, use 2; remove 2, use 1. func (s) TestEDSPriority_SwitchPriority(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // Two localities, with priorities [0, 1], each with one backend. @@ -208,7 +208,7 @@ func (s) TestEDSPriority_SwitchPriority(t *testing.T) { // Init 0 and 1; 0 and 1 both down; add 2, use 2. func (s) TestEDSPriority_HigherDownWhileAddingLower(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // Two localities, with different priorities, each with one backend. @@ -271,7 +271,7 @@ func (s) TestEDSPriority_HigherDownWhileAddingLower(t *testing.T) { // Init 0,1,2; 0 and 1 down, use 2; 0 up, close 1 and 2. func (s) TestEDSPriority_HigherReadyCloseAllLower(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // Two localities, with priorities [0,1,2], each with one backend. @@ -353,7 +353,7 @@ func (s) TestEDSPriority_InitTimeout(t *testing.T) { }()() cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // Two localities, with different priorities, each with one backend. @@ -403,7 +403,7 @@ func (s) TestEDSPriority_InitTimeout(t *testing.T) { // - add localities to existing p0 and p1 func (s) TestEDSPriority_MultipleLocalities(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // Two localities, with different priorities, each with one backend. @@ -514,7 +514,7 @@ func (s) TestEDSPriority_RemovesAllLocalities(t *testing.T) { }()() cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // Two localities, with different priorities, each with one backend. @@ -698,7 +698,7 @@ func (s) TestPriorityTypeEqual(t *testing.T) { // will be used. func (s) TestEDSPriority_HighPriorityNoEndpoints(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // Two localities, with priorities [0, 1], each with one backend. @@ -757,7 +757,7 @@ func (s) TestEDSPriority_HighPriorityNoEndpoints(t *testing.T) { // priority will be used. func (s) TestEDSPriority_HighPriorityAllUnhealthy(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // Two localities, with priorities [0, 1], each with one backend. @@ -823,7 +823,7 @@ func (s) TestEDSPriority_FirstPriorityUnavailable(t *testing.T) { defaultPriorityInitTimeout = testPriorityInitTimeout cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // One localities, with priorities [0], each with one backend. diff --git a/xds/internal/balancer/edsbalancer/eds_impl_test.go b/xds/internal/balancer/edsbalancer/eds_impl_test.go index b4349a021dca..69ce6dcac1da 100644 --- a/xds/internal/balancer/edsbalancer/eds_impl_test.go +++ b/xds/internal/balancer/edsbalancer/eds_impl_test.go @@ -30,6 +30,7 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/roundrobin" "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/internal/balancer/stub" "google.golang.org/grpc/xds/internal" "google.golang.org/grpc/xds/internal/balancer/balancergroup" "google.golang.org/grpc/xds/internal/client" @@ -61,7 +62,7 @@ func init() { // - change drop rate func (s) TestEDS_OneLocality(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // One locality with one backend. @@ -182,7 +183,7 @@ func (s) TestEDS_OneLocality(t *testing.T) { // - update locality weight func (s) TestEDS_TwoLocalities(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // Two localities, each with one backend. @@ -313,7 +314,7 @@ func (s) TestEDS_TwoLocalities(t *testing.T) { // healthy ones are used. func (s) TestEDS_EndpointsHealth(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // Two localities, each 3 backend, one Healthy, one Unhealthy, one Unknown. @@ -385,7 +386,7 @@ func (s) TestEDS_EndpointsHealth(t *testing.T) { } func (s) TestClose(t *testing.T) { - edsb := newEDSBalancerImpl(nil, nil, nil, nil) + edsb := newEDSBalancerImpl(nil, balancer.BuildOptions{}, nil, nil, nil) // This is what could happen when switching between fallback and eds. This // make sure it doesn't panic. edsb.close() @@ -396,7 +397,7 @@ func (s) TestClose(t *testing.T) { // It should send an error picker with transient failure to the parent. func (s) TestEDS_EmptyUpdate(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // The first update is an empty update. @@ -456,15 +457,33 @@ func (s) TestEDS_EmptyUpdate(t *testing.T) { } // Create XDS balancer, and update sub-balancer before handling eds responses. -// Then switch between round-robin and test-const-balancer after handling first +// Then switch between round-robin and a test stub-balancer after handling first // eds response. func (s) TestEDS_UpdateSubBalancerName(t *testing.T) { + const balancerName = "stubBalancer-TestEDS_UpdateSubBalancerName" + cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + stub.Register(balancerName, stub.BalancerFuncs{ + UpdateClientConnState: func(bd *stub.BalancerData, s balancer.ClientConnState) error { + if len(s.ResolverState.Addresses) == 0 { + return nil + } + bd.ClientConn.NewSubConn(s.ResolverState.Addresses, balancer.NewSubConnOptions{}) + return nil + }, + UpdateSubConnState: func(bd *stub.BalancerData, sc balancer.SubConn, state balancer.SubConnState) { + bd.ClientConn.UpdateState(balancer.State{ + ConnectivityState: state.ConnectivityState, + Picker: &testutils.TestConstPicker{Err: testutils.ErrTestConstPicker}, + }) + }, + }) + + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState - t.Logf("update sub-balancer to test-const-balancer") - edsb.handleChildPolicy("test-const-balancer", nil) + t.Logf("update sub-balancer to stub-balancer") + edsb.handleChildPolicy(balancerName, nil) // Two localities, each with one backend. clab1 := testutils.NewClusterLoadAssignmentBuilder(testClusterNames[0], nil) @@ -506,8 +525,8 @@ func (s) TestEDS_UpdateSubBalancerName(t *testing.T) { t.Fatalf("want %v, got %v", want, err) } - t.Logf("update sub-balancer to test-const-balancer") - edsb.handleChildPolicy("test-const-balancer", nil) + t.Logf("update sub-balancer to stub-balancer") + edsb.handleChildPolicy(balancerName, nil) for i := 0; i < 2; i++ { scToRemove := <-cc.RemoveSubConnCh @@ -558,7 +577,7 @@ func (s) TestEDS_CircuitBreaking(t *testing.T) { defer func() { env.CircuitBreakingSupport = origCircuitBreakingSupport }() cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState edsb.updateServiceRequestsCounter("test") var maxRequests uint32 = 50 @@ -658,7 +677,7 @@ func (*testInlineUpdateBalancer) Close() { // by acquiring a locked mutex. func (s) TestEDS_ChildPolicyUpdatePickerInline(t *testing.T) { cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, nil, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = func(p priorityType, state balancer.State) { // For this test, euqueue needs to happen asynchronously (like in the // real implementation). @@ -759,7 +778,7 @@ func (s) TestEDS_LoadReport(t *testing.T) { lsWrapper.updateLoadStore(loadStore) cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, lsWrapper, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, lsWrapper, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState const ( @@ -853,7 +872,7 @@ func (s) TestEDS_LoadReportDisabled(t *testing.T) { // Not calling lsWrapper.updateLoadStore(loadStore) because LRS is disabled. cc := testutils.NewTestClientConn(t) - edsb := newEDSBalancerImpl(cc, nil, lsWrapper, nil) + edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, lsWrapper, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState // One localities, with one backend. diff --git a/xds/internal/balancer/edsbalancer/eds_test.go b/xds/internal/balancer/edsbalancer/eds_test.go index 3ee19a00debe..ea5ec39c4568 100644 --- a/xds/internal/balancer/edsbalancer/eds_test.go +++ b/xds/internal/balancer/edsbalancer/eds_test.go @@ -221,7 +221,7 @@ func setup(edsLBCh *testutils.Channel) (*fakeclient.Client, func()) { newXDSClient = func() (xdsClientInterface, error) { return xdsC, nil } origNewEDSBalancer := newEDSBalancer - newEDSBalancer = func(cc balancer.ClientConn, enqueue func(priorityType, balancer.State), _ load.PerClusterReporter, logger *grpclog.PrefixLogger) edsBalancerImplInterface { + newEDSBalancer = func(cc balancer.ClientConn, _ balancer.BuildOptions, _ func(priorityType, balancer.State), _ load.PerClusterReporter, _ *grpclog.PrefixLogger) edsBalancerImplInterface { edsLB := newFakeEDSBalancer(cc) defer func() { edsLBCh.Send(edsLB) }() return edsLB diff --git a/xds/internal/balancer/weightedtarget/weightedtarget.go b/xds/internal/balancer/weightedtarget/weightedtarget.go index b0310660fb29..02b199258cd2 100644 --- a/xds/internal/balancer/weightedtarget/weightedtarget.go +++ b/xds/internal/balancer/weightedtarget/weightedtarget.go @@ -45,12 +45,12 @@ func init() { type weightedTargetBB struct{} -func (wt *weightedTargetBB) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer { +func (wt *weightedTargetBB) Build(cc balancer.ClientConn, bOpts balancer.BuildOptions) balancer.Balancer { b := &weightedTargetBalancer{} b.logger = prefixLogger(b) b.stateAggregator = weightedaggregator.New(cc, b.logger, newRandomWRR) b.stateAggregator.Start() - b.bg = balancergroup.New(cc, b.stateAggregator, nil, b.logger) + b.bg = balancergroup.New(cc, bOpts, b.stateAggregator, nil, b.logger) b.bg.Start() b.logger.Infof("Created") return b diff --git a/xds/internal/client/v3/client.go b/xds/internal/client/v3/client.go index de34da819639..85de8d584a4f 100644 --- a/xds/internal/client/v3/client.go +++ b/xds/internal/client/v3/client.go @@ -143,7 +143,7 @@ func (v3c *client) RecvResponse(s grpc.ClientStream) (proto.Message, error) { return nil, fmt.Errorf("xds: stream.Recv() failed: %v", err) } v3c.logger.Infof("ADS response received, type: %v", resp.GetTypeUrl()) - v3c.logger.Debugf("ADS response received: %v", resp) + v3c.logger.Debugf("ADS response received: %+v", resp) return resp, nil } diff --git a/xds/internal/testutils/balancer.go b/xds/internal/testutils/balancer.go index 69e355e353c2..f49ba85606ff 100644 --- a/xds/internal/testutils/balancer.go +++ b/xds/internal/testutils/balancer.go @@ -232,49 +232,9 @@ func (tc *testClosure) next() balancer.SubConn { return ret } -func init() { - balancer.Register(&TestConstBalancerBuilder{}) -} - // ErrTestConstPicker is error returned by test const picker. var ErrTestConstPicker = fmt.Errorf("const picker error") -// TestConstBalancerBuilder is a balancer builder for tests. -type TestConstBalancerBuilder struct{} - -// Build builds a test const balancer. -func (*TestConstBalancerBuilder) Build(cc balancer.ClientConn, opts balancer.BuildOptions) balancer.Balancer { - return &testConstBalancer{cc: cc} -} - -// Name returns test-const-balancer name. -func (*TestConstBalancerBuilder) Name() string { - return "test-const-balancer" -} - -type testConstBalancer struct { - cc balancer.ClientConn -} - -func (tb *testConstBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { - tb.cc.UpdateState(balancer.State{ConnectivityState: connectivity.Ready, Picker: &TestConstPicker{Err: ErrTestConstPicker}}) -} - -func (tb *testConstBalancer) ResolverError(error) { - panic("not implemented") -} - -func (tb *testConstBalancer) UpdateClientConnState(s balancer.ClientConnState) error { - if len(s.ResolverState.Addresses) == 0 { - return nil - } - tb.cc.NewSubConn(s.ResolverState.Addresses, balancer.NewSubConnOptions{}) - return nil -} - -func (*testConstBalancer) Close() { -} - // TestConstPicker is a const picker for tests. type TestConstPicker struct { Err error From 61962d0e8e4ee228bd2ec73e02b19f90785310d0 Mon Sep 17 00:00:00 2001 From: Gaurav Gahlot Date: Tue, 9 Feb 2021 23:17:07 +0530 Subject: [PATCH 28/37] status: document nil error handling of FromError (#4196) Signed-off-by: Gaurav Gahlot --- status/status.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/status/status.go b/status/status.go index 01e182c306c2..54d187186b8f 100644 --- a/status/status.go +++ b/status/status.go @@ -73,9 +73,11 @@ func FromProto(s *spb.Status) *Status { return status.FromProto(s) } -// FromError returns a Status representing err if it was produced from this -// package or has a method `GRPCStatus() *Status`. Otherwise, ok is false and a -// Status is returned with codes.Unknown and the original error message. +// FromError returns a Status representing err if it was produced by this +// package or has a method `GRPCStatus() *Status`. +// If err is nil, a Status is returned with codes.OK and no message. +// Otherwise, ok is false and a Status is returned with codes.Unknown and +// the original error message. func FromError(err error) (s *Status, ok bool) { if err == nil { return nil, true From ce29c77c5fa13ec2b424e310e84dfa3188618df8 Mon Sep 17 00:00:00 2001 From: Easwar Swaminathan Date: Wed, 10 Feb 2021 09:13:50 -0800 Subject: [PATCH 29/37] Change version to 1.37.0-dev (#4200) --- version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.go b/version.go index 1b9f3715952d..c149b22ad8a1 100644 --- a/version.go +++ b/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.36.0-dev" +const Version = "1.37.0-dev" From ad24ab52b1624d64554867408e11e74d546829ea Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Wed, 10 Feb 2021 10:38:04 -0800 Subject: [PATCH 30/37] priority: the implementation (#4070) --- xds/internal/balancer/priority/balancer.go | 241 +++ .../balancer/priority/balancer_child.go | 104 ++ .../balancer/priority/balancer_priority.go | 354 ++++ .../balancer/priority/balancer_test.go | 1618 +++++++++++++++++ xds/internal/balancer/priority/logging.go | 34 + .../balancer/priority/{doc.go => utils.go} | 19 +- xds/internal/balancer/priority/utils_test.go | 62 + xds/internal/testutils/balancer.go | 2 +- 8 files changed, 2427 insertions(+), 7 deletions(-) create mode 100644 xds/internal/balancer/priority/balancer.go create mode 100644 xds/internal/balancer/priority/balancer_child.go create mode 100644 xds/internal/balancer/priority/balancer_priority.go create mode 100644 xds/internal/balancer/priority/balancer_test.go create mode 100644 xds/internal/balancer/priority/logging.go rename xds/internal/balancer/priority/{doc.go => utils.go} (68%) create mode 100644 xds/internal/balancer/priority/utils_test.go diff --git a/xds/internal/balancer/priority/balancer.go b/xds/internal/balancer/priority/balancer.go new file mode 100644 index 000000000000..c1b761972c55 --- /dev/null +++ b/xds/internal/balancer/priority/balancer.go @@ -0,0 +1,241 @@ +/* + * + * Copyright 2021 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package priority implements the priority balancer. +// +// This balancer will be kept in internal until we use it in the xds balancers, +// and are confident its functionalities are stable. It will then be exported +// for more users. +package priority + +import ( + "fmt" + "sync" + "time" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/internal/buffer" + "google.golang.org/grpc/internal/grpclog" + "google.golang.org/grpc/internal/grpcsync" + "google.golang.org/grpc/internal/hierarchy" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/xds/internal/balancer/balancergroup" +) + +const priorityBalancerName = "priority_experimental" + +func init() { + balancer.Register(priorityBB{}) +} + +type priorityBB struct{} + +func (priorityBB) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer { + b := &priorityBalancer{ + cc: cc, + done: grpcsync.NewEvent(), + childToPriority: make(map[string]int), + children: make(map[string]*childBalancer), + childBalancerStateUpdate: buffer.NewUnbounded(), + } + + b.logger = prefixLogger(b) + b.bg = balancergroup.New(cc, b, nil, b.logger) + b.bg.Start() + go b.run() + b.logger.Infof("Created") + return b + +} + +func (priorityBB) Name() string { + return priorityBalancerName +} + +// timerWrapper wraps a timer with a boolean. So that when a race happens +// between AfterFunc and Stop, the func is guaranteed to not execute. +type timerWrapper struct { + stopped bool + timer *time.Timer +} + +type priorityBalancer struct { + logger *grpclog.PrefixLogger + cc balancer.ClientConn + bg *balancergroup.BalancerGroup + done *grpcsync.Event + childBalancerStateUpdate *buffer.Unbounded + + mu sync.Mutex + childInUse string + // priority of the child that's current in use. Int starting from 0, and 0 + // is the higher priority. + priorityInUse int + // priorities is a list of child names from higher to lower priority. + priorities []string + // childToPriority is a map from the child name to it's priority. Priority + // is an int start from 0, and 0 is the higher priority. + childToPriority map[string]int + // children is a map from child name to sub-balancers. + children map[string]*childBalancer + // The timer to give a priority some time to connect. And if the priority + // doesn't go into Ready/Failure, the next priority will be started. + // + // One timer is enough because there can be at most one priority in init + // state. + priorityInitTimer *timerWrapper +} + +func (b *priorityBalancer) UpdateClientConnState(s balancer.ClientConnState) error { + newConfig, ok := s.BalancerConfig.(*lbConfig) + if !ok { + return fmt.Errorf("unexpected balancer config with type: %T", s.BalancerConfig) + } + addressesSplit := hierarchy.Group(s.ResolverState.Addresses) + + b.mu.Lock() + defer b.mu.Unlock() + // Create and remove children, since we know all children from the config + // are used by some priority. + for name, newSubConfig := range newConfig.Children { + bb := balancer.Get(newSubConfig.Config.Name) + if bb == nil { + b.logger.Errorf("balancer name %v from config is not registered", newSubConfig.Config.Name) + continue + } + + currentChild, ok := b.children[name] + if !ok { + // This is a new child, add it to the children list. But note that + // the balancer isn't built, because this child can be a low + // priority. If necessary, it will be built when syncing priorities. + cb := newChildBalancer(name, b, bb) + cb.updateConfig(newSubConfig.Config.Config, resolver.State{ + Addresses: addressesSplit[name], + ServiceConfig: s.ResolverState.ServiceConfig, + Attributes: s.ResolverState.Attributes, + }) + b.children[name] = cb + continue + } + + // This is not a new child. But the config/addresses could change. + + // The balancing policy name is changed, close the old child. But don't + // rebuild, rebuild will happen when syncing priorities. + if currentChild.bb.Name() != bb.Name() { + currentChild.stop() + currentChild.bb = bb + } + + // Update config and address, but note that this doesn't send the + // updates to child balancer (the child balancer might not be built, if + // it's a low priority). + currentChild.updateConfig(newSubConfig.Config.Config, resolver.State{ + Addresses: addressesSplit[name], + ServiceConfig: s.ResolverState.ServiceConfig, + Attributes: s.ResolverState.Attributes, + }) + } + + // Remove child from children if it's not in new config. + for name, oldChild := range b.children { + if _, ok := newConfig.Children[name]; !ok { + oldChild.stop() + } + } + + // Update priorities and handle priority changes. + b.priorities = newConfig.Priorities + b.childToPriority = make(map[string]int, len(newConfig.Priorities)) + for pi, pName := range newConfig.Priorities { + b.childToPriority[pName] = pi + } + // Sync the states of all children to the new updated priorities. This + // include starting/stopping child balancers when necessary. + b.syncPriority() + + return nil +} + +func (b *priorityBalancer) ResolverError(err error) { + b.bg.ResolverError(err) +} + +func (b *priorityBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { + b.bg.UpdateSubConnState(sc, state) +} + +func (b *priorityBalancer) Close() { + b.bg.Close() + + b.mu.Lock() + defer b.mu.Unlock() + b.done.Fire() + // Clear states of the current child in use, so if there's a race in picker + // update, it will be dropped. + b.childInUse = "" + b.stopPriorityInitTimer() +} + +// stopPriorityInitTimer stops the priorityInitTimer if it's not nil, and set it +// to nil. +// +// Caller must hold b.mu. +func (b *priorityBalancer) stopPriorityInitTimer() { + timerW := b.priorityInitTimer + if timerW == nil { + return + } + b.priorityInitTimer = nil + timerW.stopped = true + timerW.timer.Stop() +} + +// UpdateState implements balancergroup.BalancerStateAggregator interface. The +// balancer group sends new connectivity state and picker here. +func (b *priorityBalancer) UpdateState(childName string, state balancer.State) { + b.childBalancerStateUpdate.Put(&childBalancerState{ + name: childName, + s: state, + }) +} + +type childBalancerState struct { + name string + s balancer.State +} + +// run handles child update in a separate goroutine, so if the child sends +// updates inline (when called by parent), it won't cause deadlocks (by trying +// to hold the same mutex). +func (b *priorityBalancer) run() { + for { + select { + case u := <-b.childBalancerStateUpdate.Get(): + b.childBalancerStateUpdate.Load() + s := u.(*childBalancerState) + // Needs to handle state update in a goroutine, because each state + // update needs to start/close child policy, could result in + // deadlock. + b.handleChildStateUpdate(s.name, s.s) + case <-b.done.Done(): + return + } + } +} diff --git a/xds/internal/balancer/priority/balancer_child.go b/xds/internal/balancer/priority/balancer_child.go new file mode 100644 index 000000000000..d012ad4e4593 --- /dev/null +++ b/xds/internal/balancer/priority/balancer_child.go @@ -0,0 +1,104 @@ +/* + * + * Copyright 2021 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package priority + +import ( + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/balancer/base" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/serviceconfig" +) + +type childBalancer struct { + name string + parent *priorityBalancer + bb balancer.Builder + + config serviceconfig.LoadBalancingConfig + rState resolver.State + + started bool + state balancer.State +} + +// newChildBalancer creates a child balancer place holder, but doesn't +// build/start the child balancer. +func newChildBalancer(name string, parent *priorityBalancer, bb balancer.Builder) *childBalancer { + return &childBalancer{ + name: name, + parent: parent, + bb: bb, + started: false, + // Start with the connecting state and picker with re-pick error, so + // that when a priority switch causes this child picked before it's + // balancing policy is created, a re-pick will happen. + state: balancer.State{ + ConnectivityState: connectivity.Connecting, + Picker: base.NewErrPicker(balancer.ErrNoSubConnAvailable), + }, + } +} + +// updateConfig sets childBalancer's config and state, but doesn't send update to +// the child balancer. +func (cb *childBalancer) updateConfig(config serviceconfig.LoadBalancingConfig, rState resolver.State) { + cb.config = config + cb.rState = rState +} + +// start builds the child balancer if it's not already started. +// +// It doesn't do it directly. It asks the balancer group to build it. +func (cb *childBalancer) start() { + if cb.started { + return + } + cb.started = true + cb.parent.bg.Add(cb.name, cb.bb) +} + +// sendUpdate sends the addresses and config to the child balancer. +func (cb *childBalancer) sendUpdate() { + // TODO: return and aggregate the returned error in the parent. + err := cb.parent.bg.UpdateClientConnState(cb.name, balancer.ClientConnState{ + ResolverState: cb.rState, + BalancerConfig: cb.config, + }) + if err != nil { + cb.parent.logger.Warningf("failed to update ClientConn state for child %v: %v", cb.name, err) + } +} + +// stop stops the child balancer and resets the state. +// +// It doesn't do it directly. It asks the balancer group to remove it. +// +// Note that the underlying balancer group could keep the child in a cache. +func (cb *childBalancer) stop() { + if !cb.started { + return + } + cb.parent.bg.Remove(cb.name) + cb.started = false + cb.state = balancer.State{ + ConnectivityState: connectivity.Connecting, + Picker: base.NewErrPicker(balancer.ErrNoSubConnAvailable), + } +} diff --git a/xds/internal/balancer/priority/balancer_priority.go b/xds/internal/balancer/priority/balancer_priority.go new file mode 100644 index 000000000000..ea2f4f04184c --- /dev/null +++ b/xds/internal/balancer/priority/balancer_priority.go @@ -0,0 +1,354 @@ +/* + * + * Copyright 2021 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package priority + +import ( + "errors" + "time" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/balancer/base" + "google.golang.org/grpc/connectivity" +) + +var ( + errAllPrioritiesRemoved = errors.New("no locality is provided, all priorities are removed") + defaultPriorityInitTimeout = 10 * time.Second +) + +// syncPriority handles priority after a config update. It makes sure the +// balancer state (started or not) is in sync with the priorities (even in +// tricky cases where a child is moved from a priority to another). +// +// It's guaranteed that after this function returns: +// - If some child is READY, it is childInUse, and all lower priorities are +// closed. +// - If some child is newly started(in Connecting for the first time), it is +// childInUse, and all lower priorities are closed. +// - Otherwise, the lowest priority is childInUse (none of the children is +// ready, and the overall state is not ready). +// +// Steps: +// - If all priorities were deleted, unset childInUse (to an empty string), and +// set parent ClientConn to TransientFailure +// - Otherwise, Scan all children from p0, and check balancer stats: +// - For any of the following cases: +// - If balancer is not started (not built), this is either a new child +// with high priority, or a new builder for an existing child. +// - If balancer is READY +// - If this is the lowest priority +// - do the following: +// - if this is not the old childInUse, override picker so old picker is no +// longer used. +// - switch to it (because all higher priorities are neither new or Ready) +// - forward the new addresses and config +// +// Caller must hold b.mu. +func (b *priorityBalancer) syncPriority() { + // Everything was removed by the update. + if len(b.priorities) == 0 { + b.childInUse = "" + b.priorityInUse = 0 + // Stop the init timer. This can happen if the only priority is removed + // shortly after it's added. + b.stopPriorityInitTimer() + b.cc.UpdateState(balancer.State{ + ConnectivityState: connectivity.TransientFailure, + Picker: base.NewErrPicker(errAllPrioritiesRemoved), + }) + return + } + + for p, name := range b.priorities { + child, ok := b.children[name] + if !ok { + b.logger.Errorf("child with name %q is not found in children", name) + continue + } + + if !child.started || + child.state.ConnectivityState == connectivity.Ready || + p == len(b.priorities)-1 { + if b.childInUse != "" && b.childInUse != child.name { + // childInUse was set and is different from this child, will + // change childInUse later. We need to update picker here + // immediately so parent stops using the old picker. + b.cc.UpdateState(child.state) + } + b.logger.Infof("switching to (%q, %v) in syncPriority", child.name, p) + b.switchToChild(child, p) + child.sendUpdate() + break + } + } +} + +// Stop priorities [p+1, lowest]. +// +// Caller must hold b.mu. +func (b *priorityBalancer) stopSubBalancersLowerThanPriority(p int) { + for i := p + 1; i < len(b.priorities); i++ { + name := b.priorities[i] + child, ok := b.children[name] + if !ok { + b.logger.Errorf("child with name %q is not found in children", name) + continue + } + child.stop() + } +} + +// switchToChild does the following: +// - stop all child with lower priorities +// - if childInUse is not this child +// - set childInUse to this child +// - stops init timer +// - if this child is not started, start it, and start a init timer +// +// Note that it does NOT send the current child state (picker) to the parent +// ClientConn. The caller needs to send it if necessary. +// +// this can be called when +// 1. first update, start p0 +// 2. an update moves a READY child from a lower priority to higher +// 2. a different builder is updated for this child +// 3. a high priority goes Failure, start next +// 4. a high priority init timeout, start next +// +// Caller must hold b.mu. +func (b *priorityBalancer) switchToChild(child *childBalancer, priority int) { + // Stop lower priorities even if childInUse is same as this child. It's + // possible this child was moved from a priority to another. + b.stopSubBalancersLowerThanPriority(priority) + + // If this child is already in use, do nothing. + // + // This can happen: + // - all priorities are not READY, an config update always triggers switch + // to the lowest. In this case, the lowest child could still be connecting, + // so we don't stop the init timer. + // - a high priority is READY, an config update always triggers switch to + // it. + if b.childInUse == child.name && child.started { + return + } + b.childInUse = child.name + b.priorityInUse = priority + + // Init timer is always for childInUse. Since we are switching to a + // different child, we will stop the init timer no matter what. If this + // child is not started, we will start the init timer later. + b.stopPriorityInitTimer() + + if !child.started { + child.start() + // Need this local variable to capture timerW in the AfterFunc closure + // to check the stopped boolean. + timerW := &timerWrapper{} + b.priorityInitTimer = timerW + timerW.timer = time.AfterFunc(defaultPriorityInitTimeout, func() { + b.mu.Lock() + defer b.mu.Unlock() + if timerW.stopped { + return + } + b.priorityInitTimer = nil + // Switch to the next priority if there's any. + if pNext := priority + 1; pNext < len(b.priorities) { + nameNext := b.priorities[pNext] + if childNext, ok := b.children[nameNext]; ok { + b.switchToChild(childNext, pNext) + childNext.sendUpdate() + } + } + }) + } +} + +// handleChildStateUpdate start/close priorities based on the connectivity +// state. +func (b *priorityBalancer) handleChildStateUpdate(childName string, s balancer.State) { + b.mu.Lock() + defer b.mu.Unlock() + if b.done.HasFired() { + return + } + + priority, ok := b.childToPriority[childName] + if !ok { + b.logger.Errorf("priority: received picker update with unknown child %v", childName) + return + } + + if b.childInUse == "" { + b.logger.Errorf("priority: no child is in use when picker update is received") + return + } + + // priorityInUse is higher than this priority. + if b.priorityInUse < priority { + // Lower priorities should all be closed, this is an unexpected update. + // Can happen if the child policy sends an update after we tell it to + // close. + b.logger.Warningf("priority: received picker update from priority %v, lower than priority in use %v", priority, b.priorityInUse) + return + } + + // Update state in child. The updated picker will be sent to parent later if + // necessary. + child, ok := b.children[childName] + if !ok { + b.logger.Errorf("priority: child balancer not found for child %v, priority %v", childName, priority) + return + } + oldState := child.state.ConnectivityState + child.state = s + + switch s.ConnectivityState { + case connectivity.Ready: + b.handlePriorityWithNewStateReady(child, priority) + case connectivity.TransientFailure: + b.handlePriorityWithNewStateTransientFailure(child, priority) + case connectivity.Connecting: + b.handlePriorityWithNewStateConnecting(child, priority, oldState) + default: + // New state is Idle, should never happen. Don't forward. + } +} + +// handlePriorityWithNewStateReady handles state Ready from a higher or equal +// priority. +// +// An update with state Ready: +// - If it's from higher priority: +// - Switch to this priority +// - Forward the update +// - If it's from priorityInUse: +// - Forward only +// +// Caller must make sure priorityInUse is not higher than priority. +// +// Caller must hold mu. +func (b *priorityBalancer) handlePriorityWithNewStateReady(child *childBalancer, priority int) { + // If one priority higher or equal to priorityInUse goes Ready, stop the + // init timer. If update is from higher than priorityInUse, priorityInUse + // will be closed, and the init timer will become useless. + b.stopPriorityInitTimer() + + // priorityInUse is lower than this priority, switch to this. + if b.priorityInUse > priority { + b.logger.Infof("Switching priority from %v to %v, because latter became Ready", b.priorityInUse, priority) + b.switchToChild(child, priority) + } + // Forward the update since it's READY. + b.cc.UpdateState(child.state) +} + +// handlePriorityWithNewStateTransientFailure handles state TransientFailure +// from a higher or equal priority. +// +// An update with state TransientFailure: +// - If it's from a higher priority: +// - Do not forward, and do nothing +// - If it's from priorityInUse: +// - If there's no lower: +// - Forward and do nothing else +// - If there's a lower priority: +// - Switch to the lower +// - Forward the lower child's state +// - Do NOT forward this update +// +// Caller must make sure priorityInUse is not higher than priority. +// +// Caller must hold mu. +func (b *priorityBalancer) handlePriorityWithNewStateTransientFailure(child *childBalancer, priority int) { + // priorityInUse is lower than this priority, do nothing. + if b.priorityInUse > priority { + return + } + // priorityInUse sends a failure. Stop its init timer. + b.stopPriorityInitTimer() + priorityNext := priority + 1 + if priorityNext >= len(b.priorities) { + // Forward this update. + b.cc.UpdateState(child.state) + return + } + b.logger.Infof("Switching priority from %v to %v, because former became TransientFailure", priority, priorityNext) + nameNext := b.priorities[priorityNext] + childNext := b.children[nameNext] + b.switchToChild(childNext, priorityNext) + b.cc.UpdateState(childNext.state) + childNext.sendUpdate() +} + +// handlePriorityWithNewStateConnecting handles state Connecting from a higher +// than or equal priority. +// +// An update with state Connecting: +// - If it's from a higher priority +// - Do nothing +// - If it's from priorityInUse, the behavior depends on previous state. +// +// When new state is Connecting, the behavior depends on previous state. If the +// previous state was Ready, this is a transition out from Ready to Connecting. +// Assuming there are multiple backends in the same priority, this mean we are +// in a bad situation and we should failover to the next priority (Side note: +// the current connectivity state aggregating algorithm (e.g. round-robin) is +// not handling this right, because if many backends all go from Ready to +// Connecting, the overall situation is more like TransientFailure, not +// Connecting). +// +// If the previous state was Idle, we don't do anything special with failure, +// and simply forward the update. The init timer should be in process, will +// handle failover if it timeouts. If the previous state was TransientFailure, +// we do not forward, because the lower priority is in use. +// +// Caller must make sure priorityInUse is not higher than priority. +// +// Caller must hold mu. +func (b *priorityBalancer) handlePriorityWithNewStateConnecting(child *childBalancer, priority int, oldState connectivity.State) { + // priorityInUse is lower than this priority, do nothing. + if b.priorityInUse > priority { + return + } + + switch oldState { + case connectivity.Ready: + // Handling transition from Ready to Connecting, is same as handling + // TransientFailure. There's no need to stop the init timer, because it + // should have been stopped when state turned Ready. + priorityNext := priority + 1 + if priorityNext >= len(b.priorities) { + // Forward this update. + b.cc.UpdateState(child.state) + return + } + b.logger.Infof("Switching priority from %v to %v, because former became TransientFailure", priority, priorityNext) + nameNext := b.priorities[priorityNext] + childNext := b.children[nameNext] + b.switchToChild(childNext, priorityNext) + b.cc.UpdateState(childNext.state) + childNext.sendUpdate() + case connectivity.Idle: + b.cc.UpdateState(child.state) + default: + // Old state is Connecting, TransientFailure or Shutdown. Don't forward. + } +} diff --git a/xds/internal/balancer/priority/balancer_test.go b/xds/internal/balancer/priority/balancer_test.go new file mode 100644 index 000000000000..be14231dcb3f --- /dev/null +++ b/xds/internal/balancer/priority/balancer_test.go @@ -0,0 +1,1618 @@ +/* + * + * Copyright 2021 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package priority + +import ( + "fmt" + "testing" + "time" + + "github.com/google/go-cmp/cmp" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/balancer/roundrobin" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/internal/balancer/stub" + "google.golang.org/grpc/internal/grpctest" + "google.golang.org/grpc/internal/hierarchy" + internalserviceconfig "google.golang.org/grpc/internal/serviceconfig" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/xds/internal/balancer/balancergroup" + "google.golang.org/grpc/xds/internal/testutils" +) + +type s struct { + grpctest.Tester +} + +func Test(t *testing.T) { + grpctest.RunSubTests(t, s{}) +} + +var testBackendAddrStrs []string + +const ( + testBackendAddrsCount = 12 + testRRBalancerName = "another-round-robin" +) + +type anotherRR struct { + balancer.Builder +} + +func (*anotherRR) Name() string { + return testRRBalancerName +} + +func init() { + for i := 0; i < testBackendAddrsCount; i++ { + testBackendAddrStrs = append(testBackendAddrStrs, fmt.Sprintf("%d.%d.%d.%d:%d", i, i, i, i, i)) + } + balancergroup.DefaultSubBalancerCloseTimeout = time.Millisecond + balancer.Register(&anotherRR{Builder: balancer.Get(roundrobin.Name)}) +} + +func subConnFromPicker(t *testing.T, p balancer.Picker) func() balancer.SubConn { + return func() balancer.SubConn { + scst, err := p.Pick(balancer.PickInfo{}) + if err != nil { + t.Fatalf("unexpected error from picker.Pick: %v", err) + } + return scst.SubConn + } +} + +// When a high priority is ready, adding/removing lower locality doesn't cause +// changes. +// +// Init 0 and 1; 0 is up, use 0; add 2, use 0; remove 2, use 0. +func (s) TestPriority_HighPriorityReady(t *testing.T) { + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // Two children, with priorities [0, 1], each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + + // p0 is ready. + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p0 subconns. + p1 := <-cc.NewPickerCh + want := []balancer.SubConn{sc1} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p1)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + // Add p2, it shouldn't cause any updates. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[2]}, []string{"child-2"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-2": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1", "child-2"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + select { + case <-cc.NewPickerCh: + t.Fatalf("got unexpected new picker") + case sc := <-cc.NewSubConnCh: + t.Fatalf("got unexpected new SubConn: %s", sc) + case sc := <-cc.RemoveSubConnCh: + t.Fatalf("got unexpected remove SubConn: %v", sc) + case <-time.After(time.Millisecond * 100): + } + + // Remove p2, no updates. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + select { + case <-cc.NewPickerCh: + t.Fatalf("got unexpected new picker") + case <-cc.NewSubConnCh: + t.Fatalf("got unexpected new SubConn") + case <-cc.RemoveSubConnCh: + t.Fatalf("got unexpected remove SubConn") + case <-time.After(time.Millisecond * 100): + } +} + +// Lower priority is used when higher priority is not ready. +// +// Init 0 and 1; 0 is up, use 0; 0 is down, 1 is up, use 1; add 2, use 1; 1 is +// down, use 2; remove 2, use 1. +func (s) TestPriority_SwitchPriority(t *testing.T) { + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // Two localities, with priorities [0, 1], each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs0 := <-cc.NewSubConnAddrsCh + if got, want := addrs0[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc0 := <-cc.NewSubConnCh + + // p0 is ready. + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p0 subconns. + p0 := <-cc.NewPickerCh + want := []balancer.SubConn{sc0} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p0)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + // Turn down 0, will start and use 1. + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.TransientFailure}) + + // Before 1 gets READY, picker should return NoSubConnAvailable, so RPCs + // will retry. + p1 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := p1.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error %v, got %v", balancer.ErrNoSubConnAvailable, err) + } + } + + // Handle SubConn creation from 1. + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[1]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test pick with 1. + p2 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + gotSCSt, _ := p2.Pick(balancer.PickInfo{}) + if !cmp.Equal(gotSCSt.SubConn, sc1, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("picker.Pick, got %v, want SubConn=%v", gotSCSt, sc1) + } + } + + // Add p2, it shouldn't cause any udpates. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[2]}, []string{"child-2"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-2": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1", "child-2"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + select { + case <-cc.NewPickerCh: + t.Fatalf("got unexpected new picker") + case sc := <-cc.NewSubConnCh: + t.Fatalf("got unexpected new SubConn, %s", sc) + case <-cc.RemoveSubConnCh: + t.Fatalf("got unexpected remove SubConn") + case <-time.After(time.Millisecond * 100): + } + + // Turn down 1, use 2 + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.TransientFailure}) + + // Before 2 gets READY, picker should return NoSubConnAvailable, so RPCs + // will retry. + p3 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := p3.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error %v, got %v", balancer.ErrNoSubConnAvailable, err) + } + } + + addrs2 := <-cc.NewSubConnAddrsCh + if got, want := addrs2[0].Addr, testBackendAddrStrs[2]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc2 := <-cc.NewSubConnCh + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test pick with 2. + p4 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + gotSCSt, _ := p4.Pick(balancer.PickInfo{}) + if !cmp.Equal(gotSCSt.SubConn, sc2, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("picker.Pick, got %v, want SubConn=%v", gotSCSt, sc2) + } + } + + // Remove 2, use 1. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // p2 SubConns are removed. + scToRemove := <-cc.RemoveSubConnCh + if !cmp.Equal(scToRemove, sc2, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("RemoveSubConn, want %v, got %v", sc2, scToRemove) + } + + // Should get an update with 1's old transient failure picker, to override + // 2's old picker. + p5 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := p5.Pick(balancer.PickInfo{}); err == nil { + t.Fatalf("want pick error non-nil, got nil") + } + } + + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + p6 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + gotSCSt, _ := p6.Pick(balancer.PickInfo{}) + if !cmp.Equal(gotSCSt.SubConn, sc1, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("picker.Pick, got %v, want SubConn=%v", gotSCSt, sc2) + } + } +} + +// Lower priority is used when higher priority turns Connecting from Ready. +// Because changing from Ready to Connecting is a failure. +// +// Init 0 and 1; 0 is up, use 0; 0 is connecting, 1 is up, use 1; 0 is ready, +// use 0. +func (s) TestPriority_HighPriorityToConnectingFromReady(t *testing.T) { + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // Two localities, with priorities [0, 1], each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs0 := <-cc.NewSubConnAddrsCh + if got, want := addrs0[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc0 := <-cc.NewSubConnCh + + // p0 is ready. + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p0 subconns. + p0 := <-cc.NewPickerCh + want := []balancer.SubConn{sc0} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p0)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + // Turn 0 to Connecting, will start and use 1. Because 0 changing from Ready + // to Connecting is a failure. + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + + // Before 1 gets READY, picker should return NoSubConnAvailable, so RPCs + // will retry. + p1 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := p1.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error %v, got %v", balancer.ErrNoSubConnAvailable, err) + } + } + + // Handle SubConn creation from 1. + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[1]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test pick with 1. + p2 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + gotSCSt, _ := p2.Pick(balancer.PickInfo{}) + if !cmp.Equal(gotSCSt.SubConn, sc1, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("picker.Pick, got %v, want SubConn=%v", gotSCSt, sc1) + } + } + + // Turn 0 back to Ready. + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // p1 subconn should be removed. + scToRemove := <-cc.RemoveSubConnCh + if !cmp.Equal(scToRemove, sc1, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("RemoveSubConn, want %v, got %v", sc0, scToRemove) + } + + p3 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + gotSCSt, _ := p3.Pick(balancer.PickInfo{}) + if !cmp.Equal(gotSCSt.SubConn, sc0, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("picker.Pick, got %v, want SubConn=%v", gotSCSt, sc0) + } + } +} + +// Add a lower priority while the higher priority is down. +// +// Init 0 and 1; 0 and 1 both down; add 2, use 2. +func (s) TestPriority_HigherDownWhileAddingLower(t *testing.T) { + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // Two localities, with different priorities, each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs0 := <-cc.NewSubConnAddrsCh + if got, want := addrs0[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc0 := <-cc.NewSubConnCh + + // Turn down 0, 1 is used. + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.TransientFailure}) + + // Before 1 gets READY, picker should return NoSubConnAvailable, so RPCs + // will retry. + pFail0 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := pFail0.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error %v, got %v", balancer.ErrNoSubConnAvailable, err) + } + } + + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[1]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + // Turn down 1, pick should error. + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.TransientFailure}) + + // Test pick failure. + pFail1 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := pFail1.Pick(balancer.PickInfo{}); err == nil { + t.Fatalf("want pick error non-nil, got nil") + } + } + + // Add p2, it should create a new SubConn. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[2]}, []string{"child-2"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-2": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1", "child-2"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // A new connecting picker should be updated for the new priority. + p0 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := p0.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error %v, got %v", balancer.ErrNoSubConnAvailable, err) + } + } + + addrs2 := <-cc.NewSubConnAddrsCh + if got, want := addrs2[0].Addr, testBackendAddrStrs[2]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc2 := <-cc.NewSubConnCh + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test pick with 2. + p1 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + gotSCSt, _ := p1.Pick(balancer.PickInfo{}) + if !cmp.Equal(gotSCSt.SubConn, sc2, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("picker.Pick, got %v, want SubConn=%v", gotSCSt, sc2) + } + } +} + +// When a higher priority becomes available, all lower priorities are closed. +// +// Init 0,1,2; 0 and 1 down, use 2; 0 up, close 1 and 2. +func (s) TestPriority_HigherReadyCloseAllLower(t *testing.T) { + // defer time.Sleep(10 * time.Millisecond) + + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // Three localities, with priorities [0,1,2], each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[2]}, []string{"child-2"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-2": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1", "child-2"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs0 := <-cc.NewSubConnAddrsCh + if got, want := addrs0[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc0 := <-cc.NewSubConnCh + + // Turn down 0, 1 is used. + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.TransientFailure}) + // Before 1 gets READY, picker should return NoSubConnAvailable, so RPCs + // will retry. + pFail0 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := pFail0.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error %v, got %v", balancer.ErrNoSubConnAvailable, err) + } + } + + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[1]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + + // Turn down 1, 2 is used. + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.TransientFailure}) + // Before 2 gets READY, picker should return NoSubConnAvailable, so RPCs + // will retry. + pFail1 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := pFail1.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error %v, got %v", balancer.ErrNoSubConnAvailable, err) + } + } + + addrs2 := <-cc.NewSubConnAddrsCh + if got, want := addrs2[0].Addr, testBackendAddrStrs[2]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc2 := <-cc.NewSubConnCh + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test pick with 2. + p2 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + gotSCSt, _ := p2.Pick(balancer.PickInfo{}) + if !cmp.Equal(gotSCSt.SubConn, sc2, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("picker.Pick, got %v, want SubConn=%v", gotSCSt, sc2) + } + } + + // When 0 becomes ready, 0 should be used, 1 and 2 should all be closed. + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // sc1 and sc2 should be removed. + // + // With localities caching, the lower priorities are closed after a timeout, + // in goroutines. The order is no longer guaranteed. + scToRemove := []balancer.SubConn{<-cc.RemoveSubConnCh, <-cc.RemoveSubConnCh} + if !(cmp.Equal(scToRemove[0], sc1, cmp.AllowUnexported(testutils.TestSubConn{})) && + cmp.Equal(scToRemove[1], sc2, cmp.AllowUnexported(testutils.TestSubConn{}))) && + !(cmp.Equal(scToRemove[0], sc2, cmp.AllowUnexported(testutils.TestSubConn{})) && + cmp.Equal(scToRemove[1], sc1, cmp.AllowUnexported(testutils.TestSubConn{}))) { + t.Errorf("RemoveSubConn, want [%v, %v], got %v", sc1, sc2, scToRemove) + } + + // Test pick with 0. + p0 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + gotSCSt, _ := p0.Pick(balancer.PickInfo{}) + if !cmp.Equal(gotSCSt.SubConn, sc0, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("picker.Pick, got %v, want SubConn=%v", gotSCSt, sc0) + } + } +} + +// At init, start the next lower priority after timeout if the higher priority +// doesn't get ready. +// +// Init 0,1; 0 is not ready (in connecting), after timeout, use 1. +func (s) TestPriority_InitTimeout(t *testing.T) { + const testPriorityInitTimeout = time.Second + defer func() func() { + old := defaultPriorityInitTimeout + defaultPriorityInitTimeout = testPriorityInitTimeout + return func() { + defaultPriorityInitTimeout = old + } + }()() + + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // Two localities, with different priorities, each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs0 := <-cc.NewSubConnAddrsCh + if got, want := addrs0[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc0 := <-cc.NewSubConnCh + + // Keep 0 in connecting, 1 will be used after init timeout. + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + + // Make sure new SubConn is created before timeout. + select { + case <-time.After(testPriorityInitTimeout * 3 / 4): + case <-cc.NewSubConnAddrsCh: + t.Fatalf("Got a new SubConn too early (Within timeout). Expect a new SubConn only after timeout") + } + + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[1]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test pick with 1. + p1 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + gotSCSt, _ := p1.Pick(balancer.PickInfo{}) + if !cmp.Equal(gotSCSt.SubConn, sc1, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("picker.Pick, got %v, want SubConn=%v", gotSCSt, sc1) + } + } +} + +// EDS removes all priorities, and re-adds them. +func (s) TestPriority_RemovesAllPriorities(t *testing.T) { + const testPriorityInitTimeout = time.Second + defer func() func() { + old := defaultPriorityInitTimeout + defaultPriorityInitTimeout = testPriorityInitTimeout + return func() { + defaultPriorityInitTimeout = old + } + }()() + + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // Two localities, with different priorities, each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs0 := <-cc.NewSubConnAddrsCh + if got, want := addrs0[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc0 := <-cc.NewSubConnCh + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p0 subconns. + p0 := <-cc.NewPickerCh + want := []balancer.SubConn{sc0} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p0)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + // Remove all priorities. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: nil, + }, + BalancerConfig: &lbConfig{ + Children: nil, + Priorities: nil, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // p0 subconn should be removed. + scToRemove := <-cc.RemoveSubConnCh + if !cmp.Equal(scToRemove, sc0, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("RemoveSubConn, want %v, got %v", sc0, scToRemove) + } + + // Test pick return TransientFailure. + pFail := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := pFail.Pick(balancer.PickInfo{}); err != errAllPrioritiesRemoved { + t.Fatalf("want pick error %v, got %v", errAllPrioritiesRemoved, err) + } + } + + // Re-add two localities, with previous priorities, but different backends. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[2]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[3]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs01 := <-cc.NewSubConnAddrsCh + if got, want := addrs01[0].Addr, testBackendAddrStrs[2]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc01 := <-cc.NewSubConnCh + + // Don't send any update to p0, so to not override the old state of p0. + // Later, connect to p1 and then remove p1. This will fallback to p0, and + // will send p0's old picker if they are not correctly removed. + + // p1 will be used after priority init timeout. + addrs11 := <-cc.NewSubConnAddrsCh + if got, want := addrs11[0].Addr, testBackendAddrStrs[3]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc11 := <-cc.NewSubConnCh + pb.UpdateSubConnState(sc11, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc11, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p1 subconns. + p1 := <-cc.NewPickerCh + want = []balancer.SubConn{sc11} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p1)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + // Remove p1, to fallback to p0. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[2]}, []string{"child-0"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // p1 subconn should be removed. + scToRemove1 := <-cc.RemoveSubConnCh + if !cmp.Equal(scToRemove1, sc11, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("RemoveSubConn, want %v, got %v", sc11, scToRemove1) + } + + // Test pick return NoSubConn. + pFail1 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if scst, err := pFail1.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error _, %v, got %v, _ ,%v", balancer.ErrNoSubConnAvailable, scst, err) + } + } + + // Send an ready update for the p0 sc that was received when re-adding + // priorities. + pb.UpdateSubConnState(sc01, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc01, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p0 subconns. + p2 := <-cc.NewPickerCh + want = []balancer.SubConn{sc01} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p2)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + select { + case <-cc.NewPickerCh: + t.Fatalf("got unexpected new picker") + case <-cc.NewSubConnCh: + t.Fatalf("got unexpected new SubConn") + case <-cc.RemoveSubConnCh: + t.Fatalf("got unexpected remove SubConn") + case <-time.After(time.Millisecond * 100): + } +} + +// Test the case where the high priority contains no backends. The low priority +// will be used. +func (s) TestPriority_HighPriorityNoEndpoints(t *testing.T) { + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // Two localities, with priorities [0, 1], each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + + // p0 is ready. + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p0 subconns. + p1 := <-cc.NewPickerCh + want := []balancer.SubConn{sc1} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p1)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + // Remove addresses from priority 0, should use p1. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // p0 will remove the subconn, and ClientConn will send a sc update to + // shutdown. + scToRemove := <-cc.RemoveSubConnCh + pb.UpdateSubConnState(scToRemove, balancer.SubConnState{ConnectivityState: connectivity.Shutdown}) + + addrs2 := <-cc.NewSubConnAddrsCh + if got, want := addrs2[0].Addr, testBackendAddrStrs[1]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc2 := <-cc.NewSubConnCh + + // Before 1 gets READY, picker should return NoSubConnAvailable, so RPCs + // will retry. + pFail1 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := pFail1.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error %v, got %v", balancer.ErrNoSubConnAvailable, err) + } + } + + // p1 is ready. + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p1 subconns. + p2 := <-cc.NewPickerCh + want = []balancer.SubConn{sc2} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p2)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } +} + +// Test the case where the first and only priority is removed. +func (s) TestPriority_FirstPriorityUnavailable(t *testing.T) { + const testPriorityInitTimeout = time.Second + defer func(t time.Duration) { + defaultPriorityInitTimeout = t + }(defaultPriorityInitTimeout) + defaultPriorityInitTimeout = testPriorityInitTimeout + + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // One localities, with priorities [0], each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // Remove the only localities. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: nil, + }, + BalancerConfig: &lbConfig{ + Children: nil, + Priorities: nil, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // Wait after double the init timer timeout, to ensure it doesn't panic. + time.Sleep(testPriorityInitTimeout * 2) +} + +// When a child is moved from low priority to high. +// +// Init a(p0) and b(p1); a(p0) is up, use a; move b to p0, a to p1, use b. +func (s) TestPriority_MoveChildToHigherPriority(t *testing.T) { + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // Two children, with priorities [0, 1], each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + + // p0 is ready. + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p0 subconns. + p1 := <-cc.NewPickerCh + want := []balancer.SubConn{sc1} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p1)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + // Swap child with p0 and p1, the child at lower priority should now be the + // higher priority, and be used. The old SubConn should be closed. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-1", "child-0"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // When the new child for p0 is changed from the previous child, the + // balancer should immediately update the picker so the picker from old + // child is not used. In this case, the picker becomes a + // no-subconn-available picker because this child is just started. + pFail := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := pFail.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error %v, got %v", balancer.ErrNoSubConnAvailable, err) + } + } + + // Old subconn should be removed. + scToRemove := <-cc.RemoveSubConnCh + if !cmp.Equal(scToRemove, sc1, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("RemoveSubConn, want %v, got %v", sc1, scToRemove) + } + + addrs2 := <-cc.NewSubConnAddrsCh + if got, want := addrs2[0].Addr, testBackendAddrStrs[1]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc2 := <-cc.NewSubConnCh + + // New p0 child is ready. + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only new subconns. + p2 := <-cc.NewPickerCh + want2 := []balancer.SubConn{sc2} + if err := testutils.IsRoundRobin(want2, subConnFromPicker(t, p2)); err != nil { + t.Fatalf("want %v, got %v", want2, err) + } +} + +// When a child is in lower priority, and in use (because higher is down), +// move it from low priority to high. +// +// Init a(p0) and b(p1); a(p0) is down, use b; move b to p0, a to p1, use b. +func (s) TestPriority_MoveReadyChildToHigherPriority(t *testing.T) { + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // Two children, with priorities [0, 1], each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs0 := <-cc.NewSubConnAddrsCh + if got, want := addrs0[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc0 := <-cc.NewSubConnCh + + // p0 is down. + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.TransientFailure}) + // Before 1 gets READY, picker should return NoSubConnAvailable, so RPCs + // will retry. + pFail0 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := pFail0.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error %v, got %v", balancer.ErrNoSubConnAvailable, err) + } + } + + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[1]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p1 subconns. + p0 := <-cc.NewPickerCh + want := []balancer.SubConn{sc1} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p0)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + // Swap child with p0 and p1, the child at lower priority should now be the + // higher priority, and be used. The old SubConn should be closed. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-1", "child-0"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // Old subconn from child-0 should be removed. + scToRemove := <-cc.RemoveSubConnCh + if !cmp.Equal(scToRemove, sc0, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("RemoveSubConn, want %v, got %v", sc0, scToRemove) + } + + // Because this was a ready child moved to a higher priority, no new subconn + // or picker should be updated. + select { + case <-cc.NewPickerCh: + t.Fatalf("got unexpected new picker") + case <-cc.NewSubConnCh: + t.Fatalf("got unexpected new SubConn") + case <-cc.RemoveSubConnCh: + t.Fatalf("got unexpected remove SubConn") + case <-time.After(time.Millisecond * 100): + } +} + +// When the lowest child is in use, and is removed, should use the higher +// priority child even though it's not ready. +// +// Init a(p0) and b(p1); a(p0) is down, use b; move b to p0, a to p1, use b. +func (s) TestPriority_RemoveReadyLowestChild(t *testing.T) { + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // Two children, with priorities [0, 1], each with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[1]}, []string{"child-1"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + "child-1": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0", "child-1"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs0 := <-cc.NewSubConnAddrsCh + if got, want := addrs0[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc0 := <-cc.NewSubConnCh + + // p0 is down. + pb.UpdateSubConnState(sc0, balancer.SubConnState{ConnectivityState: connectivity.TransientFailure}) + // Before 1 gets READY, picker should return NoSubConnAvailable, so RPCs + // will retry. + pFail0 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := pFail0.Pick(balancer.PickInfo{}); err != balancer.ErrNoSubConnAvailable { + t.Fatalf("want pick error %v, got %v", balancer.ErrNoSubConnAvailable, err) + } + } + + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[1]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p1 subconns. + p0 := <-cc.NewPickerCh + want := []balancer.SubConn{sc1} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p0)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + // Remove child with p1, the child at higher priority should now be used. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // Old subconn from child-1 should be removed. + scToRemove := <-cc.RemoveSubConnCh + if !cmp.Equal(scToRemove, sc1, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("RemoveSubConn, want %v, got %v", sc1, scToRemove) + } + + pFail := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := pFail.Pick(balancer.PickInfo{}); err == nil { + t.Fatalf("want pick error , got %v", err) + } + } + + // Because there was no new child, no new subconn should be created. + select { + case <-cc.NewSubConnCh: + t.Fatalf("got unexpected new SubConn") + case <-time.After(time.Millisecond * 100): + } +} + +// When a ready child is removed, it's kept in cache. Re-adding doesn't create subconns. +// +// Init 0; 0 is up, use 0; remove 0, only picker is updated, no subconn is +// removed; re-add 0, picker is updated. +func (s) TestPriority_ReadyChildRemovedButInCache(t *testing.T) { + const testChildCacheTimeout = time.Second + defer func() func() { + old := balancergroup.DefaultSubBalancerCloseTimeout + balancergroup.DefaultSubBalancerCloseTimeout = testChildCacheTimeout + return func() { + balancergroup.DefaultSubBalancerCloseTimeout = old + } + }()() + + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // One children, with priorities [0], with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + + // p0 is ready. + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p0 subconns. + p1 := <-cc.NewPickerCh + want := []balancer.SubConn{sc1} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p1)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + // Remove the child, it shouldn't cause any conn changed, but picker should + // be different. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{}, + BalancerConfig: &lbConfig{}, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + pFail := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + if _, err := pFail.Pick(balancer.PickInfo{}); err != errAllPrioritiesRemoved { + t.Fatalf("want pick error %v, got %v", errAllPrioritiesRemoved, err) + } + } + + // But no conn changes should happen. Child balancer is in cache. + select { + case sc := <-cc.NewSubConnCh: + t.Fatalf("got unexpected new SubConn: %s", sc) + case sc := <-cc.RemoveSubConnCh: + t.Fatalf("got unexpected remove SubConn: %v", sc) + case <-time.After(time.Millisecond * 100): + } + + // Re-add the child, shouldn't create new connections. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // Test roundrobin with only p0 subconns. + p2 := <-cc.NewPickerCh + want2 := []balancer.SubConn{sc1} + if err := testutils.IsRoundRobin(want2, subConnFromPicker(t, p2)); err != nil { + t.Fatalf("want %v, got %v", want2, err) + } + + // But no conn changes should happen. Child balancer is just taken out from + // the cache. + select { + case sc := <-cc.NewSubConnCh: + t.Fatalf("got unexpected new SubConn: %s", sc) + case sc := <-cc.RemoveSubConnCh: + t.Fatalf("got unexpected remove SubConn: %v", sc) + case <-time.After(time.Millisecond * 100): + } +} + +// When the policy of a child is changed. +// +// Init 0; 0 is up, use 0; change 0's policy, 0 is used. +func (s) TestPriority_ChildPolicyChange(t *testing.T) { + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // One children, with priorities [0], with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: roundrobin.Name}}, + }, + Priorities: []string{"child-0"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + addrs1 := <-cc.NewSubConnAddrsCh + if got, want := addrs1[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc1 := <-cc.NewSubConnCh + + // p0 is ready. + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test roundrobin with only p0 subconns. + p1 := <-cc.NewPickerCh + want := []balancer.SubConn{sc1} + if err := testutils.IsRoundRobin(want, subConnFromPicker(t, p1)); err != nil { + t.Fatalf("want %v, got %v", want, err) + } + + // Change the policy for the child (still roundrobin, but with a different + // name). + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: testRRBalancerName}}, + }, + Priorities: []string{"child-0"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + // Old subconn should be removed. + scToRemove := <-cc.RemoveSubConnCh + if !cmp.Equal(scToRemove, sc1, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("RemoveSubConn, want %v, got %v", sc1, scToRemove) + } + + // A new subconn should be created. + addrs2 := <-cc.NewSubConnAddrsCh + if got, want := addrs2[0].Addr, testBackendAddrStrs[0]; got != want { + t.Fatalf("sc is created with addr %v, want %v", got, want) + } + sc2 := <-cc.NewSubConnCh + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + pb.UpdateSubConnState(sc2, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + + // Test pickfirst with the new subconns. + p2 := <-cc.NewPickerCh + want2 := []balancer.SubConn{sc2} + if err := testutils.IsRoundRobin(want2, subConnFromPicker(t, p2)); err != nil { + t.Fatalf("want %v, got %v", want2, err) + } +} + +const inlineUpdateBalancerName = "test-inline-update-balancer" + +var errTestInlineStateUpdate = fmt.Errorf("don't like addresses, empty or not") + +func init() { + stub.Register(inlineUpdateBalancerName, stub.BalancerFuncs{ + UpdateClientConnState: func(bd *stub.BalancerData, opts balancer.ClientConnState) error { + bd.ClientConn.UpdateState(balancer.State{ + ConnectivityState: connectivity.Ready, + Picker: &testutils.TestConstPicker{Err: errTestInlineStateUpdate}, + }) + return nil + }, + }) +} + +// When the child policy update picker inline in a handleClientUpdate call +// (e.g., roundrobin handling empty addresses). There could be deadlock caused +// by acquiring a locked mutex. +func (s) TestPriority_ChildPolicyUpdatePickerInline(t *testing.T) { + cc := testutils.NewTestClientConn(t) + bb := balancer.Get(priorityBalancerName) + pb := bb.Build(cc, balancer.BuildOptions{}) + defer pb.Close() + + // One children, with priorities [0], with one backend. + if err := pb.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: []resolver.Address{ + hierarchy.Set(resolver.Address{Addr: testBackendAddrStrs[0]}, []string{"child-0"}), + }, + }, + BalancerConfig: &lbConfig{ + Children: map[string]*child{ + "child-0": {&internalserviceconfig.BalancerConfig{Name: inlineUpdateBalancerName}}, + }, + Priorities: []string{"child-0"}, + }, + }); err != nil { + t.Fatalf("failed to update ClientConn state: %v", err) + } + + p0 := <-cc.NewPickerCh + for i := 0; i < 5; i++ { + _, err := p0.Pick(balancer.PickInfo{}) + if err != errTestInlineStateUpdate { + t.Fatalf("picker.Pick, got err %q, want err %q", err, errTestInlineStateUpdate) + } + } +} diff --git a/xds/internal/balancer/priority/logging.go b/xds/internal/balancer/priority/logging.go new file mode 100644 index 000000000000..2fb8d2d204c5 --- /dev/null +++ b/xds/internal/balancer/priority/logging.go @@ -0,0 +1,34 @@ +/* + * + * Copyright 2021 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package priority + +import ( + "fmt" + + "google.golang.org/grpc/grpclog" + internalgrpclog "google.golang.org/grpc/internal/grpclog" +) + +const prefix = "[priority-lb %p] " + +var logger = grpclog.Component("xds") + +func prefixLogger(p *priorityBalancer) *internalgrpclog.PrefixLogger { + return internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf(prefix, p)) +} diff --git a/xds/internal/balancer/priority/doc.go b/xds/internal/balancer/priority/utils.go similarity index 68% rename from xds/internal/balancer/priority/doc.go rename to xds/internal/balancer/priority/utils.go index 53bd270cb10e..45fbe764434a 100644 --- a/xds/internal/balancer/priority/doc.go +++ b/xds/internal/balancer/priority/utils.go @@ -1,6 +1,6 @@ /* * - * Copyright 2020 gRPC authors. + * Copyright 2021 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,16 @@ * */ -// Package priority implements the priority balancer. -// -// This balancer will be kept in internal until we use it in the xds balancers, -// and are confident its functionalities are stable. It will then be exported -// for more users. package priority + +func equalStringSlice(a, b []string) bool { + if len(a) != len(b) { + return false + } + for i := range a { + if a[i] != b[i] { + return false + } + } + return true +} diff --git a/xds/internal/balancer/priority/utils_test.go b/xds/internal/balancer/priority/utils_test.go new file mode 100644 index 000000000000..c80a89b080f9 --- /dev/null +++ b/xds/internal/balancer/priority/utils_test.go @@ -0,0 +1,62 @@ +/* + * + * Copyright 2021 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package priority + +import "testing" + +func TestCompareStringSlice(t *testing.T) { + tests := []struct { + name string + a []string + b []string + want bool + }{ + { + name: "equal", + a: []string{"a", "b"}, + b: []string{"a", "b"}, + want: true, + }, + { + name: "not equal", + a: []string{"a", "b"}, + b: []string{"a", "b", "c"}, + want: false, + }, + { + name: "both empty", + a: nil, + b: nil, + want: true, + }, + { + name: "one empty", + a: []string{"a", "b"}, + b: nil, + want: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := equalStringSlice(tt.a, tt.b); got != tt.want { + t.Errorf("equalStringSlice(%v, %v) = %v, want %v", tt.a, tt.b, got, tt.want) + } + }) + } +} diff --git a/xds/internal/testutils/balancer.go b/xds/internal/testutils/balancer.go index f49ba85606ff..673c4ee9a9b6 100644 --- a/xds/internal/testutils/balancer.go +++ b/xds/internal/testutils/balancer.go @@ -116,7 +116,7 @@ func (tcc *TestClientConn) NewSubConn(a []resolver.Address, o balancer.NewSubCon // RemoveSubConn removes the SubConn. func (tcc *TestClientConn) RemoveSubConn(sc balancer.SubConn) { - tcc.logger.Logf("testClientConn: RemoveSubConn(%p)", sc) + tcc.logger.Logf("testClientConn: RemoveSubConn(%s)", sc) select { case tcc.RemoveSubConnCh <- sc: default: From c9217c719557b3398af8fead8f4138c59dfa088e Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 11 Feb 2021 14:30:32 -0800 Subject: [PATCH 31/37] priority: pass build options to balancergroup (#4202) --- xds/internal/balancer/priority/balancer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xds/internal/balancer/priority/balancer.go b/xds/internal/balancer/priority/balancer.go index c1b761972c55..6c4ff08378ec 100644 --- a/xds/internal/balancer/priority/balancer.go +++ b/xds/internal/balancer/priority/balancer.go @@ -45,7 +45,7 @@ func init() { type priorityBB struct{} -func (priorityBB) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer { +func (priorityBB) Build(cc balancer.ClientConn, bOpts balancer.BuildOptions) balancer.Balancer { b := &priorityBalancer{ cc: cc, done: grpcsync.NewEvent(), @@ -55,7 +55,7 @@ func (priorityBB) Build(cc balancer.ClientConn, _ balancer.BuildOptions) balance } b.logger = prefixLogger(b) - b.bg = balancergroup.New(cc, b, nil, b.logger) + b.bg = balancergroup.New(cc, bOpts, b, nil, b.logger) b.bg.Start() go b.run() b.logger.Infof("Created") From 9f3606cd0f76e99139ca8dc15a78cfc08a737822 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 11 Feb 2021 15:03:39 -0800 Subject: [PATCH 32/37] xds: xds_cluster_impl_balancer part 1 (#4154) Part of C2P fallback. To support fallback to a DNS cluster. This PR adds implementation of xds_cluster_impl_balancer, which will be responsible for circuit breaking and rpc dropping. This PR only added RPC dropping. Circuit breaking will be done in a followup PR, after some necessary refactoring. --- vet.sh | 16 +- .../balancer/clusterimpl/balancer_test.go | 216 ++++++++++++ .../balancer/clusterimpl/clusterimpl.go | 312 ++++++++++++++++++ xds/internal/balancer/clusterimpl/config.go | 63 ++++ .../balancer/clusterimpl/config_test.go | 144 ++++++++ xds/internal/balancer/clusterimpl/logging.go | 34 ++ xds/internal/balancer/clusterimpl/picker.go | 104 ++++++ .../balancer/loadstore/load_store_wrapper.go | 120 +++++++ xds/internal/balancer/lrs/balancer.go | 76 +---- 9 files changed, 1007 insertions(+), 78 deletions(-) create mode 100644 xds/internal/balancer/clusterimpl/balancer_test.go create mode 100644 xds/internal/balancer/clusterimpl/clusterimpl.go create mode 100644 xds/internal/balancer/clusterimpl/config.go create mode 100644 xds/internal/balancer/clusterimpl/config_test.go create mode 100644 xds/internal/balancer/clusterimpl/logging.go create mode 100644 xds/internal/balancer/clusterimpl/picker.go create mode 100644 xds/internal/balancer/loadstore/load_store_wrapper.go diff --git a/vet.sh b/vet.sh index b41df6dc8607..605d7a80cfe6 100755 --- a/vet.sh +++ b/vet.sh @@ -141,8 +141,11 @@ not grep -Fv '.CredsBundle .NewAddress .NewServiceConfig .Type is deprecated: use Attributes +BuildVersion is deprecated balancer.ErrTransientFailure balancer.Picker +extDesc.Filename is deprecated +github.com/golang/protobuf/jsonpb is deprecated grpc.CallCustomCodec grpc.Code grpc.Compressor @@ -164,13 +167,7 @@ grpc.WithServiceConfig grpc.WithTimeout http.CloseNotifier info.SecurityVersion -resolver.Backend -resolver.GRPCLB -extDesc.Filename is deprecated -BuildVersion is deprecated -github.com/golang/protobuf/jsonpb is deprecated proto is deprecated -xxx_messageInfo_ proto.InternalMessageInfo is deprecated proto.EnumName is deprecated proto.ErrInternalBadWireType is deprecated @@ -184,7 +181,12 @@ proto.RegisterExtension is deprecated proto.RegisteredExtension is deprecated proto.RegisteredExtensions is deprecated proto.RegisterMapType is deprecated -proto.Unmarshaler is deprecated' "${SC_OUT}" +proto.Unmarshaler is deprecated +resolver.Backend +resolver.GRPCLB +Target is deprecated: Use the Target field in the BuildOptions instead. +xxx_messageInfo_ +' "${SC_OUT}" # - special golint on package comments. lint_package_comment_per_package() { diff --git a/xds/internal/balancer/clusterimpl/balancer_test.go b/xds/internal/balancer/clusterimpl/balancer_test.go new file mode 100644 index 000000000000..ac2d18821f01 --- /dev/null +++ b/xds/internal/balancer/clusterimpl/balancer_test.go @@ -0,0 +1,216 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package clusterimpl + +import ( + "context" + "strings" + "testing" + "time" + + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/balancer/roundrobin" + "google.golang.org/grpc/connectivity" + internalserviceconfig "google.golang.org/grpc/internal/serviceconfig" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/xds/internal/client/load" + "google.golang.org/grpc/xds/internal/testutils" + "google.golang.org/grpc/xds/internal/testutils/fakeclient" +) + +const ( + defaultTestTimeout = 1 * time.Second + testClusterName = "test-cluster" + testServiceName = "test-eds-service" + testLRSServerName = "test-lrs-name" +) + +var ( + testBackendAddrs = []resolver.Address{ + {Addr: "1.1.1.1:1"}, + } + + cmpOpts = cmp.Options{ + cmpopts.EquateEmpty(), + cmpopts.IgnoreFields(load.Data{}, "ReportInterval"), + } +) + +func init() { + newRandomWRR = testutils.NewTestWRR +} + +// TestDrop verifies that the balancer correctly drops the picks, and that +// the drops are reported. +func TestDrop(t *testing.T) { + xdsC := fakeclient.NewClient() + oldNewXDSClient := newXDSClient + newXDSClient = func() (xdsClientInterface, error) { return xdsC, nil } + defer func() { newXDSClient = oldNewXDSClient }() + + builder := balancer.Get(clusterImplName) + cc := testutils.NewTestClientConn(t) + b := builder.Build(cc, balancer.BuildOptions{}) + defer b.Close() + + const ( + dropReason = "test-dropping-category" + dropNumerator = 1 + dropDenominator = 2 + ) + if err := b.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: testBackendAddrs, + }, + BalancerConfig: &lbConfig{ + Cluster: testClusterName, + EDSServiceName: testServiceName, + LRSLoadReportingServerName: newString(testLRSServerName), + DropCategories: []dropCategory{{ + Category: dropReason, + RequestsPerMillion: million * dropNumerator / dropDenominator, + }}, + ChildPolicy: &internalserviceconfig.BalancerConfig{ + Name: roundrobin.Name, + }, + }, + }); err != nil { + t.Fatalf("unexpected error from UpdateClientConnState: %v", err) + } + + ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) + defer cancel() + + got, err := xdsC.WaitForReportLoad(ctx) + if err != nil { + t.Fatalf("xdsClient.ReportLoad failed with error: %v", err) + } + if got.Server != testLRSServerName { + t.Fatalf("xdsClient.ReportLoad called with {%q}: want {%q}", got.Server, testLRSServerName) + } + + sc1 := <-cc.NewSubConnCh + b.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + // This should get the connecting picker. + p0 := <-cc.NewPickerCh + for i := 0; i < 10; i++ { + _, err := p0.Pick(balancer.PickInfo{}) + if err != balancer.ErrNoSubConnAvailable { + t.Fatalf("picker.Pick, got _,%v, want Err=%v", err, balancer.ErrNoSubConnAvailable) + } + } + + b.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + // Test pick with one backend. + p1 := <-cc.NewPickerCh + const rpcCount = 20 + for i := 0; i < rpcCount; i++ { + gotSCSt, err := p1.Pick(balancer.PickInfo{}) + // Even RPCs are dropped. + if i%2 == 0 { + if err == nil || !strings.Contains(err.Error(), "dropped") { + t.Fatalf("pick.Pick, got %v, %v, want error RPC dropped", gotSCSt, err) + } + continue + } + if err != nil || !cmp.Equal(gotSCSt.SubConn, sc1, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("picker.Pick, got %v, %v, want SubConn=%v", gotSCSt, err, sc1) + } + if gotSCSt.Done != nil { + gotSCSt.Done(balancer.DoneInfo{}) + } + } + + // Dump load data from the store and compare with expected counts. + loadStore := xdsC.LoadStore() + if loadStore == nil { + t.Fatal("loadStore is nil in xdsClient") + } + const dropCount = rpcCount * dropNumerator / dropDenominator + wantStatsData0 := []*load.Data{{ + Cluster: testClusterName, + Service: testServiceName, + TotalDrops: dropCount, + Drops: map[string]uint64{dropReason: dropCount}, + }} + + gotStatsData0 := loadStore.Stats([]string{testClusterName}) + if diff := cmp.Diff(gotStatsData0, wantStatsData0, cmpOpts); diff != "" { + t.Fatalf("got unexpected reports, diff (-got, +want): %v", diff) + } + + // Send an update with new drop configs. + const ( + dropReason2 = "test-dropping-category-2" + dropNumerator2 = 1 + dropDenominator2 = 4 + ) + if err := b.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: testBackendAddrs, + }, + BalancerConfig: &lbConfig{ + Cluster: testClusterName, + EDSServiceName: testServiceName, + LRSLoadReportingServerName: newString(testLRSServerName), + DropCategories: []dropCategory{{ + Category: dropReason2, + RequestsPerMillion: million * dropNumerator2 / dropDenominator2, + }}, + ChildPolicy: &internalserviceconfig.BalancerConfig{ + Name: roundrobin.Name, + }, + }, + }); err != nil { + t.Fatalf("unexpected error from UpdateClientConnState: %v", err) + } + + p2 := <-cc.NewPickerCh + for i := 0; i < rpcCount; i++ { + gotSCSt, err := p2.Pick(balancer.PickInfo{}) + // Even RPCs are dropped. + if i%4 == 0 { + if err == nil || !strings.Contains(err.Error(), "dropped") { + t.Fatalf("pick.Pick, got %v, %v, want error RPC dropped", gotSCSt, err) + } + continue + } + if err != nil || !cmp.Equal(gotSCSt.SubConn, sc1, cmp.AllowUnexported(testutils.TestSubConn{})) { + t.Fatalf("picker.Pick, got %v, %v, want SubConn=%v", gotSCSt, err, sc1) + } + if gotSCSt.Done != nil { + gotSCSt.Done(balancer.DoneInfo{}) + } + } + + const dropCount2 = rpcCount * dropNumerator2 / dropDenominator2 + wantStatsData1 := []*load.Data{{ + Cluster: testClusterName, + Service: testServiceName, + TotalDrops: dropCount2, + Drops: map[string]uint64{dropReason2: dropCount2}, + }} + + gotStatsData1 := loadStore.Stats([]string{testClusterName}) + if diff := cmp.Diff(gotStatsData1, wantStatsData1, cmpOpts); diff != "" { + t.Fatalf("got unexpected reports, diff (-got, +want): %v", diff) + } +} diff --git a/xds/internal/balancer/clusterimpl/clusterimpl.go b/xds/internal/balancer/clusterimpl/clusterimpl.go new file mode 100644 index 000000000000..e9201c10bdc9 --- /dev/null +++ b/xds/internal/balancer/clusterimpl/clusterimpl.go @@ -0,0 +1,312 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package clusterimpl implements the xds_cluster_impl balancing policy. It +// handles the cluster features (e.g. circuit_breaking, RPC dropping). +// +// Note that it doesn't handle name resolution, which is done by policy +// xds_cluster_resolver. +package clusterimpl + +import ( + "encoding/json" + "fmt" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/internal/buffer" + "google.golang.org/grpc/internal/grpclog" + "google.golang.org/grpc/internal/grpcsync" + "google.golang.org/grpc/serviceconfig" + "google.golang.org/grpc/xds/internal/balancer/loadstore" + xdsclient "google.golang.org/grpc/xds/internal/client" + "google.golang.org/grpc/xds/internal/client/load" +) + +const ( + clusterImplName = "xds_cluster_impl_experimental" + // TODO: define defaultRequestCountMax = 1024 +) + +func init() { + balancer.Register(clusterImplBB{}) +} + +var newXDSClient = func() (xdsClientInterface, error) { return xdsclient.New() } + +type clusterImplBB struct{} + +func (clusterImplBB) Build(cc balancer.ClientConn, bOpts balancer.BuildOptions) balancer.Balancer { + b := &clusterImplBalancer{ + ClientConn: cc, + bOpts: bOpts, + closed: grpcsync.NewEvent(), + loadWrapper: loadstore.NewWrapper(), + pickerUpdateCh: buffer.NewUnbounded(), + } + b.logger = prefixLogger(b) + + client, err := newXDSClient() + if err != nil { + b.logger.Errorf("failed to create xds-client: %v", err) + return nil + } + b.xdsC = client + go b.run() + + b.logger.Infof("Created") + return b +} + +func (clusterImplBB) Name() string { + return clusterImplName +} + +func (clusterImplBB) ParseConfig(c json.RawMessage) (serviceconfig.LoadBalancingConfig, error) { + return parseConfig(c) +} + +// xdsClientInterface contains only the xds_client methods needed by LRS +// balancer. It's defined so we can override xdsclient in tests. +type xdsClientInterface interface { + ReportLoad(server string) (*load.Store, func()) + Close() +} + +type clusterImplBalancer struct { + balancer.ClientConn + bOpts balancer.BuildOptions + closed *grpcsync.Event + logger *grpclog.PrefixLogger + xdsC xdsClientInterface + + config *lbConfig + childLB balancer.Balancer + cancelLoadReport func() + clusterName string + edsServiceName string + lrsServerName string + loadWrapper *loadstore.Wrapper + + // childState/drops/requestCounter can only be accessed in run(). And run() + // is the only goroutine that sends picker to the parent ClientConn. All + // requests to update picker need to be sent to pickerUpdateCh. + childState balancer.State + drops []*dropper + // TODO: add serviceRequestCount and maxRequestCount for circuit breaking. + pickerUpdateCh *buffer.Unbounded +} + +// updateLoadStore checks the config for load store, and decides whether it +// needs to restart the load reporting stream. +func (cib *clusterImplBalancer) updateLoadStore(newConfig *lbConfig) error { + var updateLoadClusterAndService bool + + // ClusterName is different, restart. ClusterName is from ClusterName and + // EdsServiceName. + if cib.clusterName != newConfig.Cluster { + updateLoadClusterAndService = true + cib.clusterName = newConfig.Cluster + } + if cib.edsServiceName != newConfig.EDSServiceName { + updateLoadClusterAndService = true + cib.edsServiceName = newConfig.EDSServiceName + } + if updateLoadClusterAndService { + // This updates the clusterName and serviceName that will be reported + // for the loads. The update here is too early, the perfect timing is + // when the picker is updated with the new connection. But from this + // balancer's point of view, it's impossible to tell. + // + // On the other hand, this will almost never happen. Each LRS policy + // shouldn't get updated config. The parent should do a graceful switch + // when the clusterName or serviceName is changed. + cib.loadWrapper.UpdateClusterAndService(cib.clusterName, cib.edsServiceName) + } + + // Check if it's necessary to restart load report. + var newLRSServerName string + if newConfig.LRSLoadReportingServerName != nil { + newLRSServerName = *newConfig.LRSLoadReportingServerName + } + if cib.lrsServerName != newLRSServerName { + // LrsLoadReportingServerName is different, load should be report to a + // different server, restart. + cib.lrsServerName = newLRSServerName + if cib.cancelLoadReport != nil { + cib.cancelLoadReport() + cib.cancelLoadReport = nil + } + var loadStore *load.Store + if cib.xdsC != nil { + loadStore, cib.cancelLoadReport = cib.xdsC.ReportLoad(cib.lrsServerName) + } + cib.loadWrapper.UpdateLoadStore(loadStore) + } + + return nil +} + +func (cib *clusterImplBalancer) UpdateClientConnState(s balancer.ClientConnState) error { + if cib.closed.HasFired() { + cib.logger.Warningf("xds: received ClientConnState {%+v} after clusterImplBalancer was closed", s) + return nil + } + + newConfig, ok := s.BalancerConfig.(*lbConfig) + if !ok { + return fmt.Errorf("unexpected balancer config with type: %T", s.BalancerConfig) + } + + // Need to check for potential errors at the beginning of this function, so + // that on errors, we reject the whole config, instead of applying part of + // it. + bb := balancer.Get(newConfig.ChildPolicy.Name) + if bb == nil { + return fmt.Errorf("balancer %q not registered", newConfig.ChildPolicy.Name) + } + + // Update load reporting config. This needs to be done before updating the + // child policy because we need the loadStore from the updated client to be + // passed to the ccWrapper, so that the next picker from the child policy + // will pick up the new loadStore. + if err := cib.updateLoadStore(newConfig); err != nil { + return err + } + + // Compare new drop config. And update picker if it's changed. + var updatePicker bool + if cib.config == nil || !equalDropCategories(cib.config.DropCategories, newConfig.DropCategories) { + cib.drops = make([]*dropper, 0, len(newConfig.DropCategories)) + for _, c := range newConfig.DropCategories { + cib.drops = append(cib.drops, newDropper(c)) + } + updatePicker = true + } + + // TODO: compare cluster name. And update picker if it's changed, because + // circuit breaking's stream counter will be different. + // + // Set `updatePicker` to manually update the picker. + + // TODO: compare upper bound of stream count. And update picker if it's + // changed. This is also for circuit breaking. + // + // Set `updatePicker` to manually update the picker. + + if updatePicker { + cib.pickerUpdateCh.Put(&dropConfigs{ + drops: cib.drops, + }) + } + + // If child policy is a different type, recreate the sub-balancer. + if cib.config == nil || cib.config.ChildPolicy.Name != newConfig.ChildPolicy.Name { + if cib.childLB != nil { + cib.childLB.Close() + } + cib.childLB = bb.Build(cib, cib.bOpts) + } + cib.config = newConfig + + if cib.childLB == nil { + // This is not an expected situation, and should be super rare in + // practice. + // + // When this happens, we already applied all the other configurations + // (drop/circuit breaking), but there's no child policy. This balancer + // will be stuck, and we report the error to the parent. + return fmt.Errorf("child policy is nil, this means balancer %q's Build() returned nil", newConfig.ChildPolicy.Name) + } + + // Addresses and sub-balancer config are sent to sub-balancer. + return cib.childLB.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: s.ResolverState, + BalancerConfig: cib.config.ChildPolicy.Config, + }) +} + +func (cib *clusterImplBalancer) ResolverError(err error) { + if cib.closed.HasFired() { + cib.logger.Warningf("xds: received resolver error {%+v} after clusterImplBalancer was closed", err) + return + } + + if cib.childLB != nil { + cib.childLB.ResolverError(err) + } +} + +func (cib *clusterImplBalancer) UpdateSubConnState(sc balancer.SubConn, s balancer.SubConnState) { + if cib.closed.HasFired() { + cib.logger.Warningf("xds: received subconn state change {%+v, %+v} after clusterImplBalancer was closed", sc, s) + return + } + + if cib.childLB != nil { + cib.childLB.UpdateSubConnState(sc, s) + } +} + +func (cib *clusterImplBalancer) Close() { + if cib.childLB != nil { + cib.childLB.Close() + cib.childLB = nil + } + cib.xdsC.Close() + cib.closed.Fire() + cib.logger.Infof("Shutdown") +} + +// Override methods to accept updates from the child LB. + +func (cib *clusterImplBalancer) UpdateState(state balancer.State) { + // Instead of updating parent ClientConn inline, send state to run(). + cib.pickerUpdateCh.Put(state) +} + +type dropConfigs struct { + drops []*dropper +} + +func (cib *clusterImplBalancer) run() { + for { + select { + case update := <-cib.pickerUpdateCh.Get(): + cib.pickerUpdateCh.Load() + switch u := update.(type) { + case balancer.State: + cib.childState = u + cib.ClientConn.UpdateState(balancer.State{ + ConnectivityState: cib.childState.ConnectivityState, + Picker: newDropPicker(cib.childState, cib.drops, cib.loadWrapper), + }) + case *dropConfigs: + cib.drops = u.drops + // cib.requestCounter = u.requestCounter + if cib.childState.Picker != nil { + cib.ClientConn.UpdateState(balancer.State{ + ConnectivityState: cib.childState.ConnectivityState, + Picker: newDropPicker(cib.childState, cib.drops, cib.loadWrapper), + }) + } + } + case <-cib.closed.Done(): + return + } + } +} diff --git a/xds/internal/balancer/clusterimpl/config.go b/xds/internal/balancer/clusterimpl/config.go new file mode 100644 index 000000000000..548ab34bce4d --- /dev/null +++ b/xds/internal/balancer/clusterimpl/config.go @@ -0,0 +1,63 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package clusterimpl + +import ( + "encoding/json" + + internalserviceconfig "google.golang.org/grpc/internal/serviceconfig" + "google.golang.org/grpc/serviceconfig" +) + +type dropCategory struct { + Category string + RequestsPerMillion uint32 +} + +// lbConfig is the balancer config for weighted_target. +type lbConfig struct { + serviceconfig.LoadBalancingConfig + + Cluster string + EDSServiceName string + LRSLoadReportingServerName *string + MaxConcurrentRequests *uint32 + DropCategories []dropCategory + ChildPolicy *internalserviceconfig.BalancerConfig +} + +func parseConfig(c json.RawMessage) (*lbConfig, error) { + var cfg lbConfig + if err := json.Unmarshal(c, &cfg); err != nil { + return nil, err + } + return &cfg, nil +} + +func equalDropCategories(a, b []dropCategory) bool { + if len(a) != len(b) { + return false + } + for i := range a { + if a[i] != b[i] { + return false + } + } + return true +} diff --git a/xds/internal/balancer/clusterimpl/config_test.go b/xds/internal/balancer/clusterimpl/config_test.go new file mode 100644 index 000000000000..89696981e2a0 --- /dev/null +++ b/xds/internal/balancer/clusterimpl/config_test.go @@ -0,0 +1,144 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package clusterimpl + +import ( + "testing" + + "github.com/google/go-cmp/cmp" + "google.golang.org/grpc/balancer" + _ "google.golang.org/grpc/balancer/roundrobin" + internalserviceconfig "google.golang.org/grpc/internal/serviceconfig" + _ "google.golang.org/grpc/xds/internal/balancer/weightedtarget" +) + +const ( + testJSONConfig = `{ + "cluster": "test_cluster", + "edsServiceName": "test-eds", + "lrsLoadReportingServerName": "lrs_server", + "maxConcurrentRequests": 123, + "dropCategories": [ + { + "category": "drop-1", + "requestsPerMillion": 314 + }, + { + "category": "drop-2", + "requestsPerMillion": 159 + } + ], + "childPolicy": [ + { + "weighted_target_experimental": { + "targets": { + "wt-child-1": { + "weight": 75, + "childPolicy":[{"round_robin":{}}] + }, + "wt-child-2": { + "weight": 25, + "childPolicy":[{"round_robin":{}}] + } + } + } + } + ] +}` + + wtName = "weighted_target_experimental" +) + +var ( + wtConfigParser = balancer.Get(wtName).(balancer.ConfigParser) + wtConfigJSON = `{ + "targets": { + "wt-child-1": { + "weight": 75, + "childPolicy":[{"round_robin":{}}] + }, + "wt-child-2": { + "weight": 25, + "childPolicy":[{"round_robin":{}}] + } + } +}` + + wtConfig, _ = wtConfigParser.ParseConfig([]byte(wtConfigJSON)) +) + +func TestParseConfig(t *testing.T) { + tests := []struct { + name string + js string + want *lbConfig + wantErr bool + }{ + { + name: "empty json", + js: "", + want: nil, + wantErr: true, + }, + { + name: "bad json", + js: "{", + want: nil, + wantErr: true, + }, + { + name: "OK", + js: testJSONConfig, + want: &lbConfig{ + Cluster: "test_cluster", + EDSServiceName: "test-eds", + LRSLoadReportingServerName: newString("lrs_server"), + MaxConcurrentRequests: newUint32(123), + DropCategories: []dropCategory{ + {Category: "drop-1", RequestsPerMillion: 314}, + {Category: "drop-2", RequestsPerMillion: 159}, + }, + ChildPolicy: &internalserviceconfig.BalancerConfig{ + Name: wtName, + Config: wtConfig, + }, + }, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := parseConfig([]byte(tt.js)) + if (err != nil) != tt.wantErr { + t.Fatalf("parseConfig() error = %v, wantErr %v", err, tt.wantErr) + } + if !cmp.Equal(got, tt.want) { + t.Errorf("parseConfig() got unexpected result, diff: %v", cmp.Diff(got, tt.want)) + } + }) + } +} + +func newString(s string) *string { + return &s +} + +func newUint32(i uint32) *uint32 { + return &i +} diff --git a/xds/internal/balancer/clusterimpl/logging.go b/xds/internal/balancer/clusterimpl/logging.go new file mode 100644 index 000000000000..3bbd1b0d7837 --- /dev/null +++ b/xds/internal/balancer/clusterimpl/logging.go @@ -0,0 +1,34 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package clusterimpl + +import ( + "fmt" + + "google.golang.org/grpc/grpclog" + internalgrpclog "google.golang.org/grpc/internal/grpclog" +) + +const prefix = "[xds-cluster-impl-lb %p] " + +var logger = grpclog.Component("xds") + +func prefixLogger(p *clusterImplBalancer) *internalgrpclog.PrefixLogger { + return internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf(prefix, p)) +} diff --git a/xds/internal/balancer/clusterimpl/picker.go b/xds/internal/balancer/clusterimpl/picker.go new file mode 100644 index 000000000000..05e9f89786fd --- /dev/null +++ b/xds/internal/balancer/clusterimpl/picker.go @@ -0,0 +1,104 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package clusterimpl + +import ( + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/internal/wrr" + "google.golang.org/grpc/status" + "google.golang.org/grpc/xds/internal/client/load" +) + +var newRandomWRR = wrr.NewRandom + +const million = 1000000 + +type dropper struct { + category string + w wrr.WRR +} + +// greatest common divisor (GCD) via Euclidean algorithm +func gcd(a, b uint32) uint32 { + for b != 0 { + t := b + b = a % b + a = t + } + return a +} + +func newDropper(c dropCategory) *dropper { + w := newRandomWRR() + gcdv := gcd(c.RequestsPerMillion, million) + // Return true for RequestPerMillion, false for the rest. + w.Add(true, int64(c.RequestsPerMillion/gcdv)) + w.Add(false, int64((million-c.RequestsPerMillion)/gcdv)) + + return &dropper{ + category: c.Category, + w: w, + } +} + +func (d *dropper) drop() (ret bool) { + return d.w.Next().(bool) +} + +// loadReporter wraps the methods from the loadStore that are used here. +type loadReporter interface { + CallDropped(locality string) +} + +type dropPicker struct { + drops []*dropper + s balancer.State + loadStore loadReporter + // TODO: add serviceRequestCount and maxRequestCount for circuit breaking. +} + +func newDropPicker(s balancer.State, drops []*dropper, loadStore load.PerClusterReporter) *dropPicker { + return &dropPicker{ + drops: drops, + s: s, + loadStore: loadStore, + } +} + +func (d *dropPicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { + // Don't drop unless the inner picker is READY. Similar to + // https://github.com/grpc/grpc-go/issues/2622. + if d.s.ConnectivityState != connectivity.Ready { + return d.s.Picker.Pick(info) + } + + for _, dp := range d.drops { + if dp.drop() { + if d.loadStore != nil { + d.loadStore.CallDropped(dp.category) + } + return balancer.PickResult{}, status.Errorf(codes.Unavailable, "RPC is dropped") + } + } + // TODO: support circuit breaking, check if d.maxRequestCount >= + // d.counter.StartRequestWithMax(). + return d.s.Picker.Pick(info) +} diff --git a/xds/internal/balancer/loadstore/load_store_wrapper.go b/xds/internal/balancer/loadstore/load_store_wrapper.go new file mode 100644 index 000000000000..88fa344118cc --- /dev/null +++ b/xds/internal/balancer/loadstore/load_store_wrapper.go @@ -0,0 +1,120 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package loadstore contains the loadStoreWrapper shared by the balancers. +package loadstore + +import ( + "sync" + + "google.golang.org/grpc/xds/internal/client/load" +) + +// NewWrapper creates a Wrapper. +func NewWrapper() *Wrapper { + return &Wrapper{} +} + +// Wrapper wraps a load store with cluster and edsService. +// +// It's store and cluster/edsService can be updated separately. And it will +// update its internal perCluster store so that new stats will be added to the +// correct perCluster. +// +// Note that this struct is a temporary walkaround before we implement graceful +// switch for EDS. Any update to the clusterName and serviceName is too early, +// the perfect timing is when the picker is updated with the new connection. +// This early update could cause picks for the old SubConn being reported to the +// new services. +// +// When the graceful switch in EDS is done, there should be no need for this +// struct. The policies that record/report load shouldn't need to handle update +// of lrsServerName/cluster/edsService. Its parent should do a graceful switch +// of the whole tree when one of that changes. +type Wrapper struct { + mu sync.RWMutex + cluster string + edsService string + // store and perCluster are initialized as nil. They are only set by the + // balancer when LRS is enabled. Before that, all functions to record loads + // are no-op. + store *load.Store + perCluster load.PerClusterReporter +} + +// UpdateClusterAndService updates the cluster name and eds service for this +// wrapper. If any one of them is changed from before, the perCluster store in +// this wrapper will also be updated. +func (lsw *Wrapper) UpdateClusterAndService(cluster, edsService string) { + lsw.mu.Lock() + defer lsw.mu.Unlock() + if cluster == lsw.cluster && edsService == lsw.edsService { + return + } + lsw.cluster = cluster + lsw.edsService = edsService + lsw.perCluster = lsw.store.PerCluster(lsw.cluster, lsw.edsService) +} + +// UpdateLoadStore updates the load store for this wrapper. If it is changed +// from before, the perCluster store in this wrapper will also be updated. +func (lsw *Wrapper) UpdateLoadStore(store *load.Store) { + lsw.mu.Lock() + defer lsw.mu.Unlock() + if store == lsw.store { + return + } + lsw.store = store + lsw.perCluster = lsw.store.PerCluster(lsw.cluster, lsw.edsService) +} + +// CallStarted records a call started in the store. +func (lsw *Wrapper) CallStarted(locality string) { + lsw.mu.RLock() + defer lsw.mu.RUnlock() + if lsw.perCluster != nil { + lsw.perCluster.CallStarted(locality) + } +} + +// CallFinished records a call finished in the store. +func (lsw *Wrapper) CallFinished(locality string, err error) { + lsw.mu.RLock() + defer lsw.mu.RUnlock() + if lsw.perCluster != nil { + lsw.perCluster.CallFinished(locality, err) + } +} + +// CallServerLoad records the server load in the store. +func (lsw *Wrapper) CallServerLoad(locality, name string, val float64) { + lsw.mu.RLock() + defer lsw.mu.RUnlock() + if lsw.perCluster != nil { + lsw.perCluster.CallServerLoad(locality, name, val) + } +} + +// CallDropped records a call dropped in the store. +func (lsw *Wrapper) CallDropped(category string) { + lsw.mu.RLock() + defer lsw.mu.RUnlock() + if lsw.perCluster != nil { + lsw.perCluster.CallDropped(category) + } +} diff --git a/xds/internal/balancer/lrs/balancer.go b/xds/internal/balancer/lrs/balancer.go index d60355afd25e..ab9ee7109db1 100644 --- a/xds/internal/balancer/lrs/balancer.go +++ b/xds/internal/balancer/lrs/balancer.go @@ -22,11 +22,11 @@ package lrs import ( "encoding/json" "fmt" - "sync" "google.golang.org/grpc/balancer" "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/serviceconfig" + "google.golang.org/grpc/xds/internal/balancer/loadstore" xdsclient "google.golang.org/grpc/xds/internal/client" "google.golang.org/grpc/xds/internal/client/load" ) @@ -162,72 +162,6 @@ type xdsClientInterface interface { Close() } -type loadStoreWrapper struct { - mu sync.RWMutex - cluster string - edsService string - // Both store and perCluster will be nil if load reporting is disabled (EDS - // response doesn't have LRS server name). Note that methods on Store and - // perCluster all handle nil, so there's no need to check nil before calling - // them. - store *load.Store - perCluster load.PerClusterReporter -} - -func (lsw *loadStoreWrapper) updateClusterAndService(cluster, edsService string) { - lsw.mu.Lock() - defer lsw.mu.Unlock() - if cluster == lsw.cluster && edsService == lsw.edsService { - return - } - lsw.cluster = cluster - lsw.edsService = edsService - lsw.perCluster = lsw.store.PerCluster(lsw.cluster, lsw.edsService) -} - -func (lsw *loadStoreWrapper) updateLoadStore(store *load.Store) { - lsw.mu.Lock() - defer lsw.mu.Unlock() - if store == lsw.store { - return - } - lsw.store = store - lsw.perCluster = nil - lsw.perCluster = lsw.store.PerCluster(lsw.cluster, lsw.edsService) -} - -func (lsw *loadStoreWrapper) CallStarted(locality string) { - lsw.mu.RLock() - defer lsw.mu.RUnlock() - if lsw.perCluster != nil { - lsw.perCluster.CallStarted(locality) - } -} - -func (lsw *loadStoreWrapper) CallFinished(locality string, err error) { - lsw.mu.RLock() - defer lsw.mu.RUnlock() - if lsw.perCluster != nil { - lsw.perCluster.CallFinished(locality, err) - } -} - -func (lsw *loadStoreWrapper) CallServerLoad(locality, name string, val float64) { - lsw.mu.RLock() - defer lsw.mu.RUnlock() - if lsw.perCluster != nil { - lsw.perCluster.CallServerLoad(locality, name, val) - } -} - -func (lsw *loadStoreWrapper) CallDropped(category string) { - lsw.mu.RLock() - defer lsw.mu.RUnlock() - if lsw.perCluster != nil { - lsw.perCluster.CallDropped(category) - } -} - type xdsClientWrapper struct { c xdsClientInterface cancelLoadReport func() @@ -236,13 +170,13 @@ type xdsClientWrapper struct { lrsServerName string // loadWrapper is a wrapper with loadOriginal, with clusterName and // edsServiceName. It's used children to report loads. - loadWrapper *loadStoreWrapper + loadWrapper *loadstore.Wrapper } func newXDSClientWrapper(c xdsClientInterface) *xdsClientWrapper { return &xdsClientWrapper{ c: c, - loadWrapper: &loadStoreWrapper{}, + loadWrapper: loadstore.NewWrapper(), } } @@ -274,7 +208,7 @@ func (w *xdsClientWrapper) update(newConfig *lbConfig) error { // On the other hand, this will almost never happen. Each LRS policy // shouldn't get updated config. The parent should do a graceful switch when // the clusterName or serviceName is changed. - w.loadWrapper.updateClusterAndService(w.clusterName, w.edsServiceName) + w.loadWrapper.UpdateClusterAndService(w.clusterName, w.edsServiceName) } if w.lrsServerName != newConfig.LrsLoadReportingServerName { @@ -293,7 +227,7 @@ func (w *xdsClientWrapper) update(newConfig *lbConfig) error { if w.c != nil { loadStore, w.cancelLoadReport = w.c.ReportLoad(w.lrsServerName) } - w.loadWrapper.updateLoadStore(loadStore) + w.loadWrapper.UpdateLoadStore(loadStore) } return nil From 425d405f392835ed7ad2f5f91c32443961e29246 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Fri, 12 Feb 2021 14:24:30 -0800 Subject: [PATCH 33/37] test: add timeout to regular xds test runs (#4201) --- test/kokoro/xds.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/kokoro/xds.sh b/test/kokoro/xds.sh index ee98399319bc..36a3f4563cfe 100755 --- a/test/kokoro/xds.sh +++ b/test/kokoro/xds.sh @@ -27,10 +27,10 @@ grpc/tools/run_tests/helper_scripts/prep_xds.sh # they are added into "all". GRPC_GO_LOG_VERBOSITY_LEVEL=99 GRPC_GO_LOG_SEVERITY_LEVEL=info \ python3 grpc/tools/run_tests/run_xds_tests.py \ - --test_case="all,path_matching,header_matching,circuit_breaking" \ + --test_case="all,path_matching,header_matching,circuit_breaking,timeout" \ --project_id=grpc-testing \ --project_num=830293263384 \ - --source_image=projects/grpc-testing/global/images/xds-test-server-3 \ + --source_image=projects/grpc-testing/global/images/xds-test-server-4 \ --path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \ --gcp_suffix=$(date '+%s') \ --verbose \ From 1b75f7144df29e6ae87043e972b5673a0e03cbbf Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Wed, 17 Feb 2021 10:46:07 -0800 Subject: [PATCH 34/37] circuit breaking: keep max_count per picker, instead of globally, and add support in cluster_impl balancer (#4203) Also changed circuit breaking counter implementation to move max_count into the picker, because this is how cluster_impl is designed. Implementation in EDS is also modified to keep max_count in picker. --- .../balancer/cdsbalancer/cdsbalancer.go | 8 +- .../cdsbalancer/cdsbalancer_security_test.go | 14 +-- .../balancer/cdsbalancer/cdsbalancer_test.go | 25 ++-- .../balancer/clusterimpl/balancer_test.go | 116 +++++++++++++++++- .../balancer/clusterimpl/clusterimpl.go | 67 ++++++---- xds/internal/balancer/clusterimpl/picker.go | 37 +++++- xds/internal/balancer/edsbalancer/config.go | 11 ++ xds/internal/balancer/edsbalancer/eds.go | 6 +- xds/internal/balancer/edsbalancer/eds_impl.go | 27 ++-- .../balancer/edsbalancer/eds_impl_test.go | 8 +- xds/internal/balancer/edsbalancer/eds_test.go | 51 +++++++- xds/internal/client/requests_counter.go | 28 +---- xds/internal/client/requests_counter_test.go | 26 ++-- 13 files changed, 310 insertions(+), 114 deletions(-) diff --git a/xds/internal/balancer/cdsbalancer/cdsbalancer.go b/xds/internal/balancer/cdsbalancer/cdsbalancer.go index 5a8a3c35d79c..04286d715901 100644 --- a/xds/internal/balancer/cdsbalancer/cdsbalancer.go +++ b/xds/internal/balancer/cdsbalancer/cdsbalancer.go @@ -34,7 +34,6 @@ import ( "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" "google.golang.org/grpc/xds/internal/balancer/edsbalancer" - "google.golang.org/grpc/xds/internal/client" xdsclient "google.golang.org/grpc/xds/internal/client" "google.golang.org/grpc/xds/internal/client/bootstrap" ) @@ -328,8 +327,6 @@ func (b *cdsBalancer) handleWatchUpdate(update *watchUpdate) { return } - client.SetMaxRequests(update.cds.ServiceName, update.cds.MaxRequests) - // The first good update from the watch API leads to the instantiation of an // edsBalancer. Further updates/errors are propagated to the existing // edsBalancer. @@ -342,7 +339,10 @@ func (b *cdsBalancer) handleWatchUpdate(update *watchUpdate) { b.edsLB = edsLB b.logger.Infof("Created child policy %p of type %s", b.edsLB, edsName) } - lbCfg := &edsbalancer.EDSConfig{EDSServiceName: update.cds.ServiceName} + lbCfg := &edsbalancer.EDSConfig{ + EDSServiceName: update.cds.ServiceName, + MaxConcurrentRequests: update.cds.MaxRequests, + } if update.cds.EnableLRS { // An empty string here indicates that the edsBalancer should use the // same xDS server for load reporting as it does for EDS diff --git a/xds/internal/balancer/cdsbalancer/cdsbalancer_security_test.go b/xds/internal/balancer/cdsbalancer/cdsbalancer_security_test.go index b39b2abf06bc..e862f99cd4e1 100644 --- a/xds/internal/balancer/cdsbalancer/cdsbalancer_security_test.go +++ b/xds/internal/balancer/cdsbalancer/cdsbalancer_security_test.go @@ -233,7 +233,7 @@ func (s) TestSecurityConfigWithoutXDSCreds(t *testing.T) { // returned to the CDS balancer, because we have overridden the // newEDSBalancer function as part of test setup. cdsUpdate := xdsclient.ClusterUpdate{ServiceName: serviceName} - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, nil, false) ctx, ctxCancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer ctxCancel() if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdate, nil}, wantCCS, edsB); err != nil { @@ -289,7 +289,7 @@ func (s) TestNoSecurityConfigWithXDSCreds(t *testing.T) { // newEDSBalancer function as part of test setup. No security config is // passed to the CDS balancer as part of this update. cdsUpdate := xdsclient.ClusterUpdate{ServiceName: serviceName} - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, nil, false) ctx, ctxCancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer ctxCancel() if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdate, nil}, wantCCS, edsB); err != nil { @@ -445,7 +445,7 @@ func (s) TestSecurityConfigUpdate_BadToGood(t *testing.T) { // create a new EDS balancer. The fake EDS balancer created above will be // returned to the CDS balancer, because we have overridden the // newEDSBalancer function as part of test setup. - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, nil, false) if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdateWithGoodSecurityCfg, nil}, wantCCS, edsB); err != nil { t.Fatal(err) } @@ -479,7 +479,7 @@ func (s) TestGoodSecurityConfig(t *testing.T) { // create a new EDS balancer. The fake EDS balancer created above will be // returned to the CDS balancer, because we have overridden the // newEDSBalancer function as part of test setup. - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, nil, false) ctx, ctxCancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer ctxCancel() if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdateWithGoodSecurityCfg, nil}, wantCCS, edsB); err != nil { @@ -510,7 +510,7 @@ func (s) TestSecurityConfigUpdate_GoodToFallback(t *testing.T) { // create a new EDS balancer. The fake EDS balancer created above will be // returned to the CDS balancer, because we have overridden the // newEDSBalancer function as part of test setup. - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, nil, false) ctx, ctxCancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer ctxCancel() if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdateWithGoodSecurityCfg, nil}, wantCCS, edsB); err != nil { @@ -560,7 +560,7 @@ func (s) TestSecurityConfigUpdate_GoodToBad(t *testing.T) { // create a new EDS balancer. The fake EDS balancer created above will be // returned to the CDS balancer, because we have overridden the // newEDSBalancer function as part of test setup. - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, nil, false) ctx, ctxCancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer ctxCancel() if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdateWithGoodSecurityCfg, nil}, wantCCS, edsB); err != nil { @@ -637,7 +637,7 @@ func (s) TestSecurityConfigUpdate_GoodToGood(t *testing.T) { RootInstanceName: "default1", }, } - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, nil, false) ctx, ctxCancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer ctxCancel() if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdate, nil}, wantCCS, edsB); err != nil { diff --git a/xds/internal/balancer/cdsbalancer/cdsbalancer_test.go b/xds/internal/balancer/cdsbalancer/cdsbalancer_test.go index 9d7c4a7bff55..9c7bc2362ab7 100644 --- a/xds/internal/balancer/cdsbalancer/cdsbalancer_test.go +++ b/xds/internal/balancer/cdsbalancer/cdsbalancer_test.go @@ -193,8 +193,11 @@ func cdsCCS(cluster string) balancer.ClientConnState { // edsCCS is a helper function to construct a good update passed from the // cdsBalancer to the edsBalancer. -func edsCCS(service string, enableLRS bool) balancer.ClientConnState { - lbCfg := &edsbalancer.EDSConfig{EDSServiceName: service} +func edsCCS(service string, countMax *uint32, enableLRS bool) balancer.ClientConnState { + lbCfg := &edsbalancer.EDSConfig{ + EDSServiceName: service, + MaxConcurrentRequests: countMax, + } if enableLRS { lbCfg.LrsLoadReportingServerName = new(string) } @@ -350,12 +353,12 @@ func (s) TestHandleClusterUpdate(t *testing.T) { { name: "happy-case-with-lrs", cdsUpdate: xdsclient.ClusterUpdate{ServiceName: serviceName, EnableLRS: true}, - wantCCS: edsCCS(serviceName, true), + wantCCS: edsCCS(serviceName, nil, true), }, { name: "happy-case-without-lrs", cdsUpdate: xdsclient.ClusterUpdate{ServiceName: serviceName}, - wantCCS: edsCCS(serviceName, false), + wantCCS: edsCCS(serviceName, nil, false), }, } @@ -423,7 +426,7 @@ func (s) TestHandleClusterUpdateError(t *testing.T) { // returned to the CDS balancer, because we have overridden the // newEDSBalancer function as part of test setup. cdsUpdate := xdsclient.ClusterUpdate{ServiceName: serviceName} - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, nil, false) if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdate, nil}, wantCCS, edsB); err != nil { t.Fatal(err) } @@ -508,7 +511,7 @@ func (s) TestResolverError(t *testing.T) { // returned to the CDS balancer, because we have overridden the // newEDSBalancer function as part of test setup. cdsUpdate := xdsclient.ClusterUpdate{ServiceName: serviceName} - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, nil, false) if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdate, nil}, wantCCS, edsB); err != nil { t.Fatal(err) } @@ -557,7 +560,7 @@ func (s) TestUpdateSubConnState(t *testing.T) { // returned to the CDS balancer, because we have overridden the // newEDSBalancer function as part of test setup. cdsUpdate := xdsclient.ClusterUpdate{ServiceName: serviceName} - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, nil, false) ctx, ctxCancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer ctxCancel() if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdate, nil}, wantCCS, edsB); err != nil { @@ -592,7 +595,7 @@ func (s) TestCircuitBreaking(t *testing.T) { // the service's counter with the new max requests. var maxRequests uint32 = 1 cdsUpdate := xdsclient.ClusterUpdate{ServiceName: serviceName, MaxRequests: &maxRequests} - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, &maxRequests, false) ctx, ctxCancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer ctxCancel() if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdate, nil}, wantCCS, edsB); err != nil { @@ -602,10 +605,10 @@ func (s) TestCircuitBreaking(t *testing.T) { // Since the counter's max requests was set to 1, the first request should // succeed and the second should fail. counter := client.GetServiceRequestsCounter(serviceName) - if err := counter.StartRequest(); err != nil { + if err := counter.StartRequest(maxRequests); err != nil { t.Fatal(err) } - if err := counter.StartRequest(); err == nil { + if err := counter.StartRequest(maxRequests); err == nil { t.Fatal("unexpected success on start request over max") } counter.EndRequest() @@ -625,7 +628,7 @@ func (s) TestClose(t *testing.T) { // returned to the CDS balancer, because we have overridden the // newEDSBalancer function as part of test setup. cdsUpdate := xdsclient.ClusterUpdate{ServiceName: serviceName} - wantCCS := edsCCS(serviceName, false) + wantCCS := edsCCS(serviceName, nil, false) ctx, ctxCancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer ctxCancel() if err := invokeWatchCbAndWait(ctx, xdsC, cdsWatchInfo{cdsUpdate, nil}, wantCCS, edsB); err != nil { diff --git a/xds/internal/balancer/clusterimpl/balancer_test.go b/xds/internal/balancer/clusterimpl/balancer_test.go index ac2d18821f01..3e6ac0fd2900 100644 --- a/xds/internal/balancer/clusterimpl/balancer_test.go +++ b/xds/internal/balancer/clusterimpl/balancer_test.go @@ -58,9 +58,9 @@ func init() { newRandomWRR = testutils.NewTestWRR } -// TestDrop verifies that the balancer correctly drops the picks, and that -// the drops are reported. -func TestDrop(t *testing.T) { +// TestDropByCategory verifies that the balancer correctly drops the picks, and +// that the drops are reported. +func TestDropByCategory(t *testing.T) { xdsC := fakeclient.NewClient() oldNewXDSClient := newXDSClient newXDSClient = func() (xdsClientInterface, error) { return xdsC, nil } @@ -214,3 +214,113 @@ func TestDrop(t *testing.T) { t.Fatalf("got unexpected reports, diff (-got, +want): %v", diff) } } + +// TestDropCircuitBreaking verifies that the balancer correctly drops the picks +// due to circuit breaking, and that the drops are reported. +func TestDropCircuitBreaking(t *testing.T) { + xdsC := fakeclient.NewClient() + oldNewXDSClient := newXDSClient + newXDSClient = func() (xdsClientInterface, error) { return xdsC, nil } + defer func() { newXDSClient = oldNewXDSClient }() + + builder := balancer.Get(clusterImplName) + cc := testutils.NewTestClientConn(t) + b := builder.Build(cc, balancer.BuildOptions{}) + defer b.Close() + + var maxRequest uint32 = 50 + if err := b.UpdateClientConnState(balancer.ClientConnState{ + ResolverState: resolver.State{ + Addresses: testBackendAddrs, + }, + BalancerConfig: &lbConfig{ + Cluster: testClusterName, + EDSServiceName: testServiceName, + LRSLoadReportingServerName: newString(testLRSServerName), + MaxConcurrentRequests: &maxRequest, + ChildPolicy: &internalserviceconfig.BalancerConfig{ + Name: roundrobin.Name, + }, + }, + }); err != nil { + t.Fatalf("unexpected error from UpdateClientConnState: %v", err) + } + + ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) + defer cancel() + + got, err := xdsC.WaitForReportLoad(ctx) + if err != nil { + t.Fatalf("xdsClient.ReportLoad failed with error: %v", err) + } + if got.Server != testLRSServerName { + t.Fatalf("xdsClient.ReportLoad called with {%q}: want {%q}", got.Server, testLRSServerName) + } + + sc1 := <-cc.NewSubConnCh + b.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Connecting}) + // This should get the connecting picker. + p0 := <-cc.NewPickerCh + for i := 0; i < 10; i++ { + _, err := p0.Pick(balancer.PickInfo{}) + if err != balancer.ErrNoSubConnAvailable { + t.Fatalf("picker.Pick, got _,%v, want Err=%v", err, balancer.ErrNoSubConnAvailable) + } + } + + b.UpdateSubConnState(sc1, balancer.SubConnState{ConnectivityState: connectivity.Ready}) + // Test pick with one backend. + dones := []func(){} + p1 := <-cc.NewPickerCh + const rpcCount = 100 + for i := 0; i < rpcCount; i++ { + gotSCSt, err := p1.Pick(balancer.PickInfo{}) + if i < 50 && err != nil { + t.Errorf("The first 50%% picks should be non-drops, got error %v", err) + } else if i > 50 && err == nil { + t.Errorf("The second 50%% picks should be drops, got error ") + } + dones = append(dones, func() { + if gotSCSt.Done != nil { + gotSCSt.Done(balancer.DoneInfo{}) + } + }) + } + for _, done := range dones { + done() + } + + dones = []func(){} + // Pick without drops. + for i := 0; i < 50; i++ { + gotSCSt, err := p1.Pick(balancer.PickInfo{}) + if err != nil { + t.Errorf("The third 50%% picks should be non-drops, got error %v", err) + } + dones = append(dones, func() { + if gotSCSt.Done != nil { + gotSCSt.Done(balancer.DoneInfo{}) + } + }) + } + for _, done := range dones { + done() + } + + // Dump load data from the store and compare with expected counts. + loadStore := xdsC.LoadStore() + if loadStore == nil { + t.Fatal("loadStore is nil in xdsClient") + } + + wantStatsData0 := []*load.Data{{ + Cluster: testClusterName, + Service: testServiceName, + TotalDrops: uint64(maxRequest), + }} + + gotStatsData0 := loadStore.Stats([]string{testClusterName}) + if diff := cmp.Diff(gotStatsData0, wantStatsData0, cmpOpts); diff != "" { + t.Fatalf("got unexpected drop reports, diff (-got, +want): %v", diff) + } +} diff --git a/xds/internal/balancer/clusterimpl/clusterimpl.go b/xds/internal/balancer/clusterimpl/clusterimpl.go index e9201c10bdc9..4e4af5a02b45 100644 --- a/xds/internal/balancer/clusterimpl/clusterimpl.go +++ b/xds/internal/balancer/clusterimpl/clusterimpl.go @@ -38,8 +38,8 @@ import ( ) const ( - clusterImplName = "xds_cluster_impl_experimental" - // TODO: define defaultRequestCountMax = 1024 + clusterImplName = "xds_cluster_impl_experimental" + defaultRequestCountMax = 1024 ) func init() { @@ -52,11 +52,12 @@ type clusterImplBB struct{} func (clusterImplBB) Build(cc balancer.ClientConn, bOpts balancer.BuildOptions) balancer.Balancer { b := &clusterImplBalancer{ - ClientConn: cc, - bOpts: bOpts, - closed: grpcsync.NewEvent(), - loadWrapper: loadstore.NewWrapper(), - pickerUpdateCh: buffer.NewUnbounded(), + ClientConn: cc, + bOpts: bOpts, + closed: grpcsync.NewEvent(), + loadWrapper: loadstore.NewWrapper(), + pickerUpdateCh: buffer.NewUnbounded(), + requestCountMax: defaultRequestCountMax, } b.logger = prefixLogger(b) @@ -105,10 +106,11 @@ type clusterImplBalancer struct { // childState/drops/requestCounter can only be accessed in run(). And run() // is the only goroutine that sends picker to the parent ClientConn. All // requests to update picker need to be sent to pickerUpdateCh. - childState balancer.State - drops []*dropper - // TODO: add serviceRequestCount and maxRequestCount for circuit breaking. - pickerUpdateCh *buffer.Unbounded + childState balancer.State + drops []*dropper + requestCounter *xdsclient.ServiceRequestsCounter + requestCountMax uint32 + pickerUpdateCh *buffer.Unbounded } // updateLoadStore checks the config for load store, and decides whether it @@ -198,19 +200,28 @@ func (cib *clusterImplBalancer) UpdateClientConnState(s balancer.ClientConnState updatePicker = true } - // TODO: compare cluster name. And update picker if it's changed, because - // circuit breaking's stream counter will be different. - // - // Set `updatePicker` to manually update the picker. - - // TODO: compare upper bound of stream count. And update picker if it's - // changed. This is also for circuit breaking. - // - // Set `updatePicker` to manually update the picker. + // Compare cluster name. And update picker if it's changed, because circuit + // breaking's stream counter will be different. + if cib.config == nil || cib.config.Cluster != newConfig.Cluster { + cib.requestCounter = xdsclient.GetServiceRequestsCounter(newConfig.Cluster) + updatePicker = true + } + // Compare upper bound of stream count. And update picker if it's changed. + // This is also for circuit breaking. + var newRequestCountMax uint32 = 1024 + if newConfig.MaxConcurrentRequests != nil { + newRequestCountMax = *newConfig.MaxConcurrentRequests + } + if cib.requestCountMax != newRequestCountMax { + cib.requestCountMax = newRequestCountMax + updatePicker = true + } if updatePicker { cib.pickerUpdateCh.Put(&dropConfigs{ - drops: cib.drops, + drops: cib.drops, + requestCounter: cib.requestCounter, + requestCountMax: cib.requestCountMax, }) } @@ -280,7 +291,9 @@ func (cib *clusterImplBalancer) UpdateState(state balancer.State) { } type dropConfigs struct { - drops []*dropper + drops []*dropper + requestCounter *xdsclient.ServiceRequestsCounter + requestCountMax uint32 } func (cib *clusterImplBalancer) run() { @@ -293,15 +306,19 @@ func (cib *clusterImplBalancer) run() { cib.childState = u cib.ClientConn.UpdateState(balancer.State{ ConnectivityState: cib.childState.ConnectivityState, - Picker: newDropPicker(cib.childState, cib.drops, cib.loadWrapper), + Picker: newDropPicker(cib.childState, &dropConfigs{ + drops: cib.drops, + requestCounter: cib.requestCounter, + requestCountMax: cib.requestCountMax, + }, cib.loadWrapper), }) case *dropConfigs: cib.drops = u.drops - // cib.requestCounter = u.requestCounter + cib.requestCounter = u.requestCounter if cib.childState.Picker != nil { cib.ClientConn.UpdateState(balancer.State{ ConnectivityState: cib.childState.ConnectivityState, - Picker: newDropPicker(cib.childState, cib.drops, cib.loadWrapper), + Picker: newDropPicker(cib.childState, u, cib.loadWrapper), }) } } diff --git a/xds/internal/balancer/clusterimpl/picker.go b/xds/internal/balancer/clusterimpl/picker.go index 05e9f89786fd..6e9d27911534 100644 --- a/xds/internal/balancer/clusterimpl/picker.go +++ b/xds/internal/balancer/clusterimpl/picker.go @@ -24,6 +24,7 @@ import ( "google.golang.org/grpc/connectivity" "google.golang.org/grpc/internal/wrr" "google.golang.org/grpc/status" + "google.golang.org/grpc/xds/internal/client" "google.golang.org/grpc/xds/internal/client/load" ) @@ -72,14 +73,17 @@ type dropPicker struct { drops []*dropper s balancer.State loadStore loadReporter - // TODO: add serviceRequestCount and maxRequestCount for circuit breaking. + counter *client.ServiceRequestsCounter + countMax uint32 } -func newDropPicker(s balancer.State, drops []*dropper, loadStore load.PerClusterReporter) *dropPicker { +func newDropPicker(s balancer.State, config *dropConfigs, loadStore load.PerClusterReporter) *dropPicker { return &dropPicker{ - drops: drops, + drops: config.drops, s: s, loadStore: loadStore, + counter: config.requestCounter, + countMax: config.requestCountMax, } } @@ -98,7 +102,30 @@ func (d *dropPicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { return balancer.PickResult{}, status.Errorf(codes.Unavailable, "RPC is dropped") } } - // TODO: support circuit breaking, check if d.maxRequestCount >= - // d.counter.StartRequestWithMax(). + + if d.counter != nil { + if err := d.counter.StartRequest(d.countMax); err != nil { + // Drops by circuit breaking are reported with empty category. They + // will be reported only in total drops, but not in per category. + if d.loadStore != nil { + d.loadStore.CallDropped("") + } + return balancer.PickResult{}, status.Errorf(codes.Unavailable, err.Error()) + } + pr, err := d.s.Picker.Pick(info) + if err != nil { + d.counter.EndRequest() + return pr, err + } + oldDone := pr.Done + pr.Done = func(doneInfo balancer.DoneInfo) { + d.counter.EndRequest() + if oldDone != nil { + oldDone(doneInfo) + } + } + return pr, err + } + return d.s.Picker.Pick(info) } diff --git a/xds/internal/balancer/edsbalancer/config.go b/xds/internal/balancer/edsbalancer/config.go index 9b59cfa01ab3..11c1338c81f7 100644 --- a/xds/internal/balancer/edsbalancer/config.go +++ b/xds/internal/balancer/edsbalancer/config.go @@ -38,6 +38,15 @@ type EDSConfig struct { // Name to use in EDS query. If not present, defaults to the server // name from the target URI. EDSServiceName string + // MaxConcurrentRequests is the max number of concurrent request allowed for + // this service. If unset, default value 1024 is used. + // + // Note that this is not defined in the service config proto. And the reason + // is, we are dropping EDS and moving the features into cluster_impl. But in + // the mean time, to keep things working, we need to add this field. And it + // should be fine to add this extra field here, because EDS is only used in + // CDS today, so we have full control. + MaxConcurrentRequests *uint32 // LRS server to send load reports to. If not present, load reporting // will be disabled. If set to the empty string, load reporting will // be sent to the same server that we obtained CDS data from. @@ -51,6 +60,7 @@ type edsConfigJSON struct { ChildPolicy []*loadBalancingConfig FallbackPolicy []*loadBalancingConfig EDSServiceName string + MaxConcurrentRequests *uint32 LRSLoadReportingServerName *string } @@ -64,6 +74,7 @@ func (l *EDSConfig) UnmarshalJSON(data []byte) error { } l.EDSServiceName = configJSON.EDSServiceName + l.MaxConcurrentRequests = configJSON.MaxConcurrentRequests l.LrsLoadReportingServerName = configJSON.LRSLoadReportingServerName for _, lbcfg := range configJSON.ChildPolicy { diff --git a/xds/internal/balancer/edsbalancer/eds.go b/xds/internal/balancer/edsbalancer/eds.go index a6b37f6277a1..423df7aed95e 100644 --- a/xds/internal/balancer/edsbalancer/eds.go +++ b/xds/internal/balancer/edsbalancer/eds.go @@ -113,9 +113,9 @@ type edsBalancerImplInterface interface { handleSubConnStateChange(sc balancer.SubConn, state connectivity.State) // updateState handle a balancer state update from the priority. updateState(priority priorityType, s balancer.State) - // updateServiceRequestsCounter updates the service requests counter to the + // updateServiceRequestsConfig updates the service requests counter to the // one for the given service name. - updateServiceRequestsCounter(serviceName string) + updateServiceRequestsConfig(serviceName string, max *uint32) // close closes the eds balancer. close() } @@ -215,7 +215,7 @@ func (x *edsBalancer) handleGRPCUpdate(update interface{}) { x.logger.Warningf("failed to update xDS client: %v", err) } - x.edsImpl.updateServiceRequestsCounter(cfg.EDSServiceName) + x.edsImpl.updateServiceRequestsConfig(cfg.EDSServiceName, cfg.MaxConcurrentRequests) // We will update the edsImpl with the new child policy, if we got a // different one. diff --git a/xds/internal/balancer/edsbalancer/eds_impl.go b/xds/internal/balancer/edsbalancer/eds_impl.go index 499ea5243b64..8d0cc8898bcf 100644 --- a/xds/internal/balancer/edsbalancer/eds_impl.go +++ b/xds/internal/balancer/edsbalancer/eds_impl.go @@ -45,6 +45,8 @@ import ( // TODO: make this a environment variable? var defaultPriorityInitTimeout = 10 * time.Second +const defaultServiceRequestCountMax = 1024 + type localityConfig struct { weight uint32 addrs []resolver.Address @@ -101,6 +103,7 @@ type edsBalancerImpl struct { drops []*dropper innerState balancer.State // The state of the picker without drop support. serviceRequestsCounter *client.ServiceRequestsCounter + serviceRequestCountMax uint32 } // newEDSBalancerImpl create a new edsBalancerImpl. @@ -114,9 +117,10 @@ func newEDSBalancerImpl(cc balancer.ClientConn, bOpts balancer.BuildOptions, enq enqueueChildBalancerStateUpdate: enqueueState, - priorityToLocalities: make(map[priorityType]*balancerGroupWithConfig), - priorityToState: make(map[priorityType]*balancer.State), - subConnToPriority: make(map[balancer.SubConn]priorityType), + priorityToLocalities: make(map[priorityType]*balancerGroupWithConfig), + priorityToState: make(map[priorityType]*balancer.State), + subConnToPriority: make(map[balancer.SubConn]priorityType), + serviceRequestCountMax: defaultServiceRequestCountMax, } // Don't start balancer group here. Start it when handling the first EDS // response. Otherwise the balancer group will be started with round-robin, @@ -181,7 +185,7 @@ func (edsImpl *edsBalancerImpl) updateDrops(dropConfig []xdsclient.OverloadDropC // Update picker with old inner picker, new drops. edsImpl.cc.UpdateState(balancer.State{ ConnectivityState: edsImpl.innerState.ConnectivityState, - Picker: newDropPicker(edsImpl.innerState.Picker, newDrops, edsImpl.loadReporter, edsImpl.serviceRequestsCounter)}, + Picker: newDropPicker(edsImpl.innerState.Picker, newDrops, edsImpl.loadReporter, edsImpl.serviceRequestsCounter, edsImpl.serviceRequestCountMax)}, ) } edsImpl.pickerMu.Unlock() @@ -410,14 +414,17 @@ func (edsImpl *edsBalancerImpl) handleSubConnStateChange(sc balancer.SubConn, s } } -// updateConfig handles changes to the circuit breaking configuration. -func (edsImpl *edsBalancerImpl) updateServiceRequestsCounter(serviceName string) { +// updateServiceRequestsConfig handles changes to the circuit breaking configuration. +func (edsImpl *edsBalancerImpl) updateServiceRequestsConfig(serviceName string, max *uint32) { if !env.CircuitBreakingSupport { return } if edsImpl.serviceRequestsCounter == nil || edsImpl.serviceRequestsCounter.ServiceName != serviceName { edsImpl.serviceRequestsCounter = client.GetServiceRequestsCounter(serviceName) } + if max != nil { + edsImpl.serviceRequestCountMax = *max + } } // updateState first handles priority, and then wraps picker in a drop picker @@ -434,7 +441,7 @@ func (edsImpl *edsBalancerImpl) updateState(priority priorityType, s balancer.St defer edsImpl.pickerMu.Unlock() edsImpl.innerState = s // Don't reset drops when it's a state change. - edsImpl.cc.UpdateState(balancer.State{ConnectivityState: s.ConnectivityState, Picker: newDropPicker(s.Picker, edsImpl.drops, edsImpl.loadReporter, edsImpl.serviceRequestsCounter)}) + edsImpl.cc.UpdateState(balancer.State{ConnectivityState: s.ConnectivityState, Picker: newDropPicker(s.Picker, edsImpl.drops, edsImpl.loadReporter, edsImpl.serviceRequestsCounter, edsImpl.serviceRequestCountMax)}) } } @@ -487,14 +494,16 @@ type dropPicker struct { p balancer.Picker loadStore load.PerClusterReporter counter *client.ServiceRequestsCounter + countMax uint32 } -func newDropPicker(p balancer.Picker, drops []*dropper, loadStore load.PerClusterReporter, counter *client.ServiceRequestsCounter) *dropPicker { +func newDropPicker(p balancer.Picker, drops []*dropper, loadStore load.PerClusterReporter, counter *client.ServiceRequestsCounter, countMax uint32) *dropPicker { return &dropPicker{ drops: drops, p: p, loadStore: loadStore, counter: counter, + countMax: countMax, } } @@ -517,7 +526,7 @@ func (d *dropPicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { return balancer.PickResult{}, status.Errorf(codes.Unavailable, "RPC is dropped") } if d.counter != nil { - if err := d.counter.StartRequest(); err != nil { + if err := d.counter.StartRequest(d.countMax); err != nil { // Drops by circuit breaking are reported with empty category. They // will be reported only in total drops, but not in per category. if d.loadStore != nil { diff --git a/xds/internal/balancer/edsbalancer/eds_impl_test.go b/xds/internal/balancer/edsbalancer/eds_impl_test.go index 69ce6dcac1da..7f8a0d3aa82f 100644 --- a/xds/internal/balancer/edsbalancer/eds_impl_test.go +++ b/xds/internal/balancer/edsbalancer/eds_impl_test.go @@ -579,9 +579,8 @@ func (s) TestEDS_CircuitBreaking(t *testing.T) { cc := testutils.NewTestClientConn(t) edsb := newEDSBalancerImpl(cc, balancer.BuildOptions{}, nil, nil, nil) edsb.enqueueChildBalancerStateUpdate = edsb.updateState - edsb.updateServiceRequestsCounter("test") var maxRequests uint32 = 50 - client.SetMaxRequests("test", &maxRequests) + edsb.updateServiceRequestsConfig("test", &maxRequests) // One locality with one backend. clab1 := testutils.NewClusterLoadAssignmentBuilder(testClusterNames[0], nil) @@ -738,7 +737,7 @@ func (s) TestDropPicker(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - p := newDropPicker(constPicker, tt.drops, nil, nil) + p := newDropPicker(constPicker, tt.drops, nil, nil, defaultServiceRequestCountMax) // scCount is the number of sc's returned by pick. The opposite of // drop-count. @@ -786,9 +785,8 @@ func (s) TestEDS_LoadReport(t *testing.T) { cbMaxRequests = 20 ) var maxRequestsTemp uint32 = cbMaxRequests - client.SetMaxRequests(testServiceName, &maxRequestsTemp) + edsb.updateServiceRequestsConfig(testServiceName, &maxRequestsTemp) defer client.ClearCounterForTesting(testServiceName) - edsb.updateServiceRequestsCounter(testServiceName) backendToBalancerID := make(map[balancer.SubConn]internal.LocalityID) diff --git a/xds/internal/balancer/edsbalancer/eds_test.go b/xds/internal/balancer/edsbalancer/eds_test.go index ea5ec39c4568..5fe1f2ef6b90 100644 --- a/xds/internal/balancer/edsbalancer/eds_test.go +++ b/xds/internal/balancer/edsbalancer/eds_test.go @@ -116,6 +116,7 @@ type fakeEDSBalancer struct { subconnStateChange *testutils.Channel edsUpdate *testutils.Channel serviceName *testutils.Channel + serviceRequestMax *testutils.Channel } func (f *fakeEDSBalancer) handleSubConnStateChange(sc balancer.SubConn, state connectivity.State) { @@ -132,8 +133,9 @@ func (f *fakeEDSBalancer) handleEDSResponse(edsResp xdsclient.EndpointsUpdate) { func (f *fakeEDSBalancer) updateState(priority priorityType, s balancer.State) {} -func (f *fakeEDSBalancer) updateServiceRequestsCounter(serviceName string) { +func (f *fakeEDSBalancer) updateServiceRequestsConfig(serviceName string, max *uint32) { f.serviceName.Send(serviceName) + f.serviceRequestMax.Send(max) } func (f *fakeEDSBalancer) close() {} @@ -186,6 +188,25 @@ func (f *fakeEDSBalancer) waitForCounterUpdate(ctx context.Context, wantServiceN return nil } +func (f *fakeEDSBalancer) waitForCountMaxUpdate(ctx context.Context, want *uint32) error { + val, err := f.serviceRequestMax.Receive(ctx) + if err != nil { + return err + } + got := val.(*uint32) + + if got == nil && want == nil { + return nil + } + if got != nil && want != nil { + if *got != *want { + return fmt.Errorf("got countMax %v, want %v", *got, *want) + } + return nil + } + return fmt.Errorf("got countMax %+v, want %+v", got, want) +} + func newFakeEDSBalancer(cc balancer.ClientConn) edsBalancerImplInterface { return &fakeEDSBalancer{ cc: cc, @@ -193,6 +214,7 @@ func newFakeEDSBalancer(cc balancer.ClientConn) edsBalancerImplInterface { subconnStateChange: testutils.NewChannelWithSize(10), edsUpdate: testutils.NewChannelWithSize(10), serviceName: testutils.NewChannelWithSize(10), + serviceRequestMax: testutils.NewChannelWithSize(10), } } @@ -328,15 +350,20 @@ func (s) TestConfigChildPolicyUpdate(t *testing.T) { if err := edsLB.waitForCounterUpdate(ctx, testServiceName); err != nil { t.Fatal(err) } + if err := edsLB.waitForCountMaxUpdate(ctx, nil); err != nil { + t.Fatal(err) + } + var testCountMax uint32 = 100 lbCfgB := &loadBalancingConfig{ Name: fakeBalancerB, Config: json.RawMessage("{}"), } if err := edsB.UpdateClientConnState(balancer.ClientConnState{ BalancerConfig: &EDSConfig{ - ChildPolicy: lbCfgB, - EDSServiceName: testServiceName, + ChildPolicy: lbCfgB, + EDSServiceName: testServiceName, + MaxConcurrentRequests: &testCountMax, }, }); err != nil { t.Fatalf("edsB.UpdateClientConnState() failed: %v", err) @@ -349,6 +376,9 @@ func (s) TestConfigChildPolicyUpdate(t *testing.T) { // eds_impl will compare the service names, and skip if it didn't change. t.Fatal(err) } + if err := edsLB.waitForCountMaxUpdate(ctx, &testCountMax); err != nil { + t.Fatal(err) + } } // TestSubConnStateChange verifies if the top-level edsBalancer passes on @@ -606,15 +636,23 @@ func (s) TestCounterUpdate(t *testing.T) { } defer edsB.Close() + var testCountMax uint32 = 100 // Update should trigger counter update with provided service name. if err := edsB.UpdateClientConnState(balancer.ClientConnState{ - BalancerConfig: &EDSConfig{EDSServiceName: "foobar-1"}, + BalancerConfig: &EDSConfig{ + EDSServiceName: "foobar-1", + MaxConcurrentRequests: &testCountMax, + }, }); err != nil { t.Fatal(err) } ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() - if err := edsB.(*edsBalancer).edsImpl.(*fakeEDSBalancer).waitForCounterUpdate(ctx, "foobar-1"); err != nil { + edsI := edsB.(*edsBalancer).edsImpl.(*fakeEDSBalancer) + if err := edsI.waitForCounterUpdate(ctx, "foobar-1"); err != nil { + t.Fatal(err) + } + if err := edsI.waitForCountMaxUpdate(ctx, &testCountMax); err != nil { t.Fatal(err) } } @@ -642,6 +680,7 @@ func (s) TestBalancerConfigParsing(t *testing.T) { t.Fatalf("%v", err) } + var testMaxConcurrentRequests uint32 = 123 tests := []struct { name string js json.RawMessage @@ -690,6 +729,7 @@ func (s) TestBalancerConfigParsing(t *testing.T) { {"fake_balancer_A": {}} ], "edsServiceName": "eds.service", + "maxConcurrentRequests": 123, "lrsLoadReportingServerName": "lrs.server" }`), want: &EDSConfig{ @@ -702,6 +742,7 @@ func (s) TestBalancerConfigParsing(t *testing.T) { Config: json.RawMessage("{}"), }, EDSServiceName: testEDSName, + MaxConcurrentRequests: &testMaxConcurrentRequests, LrsLoadReportingServerName: &testLRSName, }, }, diff --git a/xds/internal/client/requests_counter.go b/xds/internal/client/requests_counter.go index 74b80f1c3f7c..7ef18345ed6c 100644 --- a/xds/internal/client/requests_counter.go +++ b/xds/internal/client/requests_counter.go @@ -24,8 +24,6 @@ import ( "sync/atomic" ) -const defaultMaxRequests uint32 = 1024 - type servicesRequestsCounter struct { mu sync.Mutex services map[string]*ServiceRequestsCounter @@ -39,25 +37,12 @@ var src = &servicesRequestsCounter{ // service with the provided name. type ServiceRequestsCounter struct { ServiceName string - maxRequests uint32 numRequests uint32 } // GetServiceRequestsCounter returns the ServiceRequestsCounter with the // provided serviceName. If one does not exist, it creates it. func GetServiceRequestsCounter(serviceName string) *ServiceRequestsCounter { - src.mu.Lock() - defer src.mu.Unlock() - c, ok := src.services[serviceName] - if !ok { - c = &ServiceRequestsCounter{ServiceName: serviceName, maxRequests: defaultMaxRequests} - src.services[serviceName] = c - } - return c -} - -// SetMaxRequests updates the max requests for a service's counter. -func SetMaxRequests(serviceName string, maxRequests *uint32) { src.mu.Lock() defer src.mu.Unlock() c, ok := src.services[serviceName] @@ -65,18 +50,14 @@ func SetMaxRequests(serviceName string, maxRequests *uint32) { c = &ServiceRequestsCounter{ServiceName: serviceName} src.services[serviceName] = c } - if maxRequests != nil { - c.maxRequests = *maxRequests - } else { - c.maxRequests = defaultMaxRequests - } + return c } // StartRequest starts a request for a service, incrementing its number of // requests by 1. Returns an error if the max number of requests is exceeded. -func (c *ServiceRequestsCounter) StartRequest() error { - if atomic.LoadUint32(&c.numRequests) >= atomic.LoadUint32(&c.maxRequests) { - return fmt.Errorf("max requests %v exceeded on service %v", c.maxRequests, c.ServiceName) +func (c *ServiceRequestsCounter) StartRequest(max uint32) error { + if atomic.LoadUint32(&c.numRequests) >= max { + return fmt.Errorf("max requests %v exceeded on service %v", max, c.ServiceName) } atomic.AddUint32(&c.numRequests, 1) return nil @@ -97,6 +78,5 @@ func ClearCounterForTesting(serviceName string) { if !ok { return } - c.maxRequests = defaultMaxRequests c.numRequests = 0 } diff --git a/xds/internal/client/requests_counter_test.go b/xds/internal/client/requests_counter_test.go index 09295b982ecd..fe532724d14e 100644 --- a/xds/internal/client/requests_counter_test.go +++ b/xds/internal/client/requests_counter_test.go @@ -56,7 +56,6 @@ func resetServiceRequestsCounter() { } func testCounter(t *testing.T, test counterTest) { - SetMaxRequests(test.name, &test.maxRequests) requestsStarted := make(chan struct{}) requestsSent := sync.WaitGroup{} requestsSent.Add(int(test.numRequests)) @@ -68,7 +67,7 @@ func testCounter(t *testing.T, test counterTest) { go func() { counter := GetServiceRequestsCounter(test.name) defer requestsDone.Done() - err := counter.StartRequest() + err := counter.StartRequest(test.maxRequests) if err == nil { atomic.AddUint32(&successes, 1) } else { @@ -98,7 +97,7 @@ func testCounter(t *testing.T, test counterTest) { } func (s) TestRequestsCounter(t *testing.T) { - resetServiceRequestsCounter() + defer resetServiceRequestsCounter() for _, test := range tests { t.Run(test.name, func(t *testing.T) { testCounter(t, test) @@ -107,7 +106,7 @@ func (s) TestRequestsCounter(t *testing.T) { } func (s) TestGetServiceRequestsCounter(t *testing.T) { - resetServiceRequestsCounter() + defer resetServiceRequestsCounter() for _, test := range tests { counterA := GetServiceRequestsCounter(test.name) counterB := GetServiceRequestsCounter(test.name) @@ -118,39 +117,40 @@ func (s) TestGetServiceRequestsCounter(t *testing.T) { } func startRequests(t *testing.T, n uint32, max uint32, counter *ServiceRequestsCounter) { - SetMaxRequests(counter.ServiceName, &max) for i := uint32(0); i < n; i++ { - if err := counter.StartRequest(); err != nil { + if err := counter.StartRequest(max); err != nil { t.Fatalf("error starting initial request: %v", err) } } } func (s) TestSetMaxRequestsIncreased(t *testing.T) { - resetServiceRequestsCounter() + defer resetServiceRequestsCounter() const serviceName string = "set-max-requests-increased" var initialMax uint32 = 16 + counter := GetServiceRequestsCounter(serviceName) startRequests(t, initialMax, initialMax, counter) - if err := counter.StartRequest(); err == nil { + if err := counter.StartRequest(initialMax); err == nil { t.Fatal("unexpected success on start request after max met") } + newMax := initialMax + 1 - SetMaxRequests(counter.ServiceName, &newMax) - if err := counter.StartRequest(); err != nil { + if err := counter.StartRequest(newMax); err != nil { t.Fatalf("unexpected error on start request after max increased: %v", err) } } func (s) TestSetMaxRequestsDecreased(t *testing.T) { - resetServiceRequestsCounter() + defer resetServiceRequestsCounter() const serviceName string = "set-max-requests-decreased" var initialMax uint32 = 16 + counter := GetServiceRequestsCounter(serviceName) startRequests(t, initialMax-1, initialMax, counter) + newMax := initialMax - 1 - SetMaxRequests(counter.ServiceName, &newMax) - if err := counter.StartRequest(); err == nil { + if err := counter.StartRequest(newMax); err == nil { t.Fatalf("unexpected success on start request after max decreased: %v", err) } } From 26c143bd5f59344a4b8a1e491e0f5e18aa97abc7 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 18 Feb 2021 10:12:25 -0800 Subject: [PATCH 35/37] circuit breaking: update picker inline when there's a counter update (#4212) --- xds/internal/balancer/edsbalancer/eds_impl.go | 19 +++++++- .../balancer/edsbalancer/eds_impl_test.go | 45 +++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/xds/internal/balancer/edsbalancer/eds_impl.go b/xds/internal/balancer/edsbalancer/eds_impl.go index 8d0cc8898bcf..894b9a0152bc 100644 --- a/xds/internal/balancer/edsbalancer/eds_impl.go +++ b/xds/internal/balancer/edsbalancer/eds_impl.go @@ -419,12 +419,29 @@ func (edsImpl *edsBalancerImpl) updateServiceRequestsConfig(serviceName string, if !env.CircuitBreakingSupport { return } + edsImpl.pickerMu.Lock() + var updatePicker bool if edsImpl.serviceRequestsCounter == nil || edsImpl.serviceRequestsCounter.ServiceName != serviceName { edsImpl.serviceRequestsCounter = client.GetServiceRequestsCounter(serviceName) + updatePicker = true } + + var newMax uint32 = defaultServiceRequestCountMax if max != nil { - edsImpl.serviceRequestCountMax = *max + newMax = *max + } + if edsImpl.serviceRequestCountMax != newMax { + edsImpl.serviceRequestCountMax = newMax + updatePicker = true + } + if updatePicker && edsImpl.innerState.Picker != nil { + // Update picker with old inner picker, new counter and counterMax. + edsImpl.cc.UpdateState(balancer.State{ + ConnectivityState: edsImpl.innerState.ConnectivityState, + Picker: newDropPicker(edsImpl.innerState.Picker, edsImpl.drops, edsImpl.loadReporter, edsImpl.serviceRequestsCounter, edsImpl.serviceRequestCountMax)}, + ) } + edsImpl.pickerMu.Unlock() } // updateState first handles priority, and then wraps picker in a drop picker diff --git a/xds/internal/balancer/edsbalancer/eds_impl_test.go b/xds/internal/balancer/edsbalancer/eds_impl_test.go index 7f8a0d3aa82f..3334376f4a9a 100644 --- a/xds/internal/balancer/edsbalancer/eds_impl_test.go +++ b/xds/internal/balancer/edsbalancer/eds_impl_test.go @@ -629,6 +629,51 @@ func (s) TestEDS_CircuitBreaking(t *testing.T) { for _, done := range dones { done() } + + // Send another update, with only circuit breaking update (and no picker + // update afterwards). Make sure the new picker uses the new configs. + var maxRequests2 uint32 = 10 + edsb.updateServiceRequestsConfig("test", &maxRequests2) + + // Picks with drops. + dones = []func(){} + p2 := <-cc.NewPickerCh + for i := 0; i < 100; i++ { + pr, err := p2.Pick(balancer.PickInfo{}) + if i < 10 && err != nil { + t.Errorf("The first 10%% picks should be non-drops, got error %v", err) + } else if i > 10 && err == nil { + t.Errorf("The next 90%% picks should be drops, got error ") + } + dones = append(dones, func() { + if pr.Done != nil { + pr.Done(balancer.DoneInfo{}) + } + }) + } + + for _, done := range dones { + done() + } + dones = []func(){} + + // Pick without drops. + for i := 0; i < 10; i++ { + pr, err := p2.Pick(balancer.PickInfo{}) + if err != nil { + t.Errorf("The next 10%% picks should be non-drops, got error %v", err) + } + dones = append(dones, func() { + if pr.Done != nil { + pr.Done(balancer.DoneInfo{}) + } + }) + } + + // Without this, future tests with the same service name will fail. + for _, done := range dones { + done() + } } func init() { From 25cf9393fa212572bd9376383a1d4b9675c9e940 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Mon, 22 Feb 2021 16:04:34 -0800 Subject: [PATCH 36/37] vet: allow golint to run on generated protos (#4220) --- vet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vet.sh b/vet.sh index 605d7a80cfe6..85b32bb6dd5e 100755 --- a/vet.sh +++ b/vet.sh @@ -107,7 +107,7 @@ go list -f {{.Dir}} ./... | xargs go run test/go_vet/vet.go # - gofmt, goimports, golint (with exceptions for generated code), go vet. gofmt -s -d -l . 2>&1 | fail_on_output goimports -l . 2>&1 | not grep -vE "\.pb\.go" -golint ./... 2>&1 | not grep -vE "\.pb\.go:" +golint ./... 2>&1 | not grep -vE "/testv3\.pb\.go:" go vet -all ./... misspell -error . From dabedfb38b74d175936dd0b1b256cdbc0bff09ff Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Tue, 23 Feb 2021 09:47:33 -0800 Subject: [PATCH 37/37] encoding/proto: do not panic when types do not match (#4218) --- encoding/proto/proto.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/encoding/proto/proto.go b/encoding/proto/proto.go index e1230fdd358a..3009b35afe7d 100644 --- a/encoding/proto/proto.go +++ b/encoding/proto/proto.go @@ -21,6 +21,8 @@ package proto import ( + "fmt" + "github.com/golang/protobuf/proto" "google.golang.org/grpc/encoding" ) @@ -36,11 +38,19 @@ func init() { type codec struct{} func (codec) Marshal(v interface{}) ([]byte, error) { - return proto.Marshal(v.(proto.Message)) + vv, ok := v.(proto.Message) + if !ok { + return nil, fmt.Errorf("failed to marshal, message is %T, want proto.Message", v) + } + return proto.Marshal(vv) } func (codec) Unmarshal(data []byte, v interface{}) error { - return proto.Unmarshal(data, v.(proto.Message)) + vv, ok := v.(proto.Message) + if !ok { + return fmt.Errorf("failed to unmarshal, message is %T, want proto.Message", v) + } + return proto.Unmarshal(data, vv) } func (codec) Name() string {