From 15bd0e0f75e084787f3b5367f23981686c0ac0f7 Mon Sep 17 00:00:00 2001 From: Alok Kumar Singh Date: Mon, 9 Dec 2024 22:54:51 +0530 Subject: [PATCH] Generated moc clients Signed-off-by: Alok Kumar Singh --- idl | 2 +- jaeger-ui | 2 +- .../storage/grpc/shared/grpc_client_test.go | 4 + proto-gen/api_v2/query.pb.go | 269 ++++++++++-------- .../mocks/SamplingStorePluginClient.go | 185 ++++++++++++ .../mocks/SamplingStorePluginServer.go | 154 ++++++++++ 6 files changed, 494 insertions(+), 122 deletions(-) create mode 100644 proto-gen/storage_v1/mocks/SamplingStorePluginClient.go create mode 100644 proto-gen/storage_v1/mocks/SamplingStorePluginServer.go diff --git a/idl b/idl index de97430b579..a97152c66d8 160000 --- a/idl +++ b/idl @@ -1 +1 @@ -Subproject commit de97430b579cac669422048a0becc5db981b05ad +Subproject commit a97152c66d8f1562fcdcbbb85600d5f12c8aab9e diff --git a/jaeger-ui b/jaeger-ui index a0458053c53..6dbddd02cc4 160000 --- a/jaeger-ui +++ b/jaeger-ui @@ -1 +1 @@ -Subproject commit a0458053c53bb18ba36a42867c06b0803d8fafaf +Subproject commit 6dbddd02cc4ead13d3ab412aad90d5caa0a8907a diff --git a/plugin/storage/grpc/shared/grpc_client_test.go b/plugin/storage/grpc/shared/grpc_client_test.go index 0b044aaee21..408c8edfed3 100644 --- a/plugin/storage/grpc/shared/grpc_client_test.go +++ b/plugin/storage/grpc/shared/grpc_client_test.go @@ -68,6 +68,7 @@ type grpcClientTest struct { capabilities *grpcMocks.PluginCapabilitiesClient depsReader *grpcMocks.DependenciesReaderPluginClient streamWriter *grpcMocks.StreamingSpanWriterPluginClient + samplingStore *grpcMocks.SamplingStorePluginClient } func withGRPCClient(fn func(r *grpcClientTest)) { @@ -78,6 +79,7 @@ func withGRPCClient(fn func(r *grpcClientTest)) { depReader := new(grpcMocks.DependenciesReaderPluginClient) streamWriter := new(grpcMocks.StreamingSpanWriterPluginClient) capabilities := new(grpcMocks.PluginCapabilitiesClient) + samplingStore := new(grpcMocks.SamplingStorePluginClient) r := &grpcClientTest{ client: &GRPCClient{ @@ -88,6 +90,7 @@ func withGRPCClient(fn func(r *grpcClientTest)) { capabilitiesClient: capabilities, depsReaderClient: depReader, streamWriterClient: streamWriter, + samplingStoreClient: samplingStore, }, spanReader: spanReader, spanWriter: spanWriter, @@ -96,6 +99,7 @@ func withGRPCClient(fn func(r *grpcClientTest)) { depsReader: depReader, capabilities: capabilities, streamWriter: streamWriter, + samplingStore: samplingStore, } fn(r) } diff --git a/proto-gen/api_v2/query.pb.go b/proto-gen/api_v2/query.pb.go index f9bbee7313f..c4898c6c876 100644 --- a/proto-gen/api_v2/query.pb.go +++ b/proto-gen/api_v2/query.pb.go @@ -37,12 +37,12 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GetTraceRequest struct { TraceID github_com_jaegertracing_jaeger_model.TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=github.com/jaegertracing/jaeger/model.TraceID" json:"trace_id"` // Optional. The start time to search trace ID. - StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` + StartTime *time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time,omitempty"` // Optional. The end time to search trace ID. - EndTime time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + EndTime *time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *GetTraceRequest) Reset() { *m = GetTraceRequest{} } @@ -78,18 +78,18 @@ func (m *GetTraceRequest) XXX_DiscardUnknown() { var xxx_messageInfo_GetTraceRequest proto.InternalMessageInfo -func (m *GetTraceRequest) GetStartTime() time.Time { +func (m *GetTraceRequest) GetStartTime() *time.Time { if m != nil { return m.StartTime } - return time.Time{} + return nil } -func (m *GetTraceRequest) GetEndTime() time.Time { +func (m *GetTraceRequest) GetEndTime() *time.Time { if m != nil { return m.EndTime } - return time.Time{} + return nil } type SpansResponseChunk struct { @@ -142,12 +142,12 @@ func (m *SpansResponseChunk) GetSpans() []model.Span { type ArchiveTraceRequest struct { TraceID github_com_jaegertracing_jaeger_model.TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=github.com/jaegertracing/jaeger/model.TraceID" json:"trace_id"` // Optional. The start time to search trace ID. - StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` + StartTime *time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time,omitempty"` // Optional. The end time to search trace ID. - EndTime time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + EndTime *time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ArchiveTraceRequest) Reset() { *m = ArchiveTraceRequest{} } @@ -183,18 +183,18 @@ func (m *ArchiveTraceRequest) XXX_DiscardUnknown() { var xxx_messageInfo_ArchiveTraceRequest proto.InternalMessageInfo -func (m *ArchiveTraceRequest) GetStartTime() time.Time { +func (m *ArchiveTraceRequest) GetStartTime() *time.Time { if m != nil { return m.StartTime } - return time.Time{} + return nil } -func (m *ArchiveTraceRequest) GetEndTime() time.Time { +func (m *ArchiveTraceRequest) GetEndTime() *time.Time { if m != nil { return m.EndTime } - return time.Time{} + return nil } type ArchiveTraceResponse struct { @@ -771,68 +771,69 @@ func init() { func init() { proto.RegisterFile("query.proto", fileDescriptor_5c6ac9b241082464) } var fileDescriptor_5c6ac9b241082464 = []byte{ - // 971 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0x67, 0x9d, 0x38, 0xb6, 0xdf, 0xda, 0x2d, 0x7d, 0x76, 0xda, 0x65, 0x0b, 0xb6, 0xb3, 0xa1, - 0x55, 0x84, 0x94, 0xdd, 0x62, 0x0e, 0x94, 0x0a, 0x09, 0x9a, 0xa6, 0xb5, 0x0a, 0xb4, 0xc0, 0x36, - 0x27, 0x38, 0x58, 0x13, 0xef, 0xb0, 0x5e, 0x1c, 0xcf, 0xba, 0xbb, 0xe3, 0x10, 0x0b, 0x71, 0xe1, - 0x13, 0x20, 0x71, 0xe1, 0xc4, 0x95, 0x13, 0xdf, 0xa3, 0x47, 0x24, 0x6e, 0x1c, 0x02, 0x8a, 0xf8, - 0x08, 0x1c, 0x38, 0xa2, 0xf9, 0xb3, 0x8e, 0xbd, 0x8e, 0x42, 0x1b, 0x8e, 0x9c, 0xbc, 0xf3, 0xe6, - 0xbd, 0xdf, 0xfb, 0xfb, 0x7b, 0x63, 0x30, 0x9f, 0x4e, 0x68, 0x32, 0x75, 0xc7, 0x49, 0xcc, 0x63, - 0xac, 0x7d, 0x49, 0x68, 0x48, 0x13, 0x97, 0x8c, 0xa3, 0xde, 0x61, 0xc7, 0x36, 0x47, 0x71, 0x40, - 0x0f, 0xd4, 0x9d, 0xdd, 0x08, 0xe3, 0x30, 0x96, 0x9f, 0x9e, 0xf8, 0xd2, 0xd2, 0x57, 0xc3, 0x38, - 0x0e, 0x0f, 0xa8, 0x47, 0xc6, 0x91, 0x47, 0x18, 0x8b, 0x39, 0xe1, 0x51, 0xcc, 0x52, 0x7d, 0xdb, - 0xd2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, 0x9d, 0x55, 0x01, 0xe6, 0x2b, 0x3d, 0xe7, 0x6f, 0x03, 0xea, - 0x77, 0x93, 0xfe, 0x20, 0x3a, 0xa4, 0xff, 0xb7, 0x0a, 0x5e, 0x85, 0xc6, 0x62, 0xe6, 0xaa, 0x90, - 0xce, 0x4f, 0xab, 0xd0, 0x90, 0x92, 0x4f, 0xc5, 0xd8, 0x7f, 0x42, 0x12, 0x32, 0xa2, 0x9c, 0x26, - 0x29, 0x6e, 0x40, 0x35, 0xa5, 0xc9, 0x61, 0xd4, 0xa7, 0x3d, 0x46, 0x46, 0x54, 0xd6, 0xa5, 0xe2, - 0x9b, 0x5a, 0xf6, 0x98, 0x8c, 0x28, 0xde, 0x80, 0x4b, 0xf1, 0x98, 0xaa, 0xf9, 0x54, 0x4a, 0x05, - 0xa9, 0x54, 0x9b, 0x49, 0xa5, 0xda, 0x5d, 0x58, 0xe5, 0x24, 0x4c, 0xad, 0x15, 0xd9, 0xa5, 0xed, - 0x5c, 0x97, 0xce, 0x72, 0xee, 0xee, 0x91, 0x30, 0xbd, 0xcf, 0x78, 0x32, 0xf5, 0xa5, 0x29, 0x7e, - 0x00, 0x97, 0x4e, 0x6b, 0xd8, 0x1b, 0x45, 0xcc, 0x5a, 0x7d, 0x81, 0x22, 0x54, 0x67, 0x75, 0x7c, - 0x14, 0xb1, 0x3c, 0x16, 0x39, 0xb2, 0x8a, 0x17, 0xc3, 0x22, 0x47, 0xf8, 0x00, 0xaa, 0x19, 0x41, - 0x65, 0x54, 0x6b, 0x12, 0xe9, 0x95, 0x25, 0xa4, 0x5d, 0xad, 0xa4, 0x80, 0x7e, 0x10, 0x40, 0x66, - 0x66, 0x28, 0x62, 0x5a, 0xc0, 0x21, 0x47, 0x56, 0xe9, 0x22, 0x38, 0xe4, 0x48, 0x35, 0x8d, 0x24, - 0xfd, 0x41, 0x2f, 0xa0, 0x63, 0x3e, 0xb0, 0xca, 0x6d, 0x63, 0xab, 0x28, 0x9a, 0x26, 0x64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4, 0xdd, 0xd5, 0xa5, 0xbb, 0x1a, 0x9a, 0xde, - 0x29, 0x77, 0xf0, 0x2b, 0xf9, 0xb7, 0x6a, 0x7e, 0x34, 0xf1, 0xc6, 0x32, 0xda, 0x19, 0xd4, 0xb2, - 0x6f, 0xfe, 0x9b, 0x9a, 0x76, 0xbb, 0x2e, 0xdd, 0x5e, 0xc6, 0x9a, 0x37, 0x3f, 0xaf, 0x3b, 0xdb, - 0xcf, 0x4e, 0x9a, 0xc6, 0x2f, 0x27, 0x4d, 0xe3, 0x8f, 0x93, 0xa6, 0x01, 0xd7, 0xa2, 0xd8, 0x5d, - 0xf8, 0x9b, 0xa1, 0x51, 0x3f, 0x5b, 0x53, 0xbf, 0xfb, 0x6b, 0x92, 0x69, 0x6f, 0xfd, 0x13, 0x00, - 0x00, 0xff, 0xff, 0x66, 0xd6, 0x53, 0xfb, 0xa6, 0x0a, 0x00, 0x00, + // 983 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0x4f, 0x73, 0xdb, 0x44, + 0x14, 0x47, 0x8e, 0x1d, 0xdb, 0x4f, 0x76, 0x4b, 0xd7, 0x4e, 0x2b, 0x54, 0xb0, 0x1d, 0x85, 0x76, + 0x32, 0xcc, 0x44, 0x2a, 0xe6, 0x40, 0x29, 0xcc, 0x94, 0xa6, 0x69, 0x3d, 0x05, 0x5a, 0x40, 0xcd, + 0x09, 0x0e, 0x9e, 0x8d, 0xb5, 0xc8, 0xc2, 0xf1, 0xca, 0x95, 0xd6, 0x21, 0x1e, 0x86, 0x0b, 0x9f, + 0x80, 0x19, 0x2e, 0x9c, 0xb8, 0x72, 0xe2, 0x7b, 0xf4, 0xc8, 0x0c, 0x37, 0x0e, 0x81, 0xc9, 0x70, + 0xe4, 0xc0, 0x47, 0x60, 0xf6, 0x8f, 0x14, 0x49, 0xce, 0xa4, 0x69, 0xae, 0x9c, 0xac, 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, 0xa0, 0xc6, 0x5b, 0x27, 0x8a, 0xd0, + 0x48, 0x6b, 0xf8, 0x38, 0xa0, 0x45, 0x2c, 0x7c, 0x68, 0x54, 0x2e, 0x86, 0x85, 0x0f, 0xd1, 0x43, + 0x68, 0x24, 0x84, 0x14, 0x51, 0xad, 0x0a, 0xa4, 0xd7, 0x96, 0x90, 0x76, 0x94, 0x92, 0x04, 0xfa, + 0x89, 0x03, 0xe9, 0x89, 0x21, 0x8f, 0x29, 0x87, 0x83, 0x0f, 0x8d, 0xea, 0x45, 0x70, 0xf0, 0xa1, + 0x6c, 0x1a, 0x8e, 0x46, 0xe3, 0xa1, 0x47, 0x66, 0x6c, 0x6c, 0xd4, 0x7a, 0xda, 0x66, 0x85, 0x37, + 0x8d, 0xcb, 0x76, 0xb8, 0xc8, 0x7c, 0x17, 0xea, 0x69, 0x75, 0xd1, 0xab, 0xb0, 0x32, 0x21, 0x0b, + 0xd5, 0x5b, 0xfe, 0x89, 0xda, 0x50, 0x39, 0xc0, 0xfb, 0xf3, 0xa4, 0x95, 0xf2, 0x70, 0xa7, 0x74, + 0x5b, 0xb3, 0x9e, 0xc0, 0x95, 0x87, 0x01, 0xf5, 0x44, 0xbf, 0xe2, 0x84, 0x31, 0xef, 0x41, 0x45, + 0xec, 0x47, 0x01, 0xa1, 0xf7, 0x37, 0xce, 0xd1, 0x5c, 0x57, 0x5a, 0x58, 0x6d, 0x40, 0x03, 0xc2, + 0x9e, 0xca, 0x79, 0x4a, 0x00, 0xad, 0xb7, 0xa1, 0x95, 0x93, 0xca, 0x31, 0x45, 0x26, 0xd4, 0xd4, + 0xe4, 0x49, 0x96, 0xd7, 0xdd, 0xf4, 0x6c, 0x3d, 0x86, 0xf6, 0x80, 0xb0, 0x4f, 0x93, 0x99, 0x4b, + 0x63, 0x33, 0xa0, 0xaa, 0x74, 0x54, 0x82, 0xc9, 0x11, 0x5d, 0x87, 0x3a, 0x5f, 0x04, 0xc3, 0x49, + 0x40, 0x3d, 0x95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, 0x85, 0xdb, 0x35, 0xab, 0xe5, 0x60, 0x79, + 0x9d, 0xf1, 0x8b, 0x7c, 0x80, 0x13, 0x66, 0xa2, 0x5e, 0x01, 0x6f, 0x89, 0xb4, 0xe7, 0x49, 0x13, + 0x09, 0x7f, 0x0d, 0xab, 0xea, 0xc8, 0xdd, 0x71, 0x47, 0x7b, 0xeb, 0x96, 0x86, 0x7c, 0xd0, 0x33, + 0xe4, 0x44, 0xeb, 0xcb, 0xe5, 0x2c, 0xd0, 0xd9, 0xb4, 0xce, 0x52, 0x51, 0xb9, 0x5d, 0x11, 0xbe, + 0x74, 0x54, 0x77, 0x12, 0x4a, 0xa3, 0x10, 0x9a, 0x39, 0x16, 0xa1, 0x8d, 0x65, 0x9c, 0x25, 0xc2, + 0x9b, 0x6f, 0x9e, 0xad, 0xa4, 0xdc, 0xb5, 0x84, 0xbb, 0x26, 0xd2, 0x9d, 0x13, 0xee, 0xa0, 0x6f, + 0xc4, 0xdf, 0xa8, 0xec, 0x68, 0xa2, 0x1b, 0xcb, 0x68, 0xa7, 0x50, 0xcb, 0xbc, 0xf9, 0x22, 0x35, + 0xe5, 0x76, 0x4d, 0xb8, 0xbd, 0x8c, 0x9a, 0x4e, 0x76, 0x5e, 0xb7, 0xb7, 0x9e, 0x1f, 0x77, 0xb4, + 0xdf, 0x8e, 0x3b, 0xda, 0x5f, 0xc7, 0x1d, 0x0d, 0xae, 0x05, 0xa1, 0x9d, 0xfb, 0x7b, 0xa1, 0x50, + 0xbf, 0x58, 0x95, 0xbf, 0x7b, 0xab, 0x82, 0x69, 0xef, 0xfc, 0x17, 0x00, 0x00, 0xff, 0xff, 0xe1, + 0x8b, 0x00, 0xa9, 0x96, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1174,22 +1175,26 @@ func (m *GetTraceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) - if err1 != nil { - return 0, err1 + if m.EndTime != nil { + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintQuery(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1a } - i -= n1 - i = encodeVarintQuery(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x1a - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) - if err2 != nil { - return 0, err2 + if m.StartTime != nil { + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintQuery(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x12 } - i -= n2 - i = encodeVarintQuery(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x12 { size := m.TraceID.Size() i -= size @@ -1268,22 +1273,26 @@ func (m *ArchiveTraceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) - if err3 != nil { - return 0, err3 + if m.EndTime != nil { + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintQuery(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x1a } - i -= n3 - i = encodeVarintQuery(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x1a - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) - if err4 != nil { - return 0, err4 + if m.StartTime != nil { + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintQuery(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x12 } - i -= n4 - i = encodeVarintQuery(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x12 { size := m.TraceID.Size() i -= size @@ -1758,10 +1767,14 @@ func (m *GetTraceRequest) Size() (n int) { _ = l l = m.TraceID.Size() n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) - n += 1 + l + sovQuery(uint64(l)) + if m.StartTime != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime) + n += 1 + l + sovQuery(uint64(l)) + } + if m.EndTime != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime) + n += 1 + l + sovQuery(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -1794,10 +1807,14 @@ func (m *ArchiveTraceRequest) Size() (n int) { _ = l l = m.TraceID.Size() n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) - n += 1 + l + sovQuery(uint64(l)) + if m.StartTime != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime) + n += 1 + l + sovQuery(uint64(l)) + } + if m.EndTime != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime) + n += 1 + l + sovQuery(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2096,7 +2113,10 @@ func (m *GetTraceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + if m.StartTime == nil { + m.StartTime = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.StartTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2129,7 +2149,10 @@ func (m *GetTraceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { + if m.EndTime == nil { + m.EndTime = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.EndTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2331,7 +2354,10 @@ func (m *ArchiveTraceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + if m.StartTime == nil { + m.StartTime = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.StartTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2364,7 +2390,10 @@ func (m *ArchiveTraceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { + if m.EndTime == nil { + m.EndTime = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.EndTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/proto-gen/storage_v1/mocks/SamplingStorePluginClient.go b/proto-gen/storage_v1/mocks/SamplingStorePluginClient.go new file mode 100644 index 00000000000..e5c981c53d4 --- /dev/null +++ b/proto-gen/storage_v1/mocks/SamplingStorePluginClient.go @@ -0,0 +1,185 @@ +// Copyright (c) The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 +// +// Run 'make generate-mocks' to regenerate. + +// Code generated by mockery. DO NOT EDIT. + +package mocks + +import ( + context "context" + + grpc "google.golang.org/grpc" + + mock "github.com/stretchr/testify/mock" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" +) + +// SamplingStorePluginClient is an autogenerated mock type for the SamplingStorePluginClient type +type SamplingStorePluginClient struct { + mock.Mock +} + +// GetLatestProbabilities provides a mock function with given fields: ctx, in, opts +func (_m *SamplingStorePluginClient) GetLatestProbabilities(ctx context.Context, in *storage_v1.GetLatestProbabilitiesRequest, opts ...grpc.CallOption) (*storage_v1.GetLatestProbabilitiesResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for GetLatestProbabilities") + } + + var r0 *storage_v1.GetLatestProbabilitiesResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.GetLatestProbabilitiesRequest, ...grpc.CallOption) (*storage_v1.GetLatestProbabilitiesResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.GetLatestProbabilitiesRequest, ...grpc.CallOption) *storage_v1.GetLatestProbabilitiesResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.GetLatestProbabilitiesResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.GetLatestProbabilitiesRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetThroughput provides a mock function with given fields: ctx, in, opts +func (_m *SamplingStorePluginClient) GetThroughput(ctx context.Context, in *storage_v1.GetThroughputRequest, opts ...grpc.CallOption) (*storage_v1.GetThroughputResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for GetThroughput") + } + + var r0 *storage_v1.GetThroughputResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.GetThroughputRequest, ...grpc.CallOption) (*storage_v1.GetThroughputResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.GetThroughputRequest, ...grpc.CallOption) *storage_v1.GetThroughputResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.GetThroughputResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.GetThroughputRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// InsertProbabilitiesAndQPS provides a mock function with given fields: ctx, in, opts +func (_m *SamplingStorePluginClient) InsertProbabilitiesAndQPS(ctx context.Context, in *storage_v1.InsertProbabilitiesAndQPSRequest, opts ...grpc.CallOption) (*storage_v1.InsertProbabilitiesAndQPSResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for InsertProbabilitiesAndQPS") + } + + var r0 *storage_v1.InsertProbabilitiesAndQPSResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.InsertProbabilitiesAndQPSRequest, ...grpc.CallOption) (*storage_v1.InsertProbabilitiesAndQPSResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.InsertProbabilitiesAndQPSRequest, ...grpc.CallOption) *storage_v1.InsertProbabilitiesAndQPSResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.InsertProbabilitiesAndQPSResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.InsertProbabilitiesAndQPSRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// InsertThroughput provides a mock function with given fields: ctx, in, opts +func (_m *SamplingStorePluginClient) InsertThroughput(ctx context.Context, in *storage_v1.InsertThroughputRequest, opts ...grpc.CallOption) (*storage_v1.InsertThroughputResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for InsertThroughput") + } + + var r0 *storage_v1.InsertThroughputResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.InsertThroughputRequest, ...grpc.CallOption) (*storage_v1.InsertThroughputResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.InsertThroughputRequest, ...grpc.CallOption) *storage_v1.InsertThroughputResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.InsertThroughputResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.InsertThroughputRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewSamplingStorePluginClient creates a new instance of SamplingStorePluginClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSamplingStorePluginClient(t interface { + mock.TestingT + Cleanup(func()) +}) *SamplingStorePluginClient { + mock := &SamplingStorePluginClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/proto-gen/storage_v1/mocks/SamplingStorePluginServer.go b/proto-gen/storage_v1/mocks/SamplingStorePluginServer.go new file mode 100644 index 00000000000..f14736f3415 --- /dev/null +++ b/proto-gen/storage_v1/mocks/SamplingStorePluginServer.go @@ -0,0 +1,154 @@ +// Copyright (c) The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 +// +// Run 'make generate-mocks' to regenerate. + +// Code generated by mockery. DO NOT EDIT. + +package mocks + +import ( + context "context" + + storage_v1 "github.com/jaegertracing/jaeger/proto-gen/storage_v1" + mock "github.com/stretchr/testify/mock" +) + +// SamplingStorePluginServer is an autogenerated mock type for the SamplingStorePluginServer type +type SamplingStorePluginServer struct { + mock.Mock +} + +// GetLatestProbabilities provides a mock function with given fields: _a0, _a1 +func (_m *SamplingStorePluginServer) GetLatestProbabilities(_a0 context.Context, _a1 *storage_v1.GetLatestProbabilitiesRequest) (*storage_v1.GetLatestProbabilitiesResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for GetLatestProbabilities") + } + + var r0 *storage_v1.GetLatestProbabilitiesResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.GetLatestProbabilitiesRequest) (*storage_v1.GetLatestProbabilitiesResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.GetLatestProbabilitiesRequest) *storage_v1.GetLatestProbabilitiesResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.GetLatestProbabilitiesResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.GetLatestProbabilitiesRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetThroughput provides a mock function with given fields: _a0, _a1 +func (_m *SamplingStorePluginServer) GetThroughput(_a0 context.Context, _a1 *storage_v1.GetThroughputRequest) (*storage_v1.GetThroughputResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for GetThroughput") + } + + var r0 *storage_v1.GetThroughputResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.GetThroughputRequest) (*storage_v1.GetThroughputResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.GetThroughputRequest) *storage_v1.GetThroughputResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.GetThroughputResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.GetThroughputRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// InsertProbabilitiesAndQPS provides a mock function with given fields: _a0, _a1 +func (_m *SamplingStorePluginServer) InsertProbabilitiesAndQPS(_a0 context.Context, _a1 *storage_v1.InsertProbabilitiesAndQPSRequest) (*storage_v1.InsertProbabilitiesAndQPSResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for InsertProbabilitiesAndQPS") + } + + var r0 *storage_v1.InsertProbabilitiesAndQPSResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.InsertProbabilitiesAndQPSRequest) (*storage_v1.InsertProbabilitiesAndQPSResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.InsertProbabilitiesAndQPSRequest) *storage_v1.InsertProbabilitiesAndQPSResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.InsertProbabilitiesAndQPSResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.InsertProbabilitiesAndQPSRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// InsertThroughput provides a mock function with given fields: _a0, _a1 +func (_m *SamplingStorePluginServer) InsertThroughput(_a0 context.Context, _a1 *storage_v1.InsertThroughputRequest) (*storage_v1.InsertThroughputResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for InsertThroughput") + } + + var r0 *storage_v1.InsertThroughputResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.InsertThroughputRequest) (*storage_v1.InsertThroughputResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *storage_v1.InsertThroughputRequest) *storage_v1.InsertThroughputResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*storage_v1.InsertThroughputResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *storage_v1.InsertThroughputRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewSamplingStorePluginServer creates a new instance of SamplingStorePluginServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSamplingStorePluginServer(t interface { + mock.TestingT + Cleanup(func()) +}) *SamplingStorePluginServer { + mock := &SamplingStorePluginServer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}