snapshot of https://github.com/grpc/grpc-go.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
codecov / upload (push) Failing after 13m59s
CodeQL / Analyze (push) Failing after 1s
Testing / vet-proto (push) Failing after 1s
Testing / tests (arm, latest) (push) Waiting to run
Testing / extras (latest) (push) Failing after 1s
Testing / static checks (latest-1) (push) Failing after 1s
Testing / tests (-race, latest) (push) Failing after 1s
Testing / tests (i386, latest) (push) Failing after 1s
Testing / tests (latest) (push) Failing after 1s
Testing / tests (latest-1) (push) Failing after 1s
Lock Threads / lock (push) Failing after 1s
govulncheck / govulncheck (.) (push) Failing after 1s
govulncheck / govulncheck (./cmd/protoc-gen-go-grpc) (push) Failing after 1s
govulncheck / govulncheck (./gcp/observability) (push) Failing after 1s
govulncheck / govulncheck (./security/advancedtls) (push) Failing after 1s
govulncheck / govulncheck (./stats/opencensus) (push) Failing after 1s
Stale bot / stale (push) Failing after 1s

This commit is contained in:
upstream-mirror
2026-09-15 20:40:15 +05:00
commit e241b33f26
1365 changed files with 339570 additions and 0 deletions

View File

@@ -0,0 +1,97 @@
// 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.36.12
// protoc v5.27.1
// source: grpc/testing/benchmark_service.proto
package grpc_testing
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
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)
)
var File_grpc_testing_benchmark_service_proto protoreflect.FileDescriptor
const file_grpc_testing_benchmark_service_proto_rawDesc = "" +
"\n" +
"$grpc/testing/benchmark_service.proto\x12\fgrpc.testing\x1a\x1bgrpc/testing/messages.proto2\xa6\x03\n" +
"\x10BenchmarkService\x12F\n" +
"\tUnaryCall\x12\x1b.grpc.testing.SimpleRequest\x1a\x1c.grpc.testing.SimpleResponse\x12N\n" +
"\rStreamingCall\x12\x1b.grpc.testing.SimpleRequest\x1a\x1c.grpc.testing.SimpleResponse(\x010\x01\x12R\n" +
"\x13StreamingFromClient\x12\x1b.grpc.testing.SimpleRequest\x1a\x1c.grpc.testing.SimpleResponse(\x01\x12R\n" +
"\x13StreamingFromServer\x12\x1b.grpc.testing.SimpleRequest\x1a\x1c.grpc.testing.SimpleResponse0\x01\x12R\n" +
"\x11StreamingBothWays\x12\x1b.grpc.testing.SimpleRequest\x1a\x1c.grpc.testing.SimpleResponse(\x010\x01B*\n" +
"\x0fio.grpc.testingB\x15BenchmarkServiceProtoP\x01b\x06proto3"
var file_grpc_testing_benchmark_service_proto_goTypes = []any{
(*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: unsafe.Slice(unsafe.StringData(file_grpc_testing_benchmark_service_proto_rawDesc), len(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_goTypes = nil
file_grpc_testing_benchmark_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,297 @@
// 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-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v5.27.1
// source: grpc/testing/benchmark_service.proto
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.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
BenchmarkService_UnaryCall_FullMethodName = "/grpc.testing.BenchmarkService/UnaryCall"
BenchmarkService_StreamingCall_FullMethodName = "/grpc.testing.BenchmarkService/StreamingCall"
BenchmarkService_StreamingFromClient_FullMethodName = "/grpc.testing.BenchmarkService/StreamingFromClient"
BenchmarkService_StreamingFromServer_FullMethodName = "/grpc.testing.BenchmarkService/StreamingFromServer"
BenchmarkService_StreamingBothWays_FullMethodName = "/grpc.testing.BenchmarkService/StreamingBothWays"
)
// 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) (grpc.BidiStreamingClient[SimpleRequest, SimpleResponse], 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) (grpc.ClientStreamingClient[SimpleRequest, SimpleResponse], 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) (grpc.ServerStreamingClient[SimpleResponse], 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) (grpc.BidiStreamingClient[SimpleRequest, SimpleResponse], 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) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SimpleResponse)
err := c.cc.Invoke(ctx, BenchmarkService_UnaryCall_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *benchmarkServiceClient) StreamingCall(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SimpleRequest, SimpleResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[0], BenchmarkService_StreamingCall_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[SimpleRequest, SimpleResponse]{ClientStream: stream}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type BenchmarkService_StreamingCallClient = grpc.BidiStreamingClient[SimpleRequest, SimpleResponse]
func (c *benchmarkServiceClient) StreamingFromClient(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[SimpleRequest, SimpleResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[1], BenchmarkService_StreamingFromClient_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[SimpleRequest, SimpleResponse]{ClientStream: stream}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type BenchmarkService_StreamingFromClientClient = grpc.ClientStreamingClient[SimpleRequest, SimpleResponse]
func (c *benchmarkServiceClient) StreamingFromServer(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SimpleResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[2], BenchmarkService_StreamingFromServer_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[SimpleRequest, SimpleResponse]{ClientStream: 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
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type BenchmarkService_StreamingFromServerClient = grpc.ServerStreamingClient[SimpleResponse]
func (c *benchmarkServiceClient) StreamingBothWays(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SimpleRequest, SimpleResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[3], BenchmarkService_StreamingBothWays_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[SimpleRequest, SimpleResponse]{ClientStream: stream}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type BenchmarkService_StreamingBothWaysClient = grpc.BidiStreamingClient[SimpleRequest, SimpleResponse]
// 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(grpc.BidiStreamingServer[SimpleRequest, SimpleResponse]) error
// Single-sided unbounded streaming from client to server
// The server returns the client payload as-is once the client does WritesDone
StreamingFromClient(grpc.ClientStreamingServer[SimpleRequest, SimpleResponse]) error
// Single-sided unbounded streaming from server to client
// The server repeatedly returns the client payload as-is
StreamingFromServer(*SimpleRequest, grpc.ServerStreamingServer[SimpleResponse]) error
// Two-sided unbounded streaming between server to client
// Both sides send the content of their own choice to the other
StreamingBothWays(grpc.BidiStreamingServer[SimpleRequest, SimpleResponse]) error
mustEmbedUnimplementedBenchmarkServiceServer()
}
// UnimplementedBenchmarkServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedBenchmarkServiceServer struct{}
func (UnimplementedBenchmarkServiceServer) UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) {
return nil, status.Error(codes.Unimplemented, "method UnaryCall not implemented")
}
func (UnimplementedBenchmarkServiceServer) StreamingCall(grpc.BidiStreamingServer[SimpleRequest, SimpleResponse]) error {
return status.Error(codes.Unimplemented, "method StreamingCall not implemented")
}
func (UnimplementedBenchmarkServiceServer) StreamingFromClient(grpc.ClientStreamingServer[SimpleRequest, SimpleResponse]) error {
return status.Error(codes.Unimplemented, "method StreamingFromClient not implemented")
}
func (UnimplementedBenchmarkServiceServer) StreamingFromServer(*SimpleRequest, grpc.ServerStreamingServer[SimpleResponse]) error {
return status.Error(codes.Unimplemented, "method StreamingFromServer not implemented")
}
func (UnimplementedBenchmarkServiceServer) StreamingBothWays(grpc.BidiStreamingServer[SimpleRequest, SimpleResponse]) error {
return status.Error(codes.Unimplemented, "method StreamingBothWays not implemented")
}
func (UnimplementedBenchmarkServiceServer) mustEmbedUnimplementedBenchmarkServiceServer() {}
func (UnimplementedBenchmarkServiceServer) testEmbeddedByValue() {}
// 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) {
// If the following call panics, it indicates UnimplementedBenchmarkServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
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: BenchmarkService_UnaryCall_FullMethodName,
}
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(&grpc.GenericServerStream[SimpleRequest, SimpleResponse]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type BenchmarkService_StreamingCallServer = grpc.BidiStreamingServer[SimpleRequest, SimpleResponse]
func _BenchmarkService_StreamingFromClient_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(BenchmarkServiceServer).StreamingFromClient(&grpc.GenericServerStream[SimpleRequest, SimpleResponse]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type BenchmarkService_StreamingFromClientServer = grpc.ClientStreamingServer[SimpleRequest, SimpleResponse]
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, &grpc.GenericServerStream[SimpleRequest, SimpleResponse]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type BenchmarkService_StreamingFromServerServer = grpc.ServerStreamingServer[SimpleResponse]
func _BenchmarkService_StreamingBothWays_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(BenchmarkServiceServer).StreamingBothWays(&grpc.GenericServerStream[SimpleRequest, SimpleResponse]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type BenchmarkService_StreamingBothWaysServer = grpc.BidiStreamingServer[SimpleRequest, SimpleResponse]
// 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",
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,343 @@
// 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.36.12
// protoc v5.27.1
// source: grpc/core/stats.proto
package core
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
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)
)
type Bucket struct {
state protoimpl.MessageState `protogen:"open.v1"`
Start float64 `protobuf:"fixed64,1,opt,name=start,proto3" json:"start,omitempty"`
Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Bucket) Reset() {
*x = Bucket{}
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 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 `protogen:"open.v1"`
Buckets []*Bucket `protobuf:"bytes,1,rep,name=buckets,proto3" json:"buckets,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Histogram) Reset() {
*x = Histogram{}
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 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 `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Types that are valid to be assigned to Value:
//
// *Metric_Count
// *Metric_Histogram
Value isMetric_Value `protobuf_oneof:"value"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Metric) Reset() {
*x = Metric{}
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 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 (x *Metric) GetValue() isMetric_Value {
if x != nil {
return x.Value
}
return nil
}
func (x *Metric) GetCount() uint64 {
if x != nil {
if x, ok := x.Value.(*Metric_Count); ok {
return x.Count
}
}
return 0
}
func (x *Metric) GetHistogram() *Histogram {
if x != nil {
if x, ok := x.Value.(*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 `protogen:"open.v1"`
Metrics []*Metric `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Stats) Reset() {
*x = Stats{}
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 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
const file_grpc_core_stats_proto_rawDesc = "" +
"\n" +
"\x15grpc/core/stats.proto\x12\tgrpc.core\"4\n" +
"\x06Bucket\x12\x14\n" +
"\x05start\x18\x01 \x01(\x01R\x05start\x12\x14\n" +
"\x05count\x18\x02 \x01(\x04R\x05count\"8\n" +
"\tHistogram\x12+\n" +
"\abuckets\x18\x01 \x03(\v2\x11.grpc.core.BucketR\abuckets\"s\n" +
"\x06Metric\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" +
"\x05count\x18\n" +
" \x01(\x04H\x00R\x05count\x124\n" +
"\thistogram\x18\v \x01(\v2\x14.grpc.core.HistogramH\x00R\thistogramB\a\n" +
"\x05value\"4\n" +
"\x05Stats\x12+\n" +
"\ametrics\x18\x01 \x03(\v2\x11.grpc.core.MetricR\ametricsb\x06proto3"
var (
file_grpc_core_stats_proto_rawDescOnce sync.Once
file_grpc_core_stats_proto_rawDescData []byte
)
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(unsafe.Slice(unsafe.StringData(file_grpc_core_stats_proto_rawDesc), len(file_grpc_core_stats_proto_rawDesc)))
})
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 = []any{
(*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
}
file_grpc_core_stats_proto_msgTypes[2].OneofWrappers = []any{
(*Metric_Count)(nil),
(*Metric_Histogram)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_grpc_core_stats_proto_rawDesc), len(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_goTypes = nil
file_grpc_core_stats_proto_depIdxs = nil
}

View File

@@ -0,0 +1,135 @@
// 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.36.12
// protoc v5.27.1
// source: grpc/testing/empty.proto
package grpc_testing
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
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)
)
// 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 `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Empty) Reset() {
*x = Empty{}
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 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
const file_grpc_testing_empty_proto_rawDesc = "" +
"\n" +
"\x18grpc/testing/empty.proto\x12\fgrpc.testing\"\a\n" +
"\x05EmptyB*\n" +
"\x1bio.grpc.testing.integrationB\vEmptyProtosb\x06proto3"
var (
file_grpc_testing_empty_proto_rawDescOnce sync.Once
file_grpc_testing_empty_proto_rawDescData []byte
)
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(unsafe.Slice(unsafe.StringData(file_grpc_testing_empty_proto_rawDesc), len(file_grpc_testing_empty_proto_rawDesc)))
})
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 = []any{
(*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
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_grpc_testing_empty_proto_rawDesc), len(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_goTypes = nil
file_grpc_testing_empty_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,352 @@
// 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.36.12
// protoc v5.27.1
// source: grpc/testing/payloads.proto
package grpc_testing
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
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)
)
type ByteBufferParams struct {
state protoimpl.MessageState `protogen:"open.v1"`
ReqSize int32 `protobuf:"varint,1,opt,name=req_size,json=reqSize,proto3" json:"req_size,omitempty"`
RespSize int32 `protobuf:"varint,2,opt,name=resp_size,json=respSize,proto3" json:"resp_size,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ByteBufferParams) Reset() {
*x = ByteBufferParams{}
mi := &file_grpc_testing_payloads_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ByteBufferParams) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ByteBufferParams) ProtoMessage() {}
func (x *ByteBufferParams) ProtoReflect() protoreflect.Message {
mi := &file_grpc_testing_payloads_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ByteBufferParams.ProtoReflect.Descriptor instead.
func (*ByteBufferParams) Descriptor() ([]byte, []int) {
return file_grpc_testing_payloads_proto_rawDescGZIP(), []int{0}
}
func (x *ByteBufferParams) GetReqSize() int32 {
if x != nil {
return x.ReqSize
}
return 0
}
func (x *ByteBufferParams) GetRespSize() int32 {
if x != nil {
return x.RespSize
}
return 0
}
type SimpleProtoParams struct {
state protoimpl.MessageState `protogen:"open.v1"`
ReqSize int32 `protobuf:"varint,1,opt,name=req_size,json=reqSize,proto3" json:"req_size,omitempty"`
RespSize int32 `protobuf:"varint,2,opt,name=resp_size,json=respSize,proto3" json:"resp_size,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SimpleProtoParams) Reset() {
*x = SimpleProtoParams{}
mi := &file_grpc_testing_payloads_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SimpleProtoParams) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SimpleProtoParams) ProtoMessage() {}
func (x *SimpleProtoParams) ProtoReflect() protoreflect.Message {
mi := &file_grpc_testing_payloads_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SimpleProtoParams.ProtoReflect.Descriptor instead.
func (*SimpleProtoParams) Descriptor() ([]byte, []int) {
return file_grpc_testing_payloads_proto_rawDescGZIP(), []int{1}
}
func (x *SimpleProtoParams) GetReqSize() int32 {
if x != nil {
return x.ReqSize
}
return 0
}
func (x *SimpleProtoParams) GetRespSize() int32 {
if x != nil {
return x.RespSize
}
return 0
}
type ComplexProtoParams struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ComplexProtoParams) Reset() {
*x = ComplexProtoParams{}
mi := &file_grpc_testing_payloads_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ComplexProtoParams) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ComplexProtoParams) ProtoMessage() {}
func (x *ComplexProtoParams) ProtoReflect() protoreflect.Message {
mi := &file_grpc_testing_payloads_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ComplexProtoParams.ProtoReflect.Descriptor instead.
func (*ComplexProtoParams) Descriptor() ([]byte, []int) {
return file_grpc_testing_payloads_proto_rawDescGZIP(), []int{2}
}
type PayloadConfig struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Types that are valid to be assigned to Payload:
//
// *PayloadConfig_BytebufParams
// *PayloadConfig_SimpleParams
// *PayloadConfig_ComplexParams
Payload isPayloadConfig_Payload `protobuf_oneof:"payload"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PayloadConfig) Reset() {
*x = PayloadConfig{}
mi := &file_grpc_testing_payloads_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PayloadConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PayloadConfig) ProtoMessage() {}
func (x *PayloadConfig) ProtoReflect() protoreflect.Message {
mi := &file_grpc_testing_payloads_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PayloadConfig.ProtoReflect.Descriptor instead.
func (*PayloadConfig) Descriptor() ([]byte, []int) {
return file_grpc_testing_payloads_proto_rawDescGZIP(), []int{3}
}
func (x *PayloadConfig) GetPayload() isPayloadConfig_Payload {
if x != nil {
return x.Payload
}
return nil
}
func (x *PayloadConfig) GetBytebufParams() *ByteBufferParams {
if x != nil {
if x, ok := x.Payload.(*PayloadConfig_BytebufParams); ok {
return x.BytebufParams
}
}
return nil
}
func (x *PayloadConfig) GetSimpleParams() *SimpleProtoParams {
if x != nil {
if x, ok := x.Payload.(*PayloadConfig_SimpleParams); ok {
return x.SimpleParams
}
}
return nil
}
func (x *PayloadConfig) GetComplexParams() *ComplexProtoParams {
if x != nil {
if x, ok := x.Payload.(*PayloadConfig_ComplexParams); ok {
return x.ComplexParams
}
}
return nil
}
type isPayloadConfig_Payload interface {
isPayloadConfig_Payload()
}
type PayloadConfig_BytebufParams struct {
BytebufParams *ByteBufferParams `protobuf:"bytes,1,opt,name=bytebuf_params,json=bytebufParams,proto3,oneof"`
}
type PayloadConfig_SimpleParams struct {
SimpleParams *SimpleProtoParams `protobuf:"bytes,2,opt,name=simple_params,json=simpleParams,proto3,oneof"`
}
type PayloadConfig_ComplexParams struct {
ComplexParams *ComplexProtoParams `protobuf:"bytes,3,opt,name=complex_params,json=complexParams,proto3,oneof"`
}
func (*PayloadConfig_BytebufParams) isPayloadConfig_Payload() {}
func (*PayloadConfig_SimpleParams) isPayloadConfig_Payload() {}
func (*PayloadConfig_ComplexParams) isPayloadConfig_Payload() {}
var File_grpc_testing_payloads_proto protoreflect.FileDescriptor
const file_grpc_testing_payloads_proto_rawDesc = "" +
"\n" +
"\x1bgrpc/testing/payloads.proto\x12\fgrpc.testing\"J\n" +
"\x10ByteBufferParams\x12\x19\n" +
"\breq_size\x18\x01 \x01(\x05R\areqSize\x12\x1b\n" +
"\tresp_size\x18\x02 \x01(\x05R\brespSize\"K\n" +
"\x11SimpleProtoParams\x12\x19\n" +
"\breq_size\x18\x01 \x01(\x05R\areqSize\x12\x1b\n" +
"\tresp_size\x18\x02 \x01(\x05R\brespSize\"\x14\n" +
"\x12ComplexProtoParams\"\xf6\x01\n" +
"\rPayloadConfig\x12G\n" +
"\x0ebytebuf_params\x18\x01 \x01(\v2\x1e.grpc.testing.ByteBufferParamsH\x00R\rbytebufParams\x12F\n" +
"\rsimple_params\x18\x02 \x01(\v2\x1f.grpc.testing.SimpleProtoParamsH\x00R\fsimpleParams\x12I\n" +
"\x0ecomplex_params\x18\x03 \x01(\v2 .grpc.testing.ComplexProtoParamsH\x00R\rcomplexParamsB\t\n" +
"\apayloadB\"\n" +
"\x0fio.grpc.testingB\rPayloadsProtoP\x01b\x06proto3"
var (
file_grpc_testing_payloads_proto_rawDescOnce sync.Once
file_grpc_testing_payloads_proto_rawDescData []byte
)
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(unsafe.Slice(unsafe.StringData(file_grpc_testing_payloads_proto_rawDesc), len(file_grpc_testing_payloads_proto_rawDesc)))
})
return file_grpc_testing_payloads_proto_rawDescData
}
var file_grpc_testing_payloads_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_grpc_testing_payloads_proto_goTypes = []any{
(*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_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
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_testing_payloads_proto_init() }
func file_grpc_testing_payloads_proto_init() {
if File_grpc_testing_payloads_proto != nil {
return
}
file_grpc_testing_payloads_proto_msgTypes[3].OneofWrappers = []any{
(*PayloadConfig_BytebufParams)(nil),
(*PayloadConfig_SimpleParams)(nil),
(*PayloadConfig_ComplexParams)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_grpc_testing_payloads_proto_rawDesc), len(file_grpc_testing_payloads_proto_rawDesc)),
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_grpc_testing_payloads_proto_goTypes,
DependencyIndexes: file_grpc_testing_payloads_proto_depIdxs,
MessageInfos: file_grpc_testing_payloads_proto_msgTypes,
}.Build()
File_grpc_testing_payloads_proto = out.File
file_grpc_testing_payloads_proto_goTypes = nil
file_grpc_testing_payloads_proto_depIdxs = nil
}

View File

@@ -0,0 +1,85 @@
// 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.36.12
// protoc v5.27.1
// source: grpc/testing/report_qps_scenario_service.proto
package grpc_testing
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
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)
)
var File_grpc_testing_report_qps_scenario_service_proto protoreflect.FileDescriptor
const file_grpc_testing_report_qps_scenario_service_proto_rawDesc = "" +
"\n" +
".grpc/testing/report_qps_scenario_service.proto\x12\fgrpc.testing\x1a\x1agrpc/testing/control.proto2^\n" +
"\x18ReportQpsScenarioService\x12B\n" +
"\x0eReportScenario\x12\x1c.grpc.testing.ScenarioResult\x1a\x12.grpc.testing.VoidB2\n" +
"\x0fio.grpc.testingB\x1dReportQpsScenarioServiceProtoP\x01b\x06proto3"
var file_grpc_testing_report_qps_scenario_service_proto_goTypes = []any{
(*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: unsafe.Slice(unsafe.StringData(file_grpc_testing_report_qps_scenario_service_proto_rawDesc), len(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_goTypes = nil
file_grpc_testing_report_qps_scenario_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,141 @@
// 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-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v5.27.1
// source: grpc/testing/report_qps_scenario_service.proto
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.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ReportQpsScenarioService_ReportScenario_FullMethodName = "/grpc.testing.ReportQpsScenarioService/ReportScenario"
)
// 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) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Void)
err := c.cc.Invoke(ctx, ReportQpsScenarioService_ReportScenario_FullMethodName, in, out, cOpts...)
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.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedReportQpsScenarioServiceServer struct{}
func (UnimplementedReportQpsScenarioServiceServer) ReportScenario(context.Context, *ScenarioResult) (*Void, error) {
return nil, status.Error(codes.Unimplemented, "method ReportScenario not implemented")
}
func (UnimplementedReportQpsScenarioServiceServer) mustEmbedUnimplementedReportQpsScenarioServiceServer() {
}
func (UnimplementedReportQpsScenarioServiceServer) testEmbeddedByValue() {}
// 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) {
// If the following call panics, it indicates UnimplementedReportQpsScenarioServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
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: ReportQpsScenarioService_ReportScenario_FullMethodName,
}
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",
}

View File

@@ -0,0 +1,525 @@
// 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.36.12
// protoc v5.27.1
// source: grpc/testing/stats.proto
package grpc_testing
import (
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"
unsafe "unsafe"
)
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)
)
type ServerStats struct {
state protoimpl.MessageState `protogen:"open.v1"`
// 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"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ServerStats) Reset() {
*x = ServerStats{}
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 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 `protogen:"open.v1"`
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
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *HistogramParams) Reset() {
*x = HistogramParams{}
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 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 `protogen:"open.v1"`
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"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *HistogramData) Reset() {
*x = HistogramData{}
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 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 `protogen:"open.v1"`
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"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RequestResultCount) Reset() {
*x = RequestResultCount{}
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 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 `protogen:"open.v1"`
// 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"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ClientStats) Reset() {
*x = ClientStats{}
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 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
const file_grpc_testing_stats_proto_rawDesc = "" +
"\n" +
"\x18grpc/testing/stats.proto\x12\fgrpc.testing\x1a\x15grpc/core/stats.proto\"\x8d\x02\n" +
"\vServerStats\x12!\n" +
"\ftime_elapsed\x18\x01 \x01(\x01R\vtimeElapsed\x12\x1b\n" +
"\ttime_user\x18\x02 \x01(\x01R\btimeUser\x12\x1f\n" +
"\vtime_system\x18\x03 \x01(\x01R\n" +
"timeSystem\x12$\n" +
"\x0etotal_cpu_time\x18\x04 \x01(\x04R\ftotalCpuTime\x12\"\n" +
"\ridle_cpu_time\x18\x05 \x01(\x04R\vidleCpuTime\x12\"\n" +
"\rcq_poll_count\x18\x06 \x01(\x04R\vcqPollCount\x12/\n" +
"\n" +
"core_stats\x18\a \x01(\v2\x10.grpc.core.StatsR\tcoreStats\"T\n" +
"\x0fHistogramParams\x12\x1e\n" +
"\n" +
"resolution\x18\x01 \x01(\x01R\n" +
"resolution\x12!\n" +
"\fmax_possible\x18\x02 \x01(\x01R\vmaxPossible\"\xab\x01\n" +
"\rHistogramData\x12\x16\n" +
"\x06bucket\x18\x01 \x03(\rR\x06bucket\x12\x19\n" +
"\bmin_seen\x18\x02 \x01(\x01R\aminSeen\x12\x19\n" +
"\bmax_seen\x18\x03 \x01(\x01R\amaxSeen\x12\x10\n" +
"\x03sum\x18\x04 \x01(\x01R\x03sum\x12$\n" +
"\x0esum_of_squares\x18\x05 \x01(\x01R\fsumOfSquares\x12\x14\n" +
"\x05count\x18\x06 \x01(\x01R\x05count\"K\n" +
"\x12RequestResultCount\x12\x1f\n" +
"\vstatus_code\x18\x01 \x01(\x05R\n" +
"statusCode\x12\x14\n" +
"\x05count\x18\x02 \x01(\x03R\x05count\"\xc9\x02\n" +
"\vClientStats\x129\n" +
"\tlatencies\x18\x01 \x01(\v2\x1b.grpc.testing.HistogramDataR\tlatencies\x12!\n" +
"\ftime_elapsed\x18\x02 \x01(\x01R\vtimeElapsed\x12\x1b\n" +
"\ttime_user\x18\x03 \x01(\x01R\btimeUser\x12\x1f\n" +
"\vtime_system\x18\x04 \x01(\x01R\n" +
"timeSystem\x12I\n" +
"\x0frequest_results\x18\x05 \x03(\v2 .grpc.testing.RequestResultCountR\x0erequestResults\x12\"\n" +
"\rcq_poll_count\x18\x06 \x01(\x04R\vcqPollCount\x12/\n" +
"\n" +
"core_stats\x18\a \x01(\v2\x10.grpc.core.StatsR\tcoreStatsB\x1f\n" +
"\x0fio.grpc.testingB\n" +
"StatsProtoP\x01b\x06proto3"
var (
file_grpc_testing_stats_proto_rawDescOnce sync.Once
file_grpc_testing_stats_proto_rawDescData []byte
)
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(unsafe.Slice(unsafe.StringData(file_grpc_testing_stats_proto_rawDesc), len(file_grpc_testing_stats_proto_rawDesc)))
})
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 = []any{
(*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
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_grpc_testing_stats_proto_rawDesc), len(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_goTypes = nil
file_grpc_testing_stats_proto_depIdxs = nil
}

View File

@@ -0,0 +1,166 @@
// 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.
// 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.36.12
// protoc v5.27.1
// source: grpc/testing/test.proto
package grpc_testing
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
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)
)
var File_grpc_testing_test_proto protoreflect.FileDescriptor
const file_grpc_testing_test_proto_rawDesc = "" +
"\n" +
"\x17grpc/testing/test.proto\x12\fgrpc.testing\x1a\x18grpc/testing/empty.proto\x1a\x1bgrpc/testing/messages.proto2\xcb\x05\n" +
"\vTestService\x125\n" +
"\tEmptyCall\x12\x13.grpc.testing.Empty\x1a\x13.grpc.testing.Empty\x12F\n" +
"\tUnaryCall\x12\x1b.grpc.testing.SimpleRequest\x1a\x1c.grpc.testing.SimpleResponse\x12O\n" +
"\x12CacheableUnaryCall\x12\x1b.grpc.testing.SimpleRequest\x1a\x1c.grpc.testing.SimpleResponse\x12l\n" +
"\x13StreamingOutputCall\x12(.grpc.testing.StreamingOutputCallRequest\x1a).grpc.testing.StreamingOutputCallResponse0\x01\x12i\n" +
"\x12StreamingInputCall\x12'.grpc.testing.StreamingInputCallRequest\x1a(.grpc.testing.StreamingInputCallResponse(\x01\x12i\n" +
"\x0eFullDuplexCall\x12(.grpc.testing.StreamingOutputCallRequest\x1a).grpc.testing.StreamingOutputCallResponse(\x010\x01\x12i\n" +
"\x0eHalfDuplexCall\x12(.grpc.testing.StreamingOutputCallRequest\x1a).grpc.testing.StreamingOutputCallResponse(\x010\x01\x12=\n" +
"\x11UnimplementedCall\x12\x13.grpc.testing.Empty\x1a\x13.grpc.testing.Empty2U\n" +
"\x14UnimplementedService\x12=\n" +
"\x11UnimplementedCall\x12\x13.grpc.testing.Empty\x1a\x13.grpc.testing.Empty2\x89\x01\n" +
"\x10ReconnectService\x12;\n" +
"\x05Start\x12\x1d.grpc.testing.ReconnectParams\x1a\x13.grpc.testing.Empty\x128\n" +
"\x04Stop\x12\x13.grpc.testing.Empty\x1a\x1b.grpc.testing.ReconnectInfo2\x86\x02\n" +
"\x18LoadBalancerStatsService\x12c\n" +
"\x0eGetClientStats\x12&.grpc.testing.LoadBalancerStatsRequest\x1a'.grpc.testing.LoadBalancerStatsResponse\"\x00\x12\x84\x01\n" +
"\x19GetClientAccumulatedStats\x121.grpc.testing.LoadBalancerAccumulatedStatsRequest\x1a2.grpc.testing.LoadBalancerAccumulatedStatsResponse\"\x002\xcc\x01\n" +
"\vHookService\x120\n" +
"\x04Hook\x12\x13.grpc.testing.Empty\x1a\x13.grpc.testing.Empty\x12L\n" +
"\x0fSetReturnStatus\x12$.grpc.testing.SetReturnStatusRequest\x1a\x13.grpc.testing.Empty\x12=\n" +
"\x11ClearReturnStatus\x12\x13.grpc.testing.Empty\x1a\x13.grpc.testing.Empty2\xd5\x01\n" +
"\x16XdsUpdateHealthService\x126\n" +
"\n" +
"SetServing\x12\x13.grpc.testing.Empty\x1a\x13.grpc.testing.Empty\x129\n" +
"\rSetNotServing\x12\x13.grpc.testing.Empty\x1a\x13.grpc.testing.Empty\x12H\n" +
"\x0fSendHookRequest\x12\x19.grpc.testing.HookRequest\x1a\x1a.grpc.testing.HookResponse2{\n" +
"\x1fXdsUpdateClientConfigureService\x12X\n" +
"\tConfigure\x12$.grpc.testing.ClientConfigureRequest\x1a%.grpc.testing.ClientConfigureResponseB\x1d\n" +
"\x1bio.grpc.testing.integrationb\x06proto3"
var file_grpc_testing_test_proto_goTypes = []any{
(*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
(*SetReturnStatusRequest)(nil), // 7: grpc.testing.SetReturnStatusRequest
(*HookRequest)(nil), // 8: grpc.testing.HookRequest
(*ClientConfigureRequest)(nil), // 9: grpc.testing.ClientConfigureRequest
(*SimpleResponse)(nil), // 10: grpc.testing.SimpleResponse
(*StreamingOutputCallResponse)(nil), // 11: grpc.testing.StreamingOutputCallResponse
(*StreamingInputCallResponse)(nil), // 12: grpc.testing.StreamingInputCallResponse
(*ReconnectInfo)(nil), // 13: grpc.testing.ReconnectInfo
(*LoadBalancerStatsResponse)(nil), // 14: grpc.testing.LoadBalancerStatsResponse
(*LoadBalancerAccumulatedStatsResponse)(nil), // 15: grpc.testing.LoadBalancerAccumulatedStatsResponse
(*HookResponse)(nil), // 16: grpc.testing.HookResponse
(*ClientConfigureResponse)(nil), // 17: 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.HookService.Hook:input_type -> grpc.testing.Empty
7, // 14: grpc.testing.HookService.SetReturnStatus:input_type -> grpc.testing.SetReturnStatusRequest
0, // 15: grpc.testing.HookService.ClearReturnStatus:input_type -> grpc.testing.Empty
0, // 16: grpc.testing.XdsUpdateHealthService.SetServing:input_type -> grpc.testing.Empty
0, // 17: grpc.testing.XdsUpdateHealthService.SetNotServing:input_type -> grpc.testing.Empty
8, // 18: grpc.testing.XdsUpdateHealthService.SendHookRequest:input_type -> grpc.testing.HookRequest
9, // 19: grpc.testing.XdsUpdateClientConfigureService.Configure:input_type -> grpc.testing.ClientConfigureRequest
0, // 20: grpc.testing.TestService.EmptyCall:output_type -> grpc.testing.Empty
10, // 21: grpc.testing.TestService.UnaryCall:output_type -> grpc.testing.SimpleResponse
10, // 22: grpc.testing.TestService.CacheableUnaryCall:output_type -> grpc.testing.SimpleResponse
11, // 23: grpc.testing.TestService.StreamingOutputCall:output_type -> grpc.testing.StreamingOutputCallResponse
12, // 24: grpc.testing.TestService.StreamingInputCall:output_type -> grpc.testing.StreamingInputCallResponse
11, // 25: grpc.testing.TestService.FullDuplexCall:output_type -> grpc.testing.StreamingOutputCallResponse
11, // 26: grpc.testing.TestService.HalfDuplexCall:output_type -> grpc.testing.StreamingOutputCallResponse
0, // 27: grpc.testing.TestService.UnimplementedCall:output_type -> grpc.testing.Empty
0, // 28: grpc.testing.UnimplementedService.UnimplementedCall:output_type -> grpc.testing.Empty
0, // 29: grpc.testing.ReconnectService.Start:output_type -> grpc.testing.Empty
13, // 30: grpc.testing.ReconnectService.Stop:output_type -> grpc.testing.ReconnectInfo
14, // 31: grpc.testing.LoadBalancerStatsService.GetClientStats:output_type -> grpc.testing.LoadBalancerStatsResponse
15, // 32: grpc.testing.LoadBalancerStatsService.GetClientAccumulatedStats:output_type -> grpc.testing.LoadBalancerAccumulatedStatsResponse
0, // 33: grpc.testing.HookService.Hook:output_type -> grpc.testing.Empty
0, // 34: grpc.testing.HookService.SetReturnStatus:output_type -> grpc.testing.Empty
0, // 35: grpc.testing.HookService.ClearReturnStatus:output_type -> grpc.testing.Empty
0, // 36: grpc.testing.XdsUpdateHealthService.SetServing:output_type -> grpc.testing.Empty
0, // 37: grpc.testing.XdsUpdateHealthService.SetNotServing:output_type -> grpc.testing.Empty
16, // 38: grpc.testing.XdsUpdateHealthService.SendHookRequest:output_type -> grpc.testing.HookResponse
17, // 39: grpc.testing.XdsUpdateClientConfigureService.Configure:output_type -> grpc.testing.ClientConfigureResponse
20, // [20:40] is the sub-list for method output_type
0, // [0:20] 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
}
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: unsafe.Slice(unsafe.StringData(file_grpc_testing_test_proto_rawDesc), len(file_grpc_testing_test_proto_rawDesc)),
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 7,
},
GoTypes: file_grpc_testing_test_proto_goTypes,
DependencyIndexes: file_grpc_testing_test_proto_depIdxs,
}.Build()
File_grpc_testing_test_proto = out.File
file_grpc_testing_test_proto_goTypes = nil
file_grpc_testing_test_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,100 @@
// 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.36.12
// protoc v5.27.1
// source: grpc/testing/worker_service.proto
package grpc_testing
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
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)
)
var File_grpc_testing_worker_service_proto protoreflect.FileDescriptor
const file_grpc_testing_worker_service_proto_rawDesc = "" +
"\n" +
"!grpc/testing/worker_service.proto\x12\fgrpc.testing\x1a\x1agrpc/testing/control.proto2\x97\x02\n" +
"\rWorkerService\x12E\n" +
"\tRunServer\x12\x18.grpc.testing.ServerArgs\x1a\x1a.grpc.testing.ServerStatus(\x010\x01\x12E\n" +
"\tRunClient\x12\x18.grpc.testing.ClientArgs\x1a\x1a.grpc.testing.ClientStatus(\x010\x01\x12B\n" +
"\tCoreCount\x12\x19.grpc.testing.CoreRequest\x1a\x1a.grpc.testing.CoreResponse\x124\n" +
"\n" +
"QuitWorker\x12\x12.grpc.testing.Void\x1a\x12.grpc.testing.VoidB'\n" +
"\x0fio.grpc.testingB\x12WorkerServiceProtoP\x01b\x06proto3"
var file_grpc_testing_worker_service_proto_goTypes = []any{
(*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: unsafe.Slice(unsafe.StringData(file_grpc_testing_worker_service_proto_rawDesc), len(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_goTypes = nil
file_grpc_testing_worker_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,269 @@
// 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-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v5.27.1
// source: grpc/testing/worker_service.proto
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.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
WorkerService_RunServer_FullMethodName = "/grpc.testing.WorkerService/RunServer"
WorkerService_RunClient_FullMethodName = "/grpc.testing.WorkerService/RunClient"
WorkerService_CoreCount_FullMethodName = "/grpc.testing.WorkerService/CoreCount"
WorkerService_QuitWorker_FullMethodName = "/grpc.testing.WorkerService/QuitWorker"
)
// 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.
type WorkerServiceClient interface {
// 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.
RunServer(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ServerArgs, ServerStatus], error)
// 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.
RunClient(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ClientArgs, ClientStatus], error)
// Just return the core count - unary call
CoreCount(ctx context.Context, in *CoreRequest, opts ...grpc.CallOption) (*CoreResponse, error)
// Quit this worker
QuitWorker(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Void, error)
}
type workerServiceClient struct {
cc grpc.ClientConnInterface
}
func NewWorkerServiceClient(cc grpc.ClientConnInterface) WorkerServiceClient {
return &workerServiceClient{cc}
}
func (c *workerServiceClient) RunServer(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ServerArgs, ServerStatus], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &WorkerService_ServiceDesc.Streams[0], WorkerService_RunServer_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[ServerArgs, ServerStatus]{ClientStream: stream}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WorkerService_RunServerClient = grpc.BidiStreamingClient[ServerArgs, ServerStatus]
func (c *workerServiceClient) RunClient(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ClientArgs, ClientStatus], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &WorkerService_ServiceDesc.Streams[1], WorkerService_RunClient_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[ClientArgs, ClientStatus]{ClientStream: stream}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WorkerService_RunClientClient = grpc.BidiStreamingClient[ClientArgs, ClientStatus]
func (c *workerServiceClient) CoreCount(ctx context.Context, in *CoreRequest, opts ...grpc.CallOption) (*CoreResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CoreResponse)
err := c.cc.Invoke(ctx, WorkerService_CoreCount_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workerServiceClient) QuitWorker(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Void, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Void)
err := c.cc.Invoke(ctx, WorkerService_QuitWorker_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// WorkerServiceServer is the server API for WorkerService service.
// All implementations must embed UnimplementedWorkerServiceServer
// for forward compatibility.
type WorkerServiceServer interface {
// 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.
RunServer(grpc.BidiStreamingServer[ServerArgs, ServerStatus]) error
// 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.
RunClient(grpc.BidiStreamingServer[ClientArgs, ClientStatus]) error
// Just return the core count - unary call
CoreCount(context.Context, *CoreRequest) (*CoreResponse, error)
// Quit this worker
QuitWorker(context.Context, *Void) (*Void, error)
mustEmbedUnimplementedWorkerServiceServer()
}
// UnimplementedWorkerServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedWorkerServiceServer struct{}
func (UnimplementedWorkerServiceServer) RunServer(grpc.BidiStreamingServer[ServerArgs, ServerStatus]) error {
return status.Error(codes.Unimplemented, "method RunServer not implemented")
}
func (UnimplementedWorkerServiceServer) RunClient(grpc.BidiStreamingServer[ClientArgs, ClientStatus]) error {
return status.Error(codes.Unimplemented, "method RunClient not implemented")
}
func (UnimplementedWorkerServiceServer) CoreCount(context.Context, *CoreRequest) (*CoreResponse, error) {
return nil, status.Error(codes.Unimplemented, "method CoreCount not implemented")
}
func (UnimplementedWorkerServiceServer) QuitWorker(context.Context, *Void) (*Void, error) {
return nil, status.Error(codes.Unimplemented, "method QuitWorker not implemented")
}
func (UnimplementedWorkerServiceServer) mustEmbedUnimplementedWorkerServiceServer() {}
func (UnimplementedWorkerServiceServer) testEmbeddedByValue() {}
// UnsafeWorkerServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WorkerServiceServer will
// result in compilation errors.
type UnsafeWorkerServiceServer interface {
mustEmbedUnimplementedWorkerServiceServer()
}
func RegisterWorkerServiceServer(s grpc.ServiceRegistrar, srv WorkerServiceServer) {
// If the following call panics, it indicates UnimplementedWorkerServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&WorkerService_ServiceDesc, srv)
}
func _WorkerService_RunServer_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(WorkerServiceServer).RunServer(&grpc.GenericServerStream[ServerArgs, ServerStatus]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WorkerService_RunServerServer = grpc.BidiStreamingServer[ServerArgs, ServerStatus]
func _WorkerService_RunClient_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(WorkerServiceServer).RunClient(&grpc.GenericServerStream[ClientArgs, ClientStatus]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WorkerService_RunClientServer = grpc.BidiStreamingServer[ClientArgs, ClientStatus]
func _WorkerService_CoreCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CoreRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).CoreCount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkerService_CoreCount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).CoreCount(ctx, req.(*CoreRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkerService_QuitWorker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Void)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).QuitWorker(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkerService_QuitWorker_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).QuitWorker(ctx, req.(*Void))
}
return interceptor(ctx, in, info, handler)
}
// WorkerService_ServiceDesc is the grpc.ServiceDesc for WorkerService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WorkerService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "grpc.testing.WorkerService",
HandlerType: (*WorkerServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CoreCount",
Handler: _WorkerService_CoreCount_Handler,
},
{
MethodName: "QuitWorker",
Handler: _WorkerService_QuitWorker_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "RunServer",
Handler: _WorkerService_RunServer_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "RunClient",
Handler: _WorkerService_RunClient_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "grpc/testing/worker_service.proto",
}