diff --git a/generated-py/profilerrpc/profilerrpc_pb2.py b/generated-py/profilerrpc/profilerrpc_pb2.py new file mode 100644 index 0000000..fd264b7 --- /dev/null +++ b/generated-py/profilerrpc/profilerrpc_pb2.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: profilerrpc/profilerrpc.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dprofilerrpc/profilerrpc.proto\x12\x0bprofilerrpc\"M\n\x11ProfilerOPRequest\x12#\n\nrequest_op\x18\x01 \x01(\x0e\x32\x0f.profilerrpc.Op\x12\x13\n\x0bport_number\x18\x02 \x01(\x05\"+\n\x12ProfilerOPResponse\x12\x15\n\rprofiler_addr\x18\x01 \x01(\t*\'\n\x02Op\x12\x08\n\x04SHOW\x10\x00\x12\n\n\x06\x45NABLE\x10\x01\x12\x0b\n\x07\x44ISABLE\x10\x02\x32[\n\x08Profiler\x12O\n\nProfilerOP\x12\x1e.profilerrpc.ProfilerOPRequest\x1a\x1f.profilerrpc.ProfilerOPResponse\"\x00\x42\x31Z/github.com/longhorn/types/generated/profilerrpcb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'profilerrpc.profilerrpc_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z/github.com/longhorn/types/generated/profilerrpc' + _globals['_OP']._serialized_start=170 + _globals['_OP']._serialized_end=209 + _globals['_PROFILEROPREQUEST']._serialized_start=46 + _globals['_PROFILEROPREQUEST']._serialized_end=123 + _globals['_PROFILEROPRESPONSE']._serialized_start=125 + _globals['_PROFILEROPRESPONSE']._serialized_end=168 + _globals['_PROFILER']._serialized_start=211 + _globals['_PROFILER']._serialized_end=302 +# @@protoc_insertion_point(module_scope) diff --git a/generated-py/profilerrpc/profilerrpc_pb2_grpc.py b/generated-py/profilerrpc/profilerrpc_pb2_grpc.py new file mode 100644 index 0000000..86054ca --- /dev/null +++ b/generated-py/profilerrpc/profilerrpc_pb2_grpc.py @@ -0,0 +1,66 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from profilerrpc import profilerrpc_pb2 as profilerrpc_dot_profilerrpc__pb2 + + +class ProfilerStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ProfilerOP = channel.unary_unary( + '/profilerrpc.Profiler/ProfilerOP', + request_serializer=profilerrpc_dot_profilerrpc__pb2.ProfilerOPRequest.SerializeToString, + response_deserializer=profilerrpc_dot_profilerrpc__pb2.ProfilerOPResponse.FromString, + ) + + +class ProfilerServicer(object): + """Missing associated documentation comment in .proto file.""" + + def ProfilerOP(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ProfilerServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ProfilerOP': grpc.unary_unary_rpc_method_handler( + servicer.ProfilerOP, + request_deserializer=profilerrpc_dot_profilerrpc__pb2.ProfilerOPRequest.FromString, + response_serializer=profilerrpc_dot_profilerrpc__pb2.ProfilerOPResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'profilerrpc.Profiler', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class Profiler(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def ProfilerOP(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/profilerrpc.Profiler/ProfilerOP', + profilerrpc_dot_profilerrpc__pb2.ProfilerOPRequest.SerializeToString, + profilerrpc_dot_profilerrpc__pb2.ProfilerOPResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/pkg/generated/profilerrpc/profilerrpc.pb.go b/pkg/generated/profilerrpc/profilerrpc.pb.go new file mode 100644 index 0000000..ad11aa0 --- /dev/null +++ b/pkg/generated/profilerrpc/profilerrpc.pb.go @@ -0,0 +1,284 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.3 +// source: profilerrpc/profilerrpc.proto + +package profilerrpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Op int32 + +const ( + Op_SHOW Op = 0 + Op_ENABLE Op = 1 + Op_DISABLE Op = 2 +) + +// Enum value maps for Op. +var ( + Op_name = map[int32]string{ + 0: "SHOW", + 1: "ENABLE", + 2: "DISABLE", + } + Op_value = map[string]int32{ + "SHOW": 0, + "ENABLE": 1, + "DISABLE": 2, + } +) + +func (x Op) Enum() *Op { + p := new(Op) + *p = x + return p +} + +func (x Op) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Op) Descriptor() protoreflect.EnumDescriptor { + return file_profilerrpc_profilerrpc_proto_enumTypes[0].Descriptor() +} + +func (Op) Type() protoreflect.EnumType { + return &file_profilerrpc_profilerrpc_proto_enumTypes[0] +} + +func (x Op) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Op.Descriptor instead. +func (Op) EnumDescriptor() ([]byte, []int) { + return file_profilerrpc_profilerrpc_proto_rawDescGZIP(), []int{0} +} + +type ProfilerOPRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RequestOp Op `protobuf:"varint,1,opt,name=request_op,json=requestOp,proto3,enum=profilerrpc.Op" json:"request_op,omitempty"` + PortNumber int32 `protobuf:"varint,2,opt,name=port_number,json=portNumber,proto3" json:"port_number,omitempty"` +} + +func (x *ProfilerOPRequest) Reset() { + *x = ProfilerOPRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_profilerrpc_profilerrpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProfilerOPRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProfilerOPRequest) ProtoMessage() {} + +func (x *ProfilerOPRequest) ProtoReflect() protoreflect.Message { + mi := &file_profilerrpc_profilerrpc_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProfilerOPRequest.ProtoReflect.Descriptor instead. +func (*ProfilerOPRequest) Descriptor() ([]byte, []int) { + return file_profilerrpc_profilerrpc_proto_rawDescGZIP(), []int{0} +} + +func (x *ProfilerOPRequest) GetRequestOp() Op { + if x != nil { + return x.RequestOp + } + return Op_SHOW +} + +func (x *ProfilerOPRequest) GetPortNumber() int32 { + if x != nil { + return x.PortNumber + } + return 0 +} + +type ProfilerOPResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProfilerAddr string `protobuf:"bytes,1,opt,name=profiler_addr,json=profilerAddr,proto3" json:"profiler_addr,omitempty"` +} + +func (x *ProfilerOPResponse) Reset() { + *x = ProfilerOPResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_profilerrpc_profilerrpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProfilerOPResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProfilerOPResponse) ProtoMessage() {} + +func (x *ProfilerOPResponse) ProtoReflect() protoreflect.Message { + mi := &file_profilerrpc_profilerrpc_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProfilerOPResponse.ProtoReflect.Descriptor instead. +func (*ProfilerOPResponse) Descriptor() ([]byte, []int) { + return file_profilerrpc_profilerrpc_proto_rawDescGZIP(), []int{1} +} + +func (x *ProfilerOPResponse) GetProfilerAddr() string { + if x != nil { + return x.ProfilerAddr + } + return "" +} + +var File_profilerrpc_profilerrpc_proto protoreflect.FileDescriptor + +var file_profilerrpc_profilerrpc_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x72, 0x70, 0x63, 0x22, 0x64, 0x0a, 0x11, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x4f, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2e, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, + 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x70, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4f, + 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x22, 0x39, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x4f, 0x50, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x2a, 0x27, 0x0a, + 0x02, 0x4f, 0x70, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x48, 0x4f, 0x57, 0x10, 0x00, 0x12, 0x0a, 0x0a, + 0x06, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x49, 0x53, + 0x41, 0x42, 0x4c, 0x45, 0x10, 0x02, 0x32, 0x5b, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x4f, 0x50, + 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x72, 0x70, 0x63, 0x2e, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x4f, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x72, 0x70, 0x63, 0x2e, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x4f, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x68, 0x6f, 0x72, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x72, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_profilerrpc_profilerrpc_proto_rawDescOnce sync.Once + file_profilerrpc_profilerrpc_proto_rawDescData = file_profilerrpc_profilerrpc_proto_rawDesc +) + +func file_profilerrpc_profilerrpc_proto_rawDescGZIP() []byte { + file_profilerrpc_profilerrpc_proto_rawDescOnce.Do(func() { + file_profilerrpc_profilerrpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_profilerrpc_profilerrpc_proto_rawDescData) + }) + return file_profilerrpc_profilerrpc_proto_rawDescData +} + +var file_profilerrpc_profilerrpc_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_profilerrpc_profilerrpc_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_profilerrpc_profilerrpc_proto_goTypes = []interface{}{ + (Op)(0), // 0: profilerrpc.Op + (*ProfilerOPRequest)(nil), // 1: profilerrpc.ProfilerOPRequest + (*ProfilerOPResponse)(nil), // 2: profilerrpc.ProfilerOPResponse +} +var file_profilerrpc_profilerrpc_proto_depIdxs = []int32{ + 0, // 0: profilerrpc.ProfilerOPRequest.request_op:type_name -> profilerrpc.Op + 1, // 1: profilerrpc.Profiler.ProfilerOP:input_type -> profilerrpc.ProfilerOPRequest + 2, // 2: profilerrpc.Profiler.ProfilerOP:output_type -> profilerrpc.ProfilerOPResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_profilerrpc_profilerrpc_proto_init() } +func file_profilerrpc_profilerrpc_proto_init() { + if File_profilerrpc_profilerrpc_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_profilerrpc_profilerrpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProfilerOPRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_profilerrpc_profilerrpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProfilerOPResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_profilerrpc_profilerrpc_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_profilerrpc_profilerrpc_proto_goTypes, + DependencyIndexes: file_profilerrpc_profilerrpc_proto_depIdxs, + EnumInfos: file_profilerrpc_profilerrpc_proto_enumTypes, + MessageInfos: file_profilerrpc_profilerrpc_proto_msgTypes, + }.Build() + File_profilerrpc_profilerrpc_proto = out.File + file_profilerrpc_profilerrpc_proto_rawDesc = nil + file_profilerrpc_profilerrpc_proto_goTypes = nil + file_profilerrpc_profilerrpc_proto_depIdxs = nil +} diff --git a/pkg/generated/profilerrpc/profilerrpc_grpc.pb.go b/pkg/generated/profilerrpc/profilerrpc_grpc.pb.go new file mode 100644 index 0000000..19868c6 --- /dev/null +++ b/pkg/generated/profilerrpc/profilerrpc_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.3 +// source: profilerrpc/profilerrpc.proto + +package profilerrpc + +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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Profiler_ProfilerOP_FullMethodName = "/profilerrpc.Profiler/ProfilerOP" +) + +// ProfilerClient is the client API for Profiler 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 ProfilerClient interface { + ProfilerOP(ctx context.Context, in *ProfilerOPRequest, opts ...grpc.CallOption) (*ProfilerOPResponse, error) +} + +type profilerClient struct { + cc grpc.ClientConnInterface +} + +func NewProfilerClient(cc grpc.ClientConnInterface) ProfilerClient { + return &profilerClient{cc} +} + +func (c *profilerClient) ProfilerOP(ctx context.Context, in *ProfilerOPRequest, opts ...grpc.CallOption) (*ProfilerOPResponse, error) { + out := new(ProfilerOPResponse) + err := c.cc.Invoke(ctx, Profiler_ProfilerOP_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ProfilerServer is the server API for Profiler service. +// All implementations must embed UnimplementedProfilerServer +// for forward compatibility +type ProfilerServer interface { + ProfilerOP(context.Context, *ProfilerOPRequest) (*ProfilerOPResponse, error) + mustEmbedUnimplementedProfilerServer() +} + +// UnimplementedProfilerServer must be embedded to have forward compatible implementations. +type UnimplementedProfilerServer struct { +} + +func (UnimplementedProfilerServer) ProfilerOP(context.Context, *ProfilerOPRequest) (*ProfilerOPResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProfilerOP not implemented") +} +func (UnimplementedProfilerServer) mustEmbedUnimplementedProfilerServer() {} + +// UnsafeProfilerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ProfilerServer will +// result in compilation errors. +type UnsafeProfilerServer interface { + mustEmbedUnimplementedProfilerServer() +} + +func RegisterProfilerServer(s grpc.ServiceRegistrar, srv ProfilerServer) { + s.RegisterService(&Profiler_ServiceDesc, srv) +} + +func _Profiler_ProfilerOP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProfilerOPRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProfilerServer).ProfilerOP(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Profiler_ProfilerOP_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProfilerServer).ProfilerOP(ctx, req.(*ProfilerOPRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Profiler_ServiceDesc is the grpc.ServiceDesc for Profiler service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Profiler_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "profilerrpc.Profiler", + HandlerType: (*ProfilerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ProfilerOP", + Handler: _Profiler_ProfilerOP_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "profilerrpc/profilerrpc.proto", +} diff --git a/protobuf/profilerrpc/profilerrpc.proto b/protobuf/profilerrpc/profilerrpc.proto new file mode 100644 index 0000000..00fe842 --- /dev/null +++ b/protobuf/profilerrpc/profilerrpc.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; + +option go_package = "github.com/longhorn/types/generated/profilerrpc"; +package profilerrpc; + +enum Op { + SHOW = 0; + ENABLE = 1; + DISABLE = 2; +} + +message ProfilerOPRequest { + Op request_op = 1; + int32 port_number = 2; +} + +message ProfilerOPResponse { + string profiler_addr = 1; +} + +service Profiler { + rpc ProfilerOP(ProfilerOPRequest) returns (ProfilerOPResponse) {} +} diff --git a/scripts/generate_grpc b/scripts/generate_grpc index ae0cf11..a8cfb7c 100755 --- a/scripts/generate_grpc +++ b/scripts/generate_grpc @@ -18,7 +18,7 @@ PY_BUILD_DIR_BASE=".pyprotobuild" GO_BUILD_DIR_BASE=".goprotobuild" mkdir -p "${PY_BUILD_DIR_BASE}" "${GO_BUILD_DIR_BASE}" -for PROTO in ptypes imrpc bimrpc smrpc spdkrpc; do +for PROTO in ptypes imrpc bimrpc smrpc spdkrpc profilerrpc; do for i in protobuf/${PROTO}/*.proto; do python3 -m grpc_tools.protoc -I "protobuf/" -I "protobuf/vendor/" \ --python_out="${PY_BUILD_DIR_BASE}" \