diff --git a/gen/supernode/service.pb.go b/gen/supernode/service.pb.go index b8399095..c70a14dc 100644 --- a/gen/supernode/service.pb.go +++ b/gen/supernode/service.pb.go @@ -163,6 +163,255 @@ func (x *ServiceInfo) GetMethods() []string { return nil } +// Pprof message types +type GetPprofIndexRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetPprofIndexRequest) Reset() { + *x = GetPprofIndexRequest{} + mi := &file_supernode_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPprofIndexRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPprofIndexRequest) ProtoMessage() {} + +func (x *GetPprofIndexRequest) ProtoReflect() protoreflect.Message { + mi := &file_supernode_service_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 GetPprofIndexRequest.ProtoReflect.Descriptor instead. +func (*GetPprofIndexRequest) Descriptor() ([]byte, []int) { + return file_supernode_service_proto_rawDescGZIP(), []int{3} +} + +type GetPprofIndexResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Html string `protobuf:"bytes,1,opt,name=html,proto3" json:"html,omitempty"` // HTML content for the pprof index page + Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` // Whether profiling is enabled +} + +func (x *GetPprofIndexResponse) Reset() { + *x = GetPprofIndexResponse{} + mi := &file_supernode_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPprofIndexResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPprofIndexResponse) ProtoMessage() {} + +func (x *GetPprofIndexResponse) ProtoReflect() protoreflect.Message { + mi := &file_supernode_service_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 GetPprofIndexResponse.ProtoReflect.Descriptor instead. +func (*GetPprofIndexResponse) Descriptor() ([]byte, []int) { + return file_supernode_service_proto_rawDescGZIP(), []int{4} +} + +func (x *GetPprofIndexResponse) GetHtml() string { + if x != nil { + return x.Html + } + return "" +} + +func (x *GetPprofIndexResponse) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +type GetPprofProfileRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Debug int32 `protobuf:"varint,1,opt,name=debug,proto3" json:"debug,omitempty"` // Debug level (optional, default 1) +} + +func (x *GetPprofProfileRequest) Reset() { + *x = GetPprofProfileRequest{} + mi := &file_supernode_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPprofProfileRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPprofProfileRequest) ProtoMessage() {} + +func (x *GetPprofProfileRequest) ProtoReflect() protoreflect.Message { + mi := &file_supernode_service_proto_msgTypes[5] + 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 GetPprofProfileRequest.ProtoReflect.Descriptor instead. +func (*GetPprofProfileRequest) Descriptor() ([]byte, []int) { + return file_supernode_service_proto_rawDescGZIP(), []int{5} +} + +func (x *GetPprofProfileRequest) GetDebug() int32 { + if x != nil { + return x.Debug + } + return 0 +} + +type GetPprofCpuProfileRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Seconds int32 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` // Duration in seconds (optional, default 30) +} + +func (x *GetPprofCpuProfileRequest) Reset() { + *x = GetPprofCpuProfileRequest{} + mi := &file_supernode_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPprofCpuProfileRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPprofCpuProfileRequest) ProtoMessage() {} + +func (x *GetPprofCpuProfileRequest) ProtoReflect() protoreflect.Message { + mi := &file_supernode_service_proto_msgTypes[6] + 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 GetPprofCpuProfileRequest.ProtoReflect.Descriptor instead. +func (*GetPprofCpuProfileRequest) Descriptor() ([]byte, []int) { + return file_supernode_service_proto_rawDescGZIP(), []int{6} +} + +func (x *GetPprofCpuProfileRequest) GetSeconds() int32 { + if x != nil { + return x.Seconds + } + return 0 +} + +type GetPprofProfileResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // Profile data (binary pprof format) + ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` // Content type of the response + Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` // Whether profiling is enabled + Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` // Error message if profiling is disabled +} + +func (x *GetPprofProfileResponse) Reset() { + *x = GetPprofProfileResponse{} + mi := &file_supernode_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPprofProfileResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPprofProfileResponse) ProtoMessage() {} + +func (x *GetPprofProfileResponse) ProtoReflect() protoreflect.Message { + mi := &file_supernode_service_proto_msgTypes[7] + 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 GetPprofProfileResponse.ProtoReflect.Descriptor instead. +func (*GetPprofProfileResponse) Descriptor() ([]byte, []int) { + return file_supernode_service_proto_rawDescGZIP(), []int{7} +} + +func (x *GetPprofProfileResponse) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *GetPprofProfileResponse) GetContentType() string { + if x != nil { + return x.ContentType + } + return "" +} + +func (x *GetPprofProfileResponse) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *GetPprofProfileResponse) GetError() string { + if x != nil { + return x.Error + } + return "" +} + var File_supernode_service_proto protoreflect.FileDescriptor var file_supernode_service_proto_rawDesc = []byte{ @@ -183,24 +432,108 @@ var file_supernode_service_proto_rawDesc = []byte{ 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, - 0x32, 0xd7, 0x01, 0x0a, 0x10, 0x53, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x18, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, - 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, - 0x0e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x69, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, - 0x1e, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1f, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, - 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, - 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x16, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x45, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, + 0x70, 0x72, 0x6f, 0x66, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x74, 0x6d, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x68, 0x74, 0x6d, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, + 0x2e, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, + 0x75, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, + 0x35, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x43, 0x70, 0x75, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x50, 0x70, + 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x32, 0xc5, 0x09, 0x0a, 0x10, 0x53, 0x75, + 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, + 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x2e, 0x73, 0x75, + 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x69, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, + 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, + 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x12, 0x12, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x12, 0x6f, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, + 0x2e, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, + 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2f, 0x70, + 0x70, 0x72, 0x6f, 0x66, 0x12, 0x77, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, + 0x48, 0x65, 0x61, 0x70, 0x12, 0x21, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, + 0x2e, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x62, + 0x75, 0x67, 0x2f, 0x70, 0x70, 0x72, 0x6f, 0x66, 0x2f, 0x68, 0x65, 0x61, 0x70, 0x12, 0x81, 0x01, + 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x47, 0x6f, 0x72, 0x6f, 0x75, 0x74, + 0x69, 0x6e, 0x65, 0x12, 0x21, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x62, 0x75, + 0x67, 0x2f, 0x70, 0x70, 0x72, 0x6f, 0x66, 0x2f, 0x67, 0x6f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, + 0x65, 0x12, 0x7b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x41, 0x6c, 0x6c, + 0x6f, 0x63, 0x73, 0x12, 0x21, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x62, 0x75, + 0x67, 0x2f, 0x70, 0x70, 0x72, 0x6f, 0x66, 0x2f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x73, 0x12, 0x79, + 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, + 0x21, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x50, + 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, + 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2f, 0x70, 0x70, + 0x72, 0x6f, 0x66, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x79, 0x0a, 0x0d, 0x47, 0x65, 0x74, + 0x50, 0x70, 0x72, 0x6f, 0x66, 0x4d, 0x75, 0x74, 0x65, 0x78, 0x12, 0x21, 0x2e, 0x73, 0x75, 0x70, + 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, + 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, + 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x31, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2f, 0x70, 0x70, 0x72, 0x6f, 0x66, 0x2f, 0x6d, + 0x75, 0x74, 0x65, 0x78, 0x12, 0x87, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, + 0x66, 0x54, 0x68, 0x72, 0x65, 0x61, 0x64, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x21, 0x2e, + 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, + 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x22, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, + 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2f, 0x70, 0x70, 0x72, 0x6f, + 0x66, 0x2f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x80, + 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x12, 0x24, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, + 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x43, 0x70, 0x75, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, + 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x70, 0x72, 0x6f, 0x66, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, + 0x62, 0x75, 0x67, 0x2f, 0x70, 0x70, 0x72, 0x6f, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x4c, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x73, + 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x67, 0x65, 0x6e, 0x2f, + 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -215,25 +548,46 @@ func file_supernode_service_proto_rawDescGZIP() []byte { return file_supernode_service_proto_rawDescData } -var file_supernode_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_supernode_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_supernode_service_proto_goTypes = []any{ - (*ListServicesRequest)(nil), // 0: supernode.ListServicesRequest - (*ListServicesResponse)(nil), // 1: supernode.ListServicesResponse - (*ServiceInfo)(nil), // 2: supernode.ServiceInfo - (*StatusRequest)(nil), // 3: supernode.StatusRequest - (*StatusResponse)(nil), // 4: supernode.StatusResponse + (*ListServicesRequest)(nil), // 0: supernode.ListServicesRequest + (*ListServicesResponse)(nil), // 1: supernode.ListServicesResponse + (*ServiceInfo)(nil), // 2: supernode.ServiceInfo + (*GetPprofIndexRequest)(nil), // 3: supernode.GetPprofIndexRequest + (*GetPprofIndexResponse)(nil), // 4: supernode.GetPprofIndexResponse + (*GetPprofProfileRequest)(nil), // 5: supernode.GetPprofProfileRequest + (*GetPprofCpuProfileRequest)(nil), // 6: supernode.GetPprofCpuProfileRequest + (*GetPprofProfileResponse)(nil), // 7: supernode.GetPprofProfileResponse + (*StatusRequest)(nil), // 8: supernode.StatusRequest + (*StatusResponse)(nil), // 9: supernode.StatusResponse } var file_supernode_service_proto_depIdxs = []int32{ - 2, // 0: supernode.ListServicesResponse.services:type_name -> supernode.ServiceInfo - 3, // 1: supernode.SupernodeService.GetStatus:input_type -> supernode.StatusRequest - 0, // 2: supernode.SupernodeService.ListServices:input_type -> supernode.ListServicesRequest - 4, // 3: supernode.SupernodeService.GetStatus:output_type -> supernode.StatusResponse - 1, // 4: supernode.SupernodeService.ListServices:output_type -> supernode.ListServicesResponse - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] 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 + 2, // 0: supernode.ListServicesResponse.services:type_name -> supernode.ServiceInfo + 8, // 1: supernode.SupernodeService.GetStatus:input_type -> supernode.StatusRequest + 0, // 2: supernode.SupernodeService.ListServices:input_type -> supernode.ListServicesRequest + 3, // 3: supernode.SupernodeService.GetPprofIndex:input_type -> supernode.GetPprofIndexRequest + 5, // 4: supernode.SupernodeService.GetPprofHeap:input_type -> supernode.GetPprofProfileRequest + 5, // 5: supernode.SupernodeService.GetPprofGoroutine:input_type -> supernode.GetPprofProfileRequest + 5, // 6: supernode.SupernodeService.GetPprofAllocs:input_type -> supernode.GetPprofProfileRequest + 5, // 7: supernode.SupernodeService.GetPprofBlock:input_type -> supernode.GetPprofProfileRequest + 5, // 8: supernode.SupernodeService.GetPprofMutex:input_type -> supernode.GetPprofProfileRequest + 5, // 9: supernode.SupernodeService.GetPprofThreadcreate:input_type -> supernode.GetPprofProfileRequest + 6, // 10: supernode.SupernodeService.GetPprofProfile:input_type -> supernode.GetPprofCpuProfileRequest + 9, // 11: supernode.SupernodeService.GetStatus:output_type -> supernode.StatusResponse + 1, // 12: supernode.SupernodeService.ListServices:output_type -> supernode.ListServicesResponse + 4, // 13: supernode.SupernodeService.GetPprofIndex:output_type -> supernode.GetPprofIndexResponse + 7, // 14: supernode.SupernodeService.GetPprofHeap:output_type -> supernode.GetPprofProfileResponse + 7, // 15: supernode.SupernodeService.GetPprofGoroutine:output_type -> supernode.GetPprofProfileResponse + 7, // 16: supernode.SupernodeService.GetPprofAllocs:output_type -> supernode.GetPprofProfileResponse + 7, // 17: supernode.SupernodeService.GetPprofBlock:output_type -> supernode.GetPprofProfileResponse + 7, // 18: supernode.SupernodeService.GetPprofMutex:output_type -> supernode.GetPprofProfileResponse + 7, // 19: supernode.SupernodeService.GetPprofThreadcreate:output_type -> supernode.GetPprofProfileResponse + 7, // 20: supernode.SupernodeService.GetPprofProfile:output_type -> supernode.GetPprofProfileResponse + 11, // [11:21] is the sub-list for method output_type + 1, // [1:11] 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_supernode_service_proto_init() } @@ -248,7 +602,7 @@ func file_supernode_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_supernode_service_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/supernode/service.pb.gw.go b/gen/supernode/service.pb.gw.go index 326bccf3..9cdfafbc 100644 --- a/gen/supernode/service.pb.gw.go +++ b/gen/supernode/service.pb.gw.go @@ -87,13 +87,375 @@ func local_request_SupernodeService_ListServices_0(ctx context.Context, marshale } +func request_SupernodeService_GetPprofIndex_0(ctx context.Context, marshaler runtime.Marshaler, client SupernodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofIndexRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetPprofIndex(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SupernodeService_GetPprofIndex_0(ctx context.Context, marshaler runtime.Marshaler, server SupernodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofIndexRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetPprofIndex(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_SupernodeService_GetPprofHeap_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_SupernodeService_GetPprofHeap_0(ctx context.Context, marshaler runtime.Marshaler, client SupernodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofHeap_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPprofHeap(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SupernodeService_GetPprofHeap_0(ctx context.Context, marshaler runtime.Marshaler, server SupernodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofHeap_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPprofHeap(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_SupernodeService_GetPprofGoroutine_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_SupernodeService_GetPprofGoroutine_0(ctx context.Context, marshaler runtime.Marshaler, client SupernodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofGoroutine_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPprofGoroutine(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SupernodeService_GetPprofGoroutine_0(ctx context.Context, marshaler runtime.Marshaler, server SupernodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofGoroutine_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPprofGoroutine(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_SupernodeService_GetPprofAllocs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_SupernodeService_GetPprofAllocs_0(ctx context.Context, marshaler runtime.Marshaler, client SupernodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofAllocs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPprofAllocs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SupernodeService_GetPprofAllocs_0(ctx context.Context, marshaler runtime.Marshaler, server SupernodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofAllocs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPprofAllocs(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_SupernodeService_GetPprofBlock_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_SupernodeService_GetPprofBlock_0(ctx context.Context, marshaler runtime.Marshaler, client SupernodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofBlock_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPprofBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SupernodeService_GetPprofBlock_0(ctx context.Context, marshaler runtime.Marshaler, server SupernodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofBlock_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPprofBlock(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_SupernodeService_GetPprofMutex_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_SupernodeService_GetPprofMutex_0(ctx context.Context, marshaler runtime.Marshaler, client SupernodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofMutex_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPprofMutex(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SupernodeService_GetPprofMutex_0(ctx context.Context, marshaler runtime.Marshaler, server SupernodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofMutex_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPprofMutex(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_SupernodeService_GetPprofThreadcreate_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_SupernodeService_GetPprofThreadcreate_0(ctx context.Context, marshaler runtime.Marshaler, client SupernodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofThreadcreate_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPprofThreadcreate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SupernodeService_GetPprofThreadcreate_0(ctx context.Context, marshaler runtime.Marshaler, server SupernodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofThreadcreate_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPprofThreadcreate(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_SupernodeService_GetPprofProfile_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_SupernodeService_GetPprofProfile_0(ctx context.Context, marshaler runtime.Marshaler, client SupernodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofCpuProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofProfile_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPprofProfile(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_SupernodeService_GetPprofProfile_0(ctx context.Context, marshaler runtime.Marshaler, server SupernodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetPprofCpuProfileRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SupernodeService_GetPprofProfile_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPprofProfile(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterSupernodeServiceHandlerServer registers the http handlers for service SupernodeService to "mux". // UnaryRPC :call SupernodeServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSupernodeServiceHandlerFromEndpoint instead. func RegisterSupernodeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SupernodeServiceServer) error { - mux.Handle("GET", pattern_SupernodeService_GetStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_SupernodeService_GetStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SupernodeService_GetStatus_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_ListServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SupernodeService_ListServices_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_ListServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SupernodeService_GetPprofIndex_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofHeap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SupernodeService_GetPprofHeap_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofHeap_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofGoroutine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -104,7 +466,7 @@ func RegisterSupernodeServiceHandlerServer(ctx context.Context, mux *runtime.Ser runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_SupernodeService_GetStatus_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_SupernodeService_GetPprofGoroutine_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -112,11 +474,11 @@ func RegisterSupernodeServiceHandlerServer(ctx context.Context, mux *runtime.Ser return } - forward_SupernodeService_GetStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_SupernodeService_GetPprofGoroutine_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_SupernodeService_ListServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_SupernodeService_GetPprofAllocs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -127,7 +489,7 @@ func RegisterSupernodeServiceHandlerServer(ctx context.Context, mux *runtime.Ser runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_SupernodeService_ListServices_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_SupernodeService_GetPprofAllocs_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -135,7 +497,99 @@ func RegisterSupernodeServiceHandlerServer(ctx context.Context, mux *runtime.Ser return } - forward_SupernodeService_ListServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_SupernodeService_GetPprofAllocs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SupernodeService_GetPprofBlock_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofMutex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SupernodeService_GetPprofMutex_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofMutex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofThreadcreate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SupernodeService_GetPprofThreadcreate_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofThreadcreate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofProfile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_SupernodeService_GetPprofProfile_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofProfile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -220,6 +674,166 @@ func RegisterSupernodeServiceHandlerClient(ctx context.Context, mux *runtime.Ser }) + mux.Handle("GET", pattern_SupernodeService_GetPprofIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SupernodeService_GetPprofIndex_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofHeap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SupernodeService_GetPprofHeap_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofHeap_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofGoroutine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SupernodeService_GetPprofGoroutine_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofGoroutine_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofAllocs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SupernodeService_GetPprofAllocs_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofAllocs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SupernodeService_GetPprofBlock_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofMutex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SupernodeService_GetPprofMutex_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofMutex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofThreadcreate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SupernodeService_GetPprofThreadcreate_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofThreadcreate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_SupernodeService_GetPprofProfile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SupernodeService_GetPprofProfile_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SupernodeService_GetPprofProfile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -227,10 +841,42 @@ var ( pattern_SupernodeService_GetStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "status"}, "", runtime.AssumeColonVerbOpt(true))) pattern_SupernodeService_ListServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "services"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_SupernodeService_GetPprofIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "debug", "pprof"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_SupernodeService_GetPprofHeap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "debug", "pprof", "heap"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_SupernodeService_GetPprofGoroutine_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "debug", "pprof", "goroutine"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_SupernodeService_GetPprofAllocs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "debug", "pprof", "allocs"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_SupernodeService_GetPprofBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "debug", "pprof", "block"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_SupernodeService_GetPprofMutex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "debug", "pprof", "mutex"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_SupernodeService_GetPprofThreadcreate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "debug", "pprof", "threadcreate"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_SupernodeService_GetPprofProfile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "debug", "pprof", "profile"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( forward_SupernodeService_GetStatus_0 = runtime.ForwardResponseMessage forward_SupernodeService_ListServices_0 = runtime.ForwardResponseMessage + + forward_SupernodeService_GetPprofIndex_0 = runtime.ForwardResponseMessage + + forward_SupernodeService_GetPprofHeap_0 = runtime.ForwardResponseMessage + + forward_SupernodeService_GetPprofGoroutine_0 = runtime.ForwardResponseMessage + + forward_SupernodeService_GetPprofAllocs_0 = runtime.ForwardResponseMessage + + forward_SupernodeService_GetPprofBlock_0 = runtime.ForwardResponseMessage + + forward_SupernodeService_GetPprofMutex_0 = runtime.ForwardResponseMessage + + forward_SupernodeService_GetPprofThreadcreate_0 = runtime.ForwardResponseMessage + + forward_SupernodeService_GetPprofProfile_0 = runtime.ForwardResponseMessage ) diff --git a/gen/supernode/service.swagger.json b/gen/supernode/service.swagger.json index 0b515a20..6e04d0b9 100644 --- a/gen/supernode/service.swagger.json +++ b/gen/supernode/service.swagger.json @@ -16,6 +16,253 @@ "application/json" ], "paths": { + "/api/v1/debug/pprof": { + "get": { + "summary": "Profiling endpoints", + "operationId": "SupernodeService_GetPprofIndex", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supernodeGetPprofIndexResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "SupernodeService" + ] + } + }, + "/api/v1/debug/pprof/allocs": { + "get": { + "operationId": "SupernodeService_GetPprofAllocs", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supernodeGetPprofProfileResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "debug", + "description": "Debug level (optional, default 1)", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "tags": [ + "SupernodeService" + ] + } + }, + "/api/v1/debug/pprof/block": { + "get": { + "operationId": "SupernodeService_GetPprofBlock", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supernodeGetPprofProfileResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "debug", + "description": "Debug level (optional, default 1)", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "tags": [ + "SupernodeService" + ] + } + }, + "/api/v1/debug/pprof/goroutine": { + "get": { + "operationId": "SupernodeService_GetPprofGoroutine", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supernodeGetPprofProfileResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "debug", + "description": "Debug level (optional, default 1)", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "tags": [ + "SupernodeService" + ] + } + }, + "/api/v1/debug/pprof/heap": { + "get": { + "operationId": "SupernodeService_GetPprofHeap", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supernodeGetPprofProfileResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "debug", + "description": "Debug level (optional, default 1)", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "tags": [ + "SupernodeService" + ] + } + }, + "/api/v1/debug/pprof/mutex": { + "get": { + "operationId": "SupernodeService_GetPprofMutex", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supernodeGetPprofProfileResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "debug", + "description": "Debug level (optional, default 1)", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "tags": [ + "SupernodeService" + ] + } + }, + "/api/v1/debug/pprof/profile": { + "get": { + "operationId": "SupernodeService_GetPprofProfile", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supernodeGetPprofProfileResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "seconds", + "description": "Duration in seconds (optional, default 30)", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "tags": [ + "SupernodeService" + ] + } + }, + "/api/v1/debug/pprof/threadcreate": { + "get": { + "operationId": "SupernodeService_GetPprofThreadcreate", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/supernodeGetPprofProfileResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "debug", + "description": "Debug level (optional, default 1)", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "tags": [ + "SupernodeService" + ] + } + }, "/api/v1/services": { "get": { "operationId": "SupernodeService_ListServices", @@ -419,6 +666,41 @@ } } }, + "supernodeGetPprofIndexResponse": { + "type": "object", + "properties": { + "html": { + "type": "string", + "title": "HTML content for the pprof index page" + }, + "enabled": { + "type": "boolean", + "title": "Whether profiling is enabled" + } + } + }, + "supernodeGetPprofProfileResponse": { + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte", + "title": "Profile data (binary pprof format)" + }, + "contentType": { + "type": "string", + "title": "Content type of the response" + }, + "enabled": { + "type": "boolean", + "title": "Whether profiling is enabled" + }, + "error": { + "type": "string", + "title": "Error message if profiling is disabled" + } + } + }, "supernodeListServicesResponse": { "type": "object", "properties": { diff --git a/gen/supernode/service_grpc.pb.go b/gen/supernode/service_grpc.pb.go index acb2e4c9..98db9323 100644 --- a/gen/supernode/service_grpc.pb.go +++ b/gen/supernode/service_grpc.pb.go @@ -19,8 +19,16 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - SupernodeService_GetStatus_FullMethodName = "/supernode.SupernodeService/GetStatus" - SupernodeService_ListServices_FullMethodName = "/supernode.SupernodeService/ListServices" + SupernodeService_GetStatus_FullMethodName = "/supernode.SupernodeService/GetStatus" + SupernodeService_ListServices_FullMethodName = "/supernode.SupernodeService/ListServices" + SupernodeService_GetPprofIndex_FullMethodName = "/supernode.SupernodeService/GetPprofIndex" + SupernodeService_GetPprofHeap_FullMethodName = "/supernode.SupernodeService/GetPprofHeap" + SupernodeService_GetPprofGoroutine_FullMethodName = "/supernode.SupernodeService/GetPprofGoroutine" + SupernodeService_GetPprofAllocs_FullMethodName = "/supernode.SupernodeService/GetPprofAllocs" + SupernodeService_GetPprofBlock_FullMethodName = "/supernode.SupernodeService/GetPprofBlock" + SupernodeService_GetPprofMutex_FullMethodName = "/supernode.SupernodeService/GetPprofMutex" + SupernodeService_GetPprofThreadcreate_FullMethodName = "/supernode.SupernodeService/GetPprofThreadcreate" + SupernodeService_GetPprofProfile_FullMethodName = "/supernode.SupernodeService/GetPprofProfile" ) // SupernodeServiceClient is the client API for SupernodeService service. @@ -31,6 +39,15 @@ const ( type SupernodeServiceClient interface { GetStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) + // Profiling endpoints + GetPprofIndex(ctx context.Context, in *GetPprofIndexRequest, opts ...grpc.CallOption) (*GetPprofIndexResponse, error) + GetPprofHeap(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) + GetPprofGoroutine(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) + GetPprofAllocs(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) + GetPprofBlock(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) + GetPprofMutex(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) + GetPprofThreadcreate(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) + GetPprofProfile(ctx context.Context, in *GetPprofCpuProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) } type supernodeServiceClient struct { @@ -61,6 +78,86 @@ func (c *supernodeServiceClient) ListServices(ctx context.Context, in *ListServi return out, nil } +func (c *supernodeServiceClient) GetPprofIndex(ctx context.Context, in *GetPprofIndexRequest, opts ...grpc.CallOption) (*GetPprofIndexResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetPprofIndexResponse) + err := c.cc.Invoke(ctx, SupernodeService_GetPprofIndex_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *supernodeServiceClient) GetPprofHeap(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetPprofProfileResponse) + err := c.cc.Invoke(ctx, SupernodeService_GetPprofHeap_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *supernodeServiceClient) GetPprofGoroutine(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetPprofProfileResponse) + err := c.cc.Invoke(ctx, SupernodeService_GetPprofGoroutine_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *supernodeServiceClient) GetPprofAllocs(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetPprofProfileResponse) + err := c.cc.Invoke(ctx, SupernodeService_GetPprofAllocs_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *supernodeServiceClient) GetPprofBlock(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetPprofProfileResponse) + err := c.cc.Invoke(ctx, SupernodeService_GetPprofBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *supernodeServiceClient) GetPprofMutex(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetPprofProfileResponse) + err := c.cc.Invoke(ctx, SupernodeService_GetPprofMutex_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *supernodeServiceClient) GetPprofThreadcreate(ctx context.Context, in *GetPprofProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetPprofProfileResponse) + err := c.cc.Invoke(ctx, SupernodeService_GetPprofThreadcreate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *supernodeServiceClient) GetPprofProfile(ctx context.Context, in *GetPprofCpuProfileRequest, opts ...grpc.CallOption) (*GetPprofProfileResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetPprofProfileResponse) + err := c.cc.Invoke(ctx, SupernodeService_GetPprofProfile_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // SupernodeServiceServer is the server API for SupernodeService service. // All implementations must embed UnimplementedSupernodeServiceServer // for forward compatibility. @@ -69,6 +166,15 @@ func (c *supernodeServiceClient) ListServices(ctx context.Context, in *ListServi type SupernodeServiceServer interface { GetStatus(context.Context, *StatusRequest) (*StatusResponse, error) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) + // Profiling endpoints + GetPprofIndex(context.Context, *GetPprofIndexRequest) (*GetPprofIndexResponse, error) + GetPprofHeap(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) + GetPprofGoroutine(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) + GetPprofAllocs(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) + GetPprofBlock(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) + GetPprofMutex(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) + GetPprofThreadcreate(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) + GetPprofProfile(context.Context, *GetPprofCpuProfileRequest) (*GetPprofProfileResponse, error) mustEmbedUnimplementedSupernodeServiceServer() } @@ -85,6 +191,30 @@ func (UnimplementedSupernodeServiceServer) GetStatus(context.Context, *StatusReq func (UnimplementedSupernodeServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented") } +func (UnimplementedSupernodeServiceServer) GetPprofIndex(context.Context, *GetPprofIndexRequest) (*GetPprofIndexResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPprofIndex not implemented") +} +func (UnimplementedSupernodeServiceServer) GetPprofHeap(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPprofHeap not implemented") +} +func (UnimplementedSupernodeServiceServer) GetPprofGoroutine(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPprofGoroutine not implemented") +} +func (UnimplementedSupernodeServiceServer) GetPprofAllocs(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPprofAllocs not implemented") +} +func (UnimplementedSupernodeServiceServer) GetPprofBlock(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPprofBlock not implemented") +} +func (UnimplementedSupernodeServiceServer) GetPprofMutex(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPprofMutex not implemented") +} +func (UnimplementedSupernodeServiceServer) GetPprofThreadcreate(context.Context, *GetPprofProfileRequest) (*GetPprofProfileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPprofThreadcreate not implemented") +} +func (UnimplementedSupernodeServiceServer) GetPprofProfile(context.Context, *GetPprofCpuProfileRequest) (*GetPprofProfileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPprofProfile not implemented") +} func (UnimplementedSupernodeServiceServer) mustEmbedUnimplementedSupernodeServiceServer() {} func (UnimplementedSupernodeServiceServer) testEmbeddedByValue() {} @@ -142,6 +272,150 @@ func _SupernodeService_ListServices_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _SupernodeService_GetPprofIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPprofIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SupernodeServiceServer).GetPprofIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SupernodeService_GetPprofIndex_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SupernodeServiceServer).GetPprofIndex(ctx, req.(*GetPprofIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SupernodeService_GetPprofHeap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPprofProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SupernodeServiceServer).GetPprofHeap(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SupernodeService_GetPprofHeap_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SupernodeServiceServer).GetPprofHeap(ctx, req.(*GetPprofProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SupernodeService_GetPprofGoroutine_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPprofProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SupernodeServiceServer).GetPprofGoroutine(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SupernodeService_GetPprofGoroutine_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SupernodeServiceServer).GetPprofGoroutine(ctx, req.(*GetPprofProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SupernodeService_GetPprofAllocs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPprofProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SupernodeServiceServer).GetPprofAllocs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SupernodeService_GetPprofAllocs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SupernodeServiceServer).GetPprofAllocs(ctx, req.(*GetPprofProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SupernodeService_GetPprofBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPprofProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SupernodeServiceServer).GetPprofBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SupernodeService_GetPprofBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SupernodeServiceServer).GetPprofBlock(ctx, req.(*GetPprofProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SupernodeService_GetPprofMutex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPprofProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SupernodeServiceServer).GetPprofMutex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SupernodeService_GetPprofMutex_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SupernodeServiceServer).GetPprofMutex(ctx, req.(*GetPprofProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SupernodeService_GetPprofThreadcreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPprofProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SupernodeServiceServer).GetPprofThreadcreate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SupernodeService_GetPprofThreadcreate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SupernodeServiceServer).GetPprofThreadcreate(ctx, req.(*GetPprofProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SupernodeService_GetPprofProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPprofCpuProfileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SupernodeServiceServer).GetPprofProfile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SupernodeService_GetPprofProfile_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SupernodeServiceServer).GetPprofProfile(ctx, req.(*GetPprofCpuProfileRequest)) + } + return interceptor(ctx, in, info, handler) +} + // SupernodeService_ServiceDesc is the grpc.ServiceDesc for SupernodeService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -157,6 +431,38 @@ var SupernodeService_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListServices", Handler: _SupernodeService_ListServices_Handler, }, + { + MethodName: "GetPprofIndex", + Handler: _SupernodeService_GetPprofIndex_Handler, + }, + { + MethodName: "GetPprofHeap", + Handler: _SupernodeService_GetPprofHeap_Handler, + }, + { + MethodName: "GetPprofGoroutine", + Handler: _SupernodeService_GetPprofGoroutine_Handler, + }, + { + MethodName: "GetPprofAllocs", + Handler: _SupernodeService_GetPprofAllocs_Handler, + }, + { + MethodName: "GetPprofBlock", + Handler: _SupernodeService_GetPprofBlock_Handler, + }, + { + MethodName: "GetPprofMutex", + Handler: _SupernodeService_GetPprofMutex_Handler, + }, + { + MethodName: "GetPprofThreadcreate", + Handler: _SupernodeService_GetPprofThreadcreate_Handler, + }, + { + MethodName: "GetPprofProfile", + Handler: _SupernodeService_GetPprofProfile_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "supernode/service.proto", diff --git a/proto/supernode/service.proto b/proto/supernode/service.proto index 9725f84a..05d071d4 100644 --- a/proto/supernode/service.proto +++ b/proto/supernode/service.proto @@ -12,12 +12,61 @@ service SupernodeService { get: "/api/v1/status" }; } - + rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { option (google.api.http) = { get: "/api/v1/services" }; } + + // Profiling endpoints + rpc GetPprofIndex(GetPprofIndexRequest) returns (GetPprofIndexResponse) { + option (google.api.http) = { + get: "/api/v1/debug/pprof" + }; + } + + rpc GetPprofHeap(GetPprofProfileRequest) returns (GetPprofProfileResponse) { + option (google.api.http) = { + get: "/api/v1/debug/pprof/heap" + }; + } + + rpc GetPprofGoroutine(GetPprofProfileRequest) returns (GetPprofProfileResponse) { + option (google.api.http) = { + get: "/api/v1/debug/pprof/goroutine" + }; + } + + rpc GetPprofAllocs(GetPprofProfileRequest) returns (GetPprofProfileResponse) { + option (google.api.http) = { + get: "/api/v1/debug/pprof/allocs" + }; + } + + rpc GetPprofBlock(GetPprofProfileRequest) returns (GetPprofProfileResponse) { + option (google.api.http) = { + get: "/api/v1/debug/pprof/block" + }; + } + + rpc GetPprofMutex(GetPprofProfileRequest) returns (GetPprofProfileResponse) { + option (google.api.http) = { + get: "/api/v1/debug/pprof/mutex" + }; + } + + rpc GetPprofThreadcreate(GetPprofProfileRequest) returns (GetPprofProfileResponse) { + option (google.api.http) = { + get: "/api/v1/debug/pprof/threadcreate" + }; + } + + rpc GetPprofProfile(GetPprofCpuProfileRequest) returns (GetPprofProfileResponse) { + option (google.api.http) = { + get: "/api/v1/debug/pprof/profile" + }; + } } message ListServicesRequest {} @@ -32,3 +81,26 @@ message ServiceInfo { repeated string methods = 2; } +// Pprof message types +message GetPprofIndexRequest {} + +message GetPprofIndexResponse { + string html = 1; // HTML content for the pprof index page + bool enabled = 2; // Whether profiling is enabled +} + +message GetPprofProfileRequest { + int32 debug = 1; // Debug level (optional, default 1) +} + +message GetPprofCpuProfileRequest { + int32 seconds = 1; // Duration in seconds (optional, default 30) +} + +message GetPprofProfileResponse { + bytes data = 1; // Profile data (binary pprof format) + string content_type = 2; // Content type of the response + bool enabled = 3; // Whether profiling is enabled + string error = 4; // Error message if profiling is disabled +} + diff --git a/supernode/cmd/start.go b/supernode/cmd/start.go index 5b173034..1b0b1de7 100644 --- a/supernode/cmd/start.go +++ b/supernode/cmd/start.go @@ -143,7 +143,13 @@ The supernode will connect to the Lumera network and begin participating in the } // Create HTTP gateway server that directly calls the supernode server - gatewayServer, err := gateway.NewServer(appConfig.SupernodeConfig.Host, int(appConfig.SupernodeConfig.GatewayPort), supernodeServer) + // Pass chain ID for pprof configuration + gatewayServer, err := gateway.NewServerWithConfig( + appConfig.SupernodeConfig.Host, + int(appConfig.SupernodeConfig.GatewayPort), + supernodeServer, + appConfig.LumeraClientConfig.ChainID, + ) if err != nil { return fmt.Errorf("failed to create gateway server: %w", err) } diff --git a/supernode/status/service.go b/supernode/status/service.go index 1745b0d3..553f7e2d 100644 --- a/supernode/status/service.go +++ b/supernode/status/service.go @@ -32,6 +32,14 @@ func NewSupernodeStatusService(p2pService p2p.Client, lumeraClient lumera.Client return &SupernodeStatusService{metrics: NewMetricsCollector(), storagePaths: []string{"/"}, startTime: time.Now(), p2pService: p2pService, lumeraClient: lumeraClient, config: cfg} } +// GetChainID returns the chain ID from the configuration +func (s *SupernodeStatusService) GetChainID() string { + if s.config != nil { + return s.config.LumeraClientConfig.ChainID + } + return "" +} + // GetStatus returns the current system status including optional P2P info func (s *SupernodeStatusService) GetStatus(ctx context.Context, includeP2PMetrics bool) (*pb.StatusResponse, error) { fields := logtrace.Fields{logtrace.FieldMethod: "GetStatus", logtrace.FieldModule: "SupernodeStatusService"} diff --git a/supernode/transport/gateway/server.go b/supernode/transport/gateway/server.go index 7e17e238..e306539a 100644 --- a/supernode/transport/gateway/server.go +++ b/supernode/transport/gateway/server.go @@ -5,7 +5,10 @@ import ( "fmt" "net" "net/http" + _ "net/http/pprof" + "os" "strconv" + "strings" "time" "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -23,6 +26,8 @@ type Server struct { port int server *http.Server supernodeServer pb.SupernodeServiceServer + chainID string + pprofEnabled bool } // NewServer creates a new HTTP gateway server that directly calls the service @@ -44,6 +49,29 @@ func NewServer(ipAddress string, port int, supernodeServer pb.SupernodeServiceSe }, nil } +// NewServerWithConfig creates a new HTTP gateway server with additional configuration +func NewServerWithConfig(ipAddress string, port int, supernodeServer pb.SupernodeServiceServer, chainID string) (*Server, error) { + if supernodeServer == nil { + return nil, fmt.Errorf("supernode server is required") + } + + // Use default port if not specified + if port == 0 { + port = DefaultGatewayPort + } + + // Determine if pprof should be enabled + pprofEnabled := strings.Contains(strings.ToLower(chainID), "testnet") || os.Getenv("ENABLE_PPROF") == "true" + + return &Server{ + ipAddress: ipAddress, + port: port, + supernodeServer: supernodeServer, + chainID: chainID, + pprofEnabled: pprofEnabled, + }, nil +} + // Run starts the HTTP gateway server (implements service interface) func (s *Server) Run(ctx context.Context) error { // Create gRPC-Gateway mux with custom JSON marshaler options @@ -69,6 +97,28 @@ func (s *Server) Run(ctx context.Context) error { // Register Swagger endpoints httpMux.HandleFunc("/swagger.json", s.serveSwaggerJSON) httpMux.HandleFunc("/swagger-ui/", s.serveSwaggerUI) + + // Register pprof endpoints (only on testnet) + if s.pprofEnabled { + httpMux.HandleFunc("/debug/pprof/", s.pprofHandler) + httpMux.HandleFunc("/debug/pprof/cmdline", s.pprofHandler) + httpMux.HandleFunc("/debug/pprof/profile", s.pprofHandler) + httpMux.HandleFunc("/debug/pprof/symbol", s.pprofHandler) + httpMux.HandleFunc("/debug/pprof/trace", s.pprofHandler) + // Register specific pprof profiles + httpMux.HandleFunc("/debug/pprof/allocs", s.pprofHandler) + httpMux.HandleFunc("/debug/pprof/block", s.pprofHandler) + httpMux.HandleFunc("/debug/pprof/goroutine", s.pprofHandler) + httpMux.HandleFunc("/debug/pprof/heap", s.pprofHandler) + httpMux.HandleFunc("/debug/pprof/mutex", s.pprofHandler) + httpMux.HandleFunc("/debug/pprof/threadcreate", s.pprofHandler) + + logtrace.Debug(ctx, "Pprof endpoints enabled on gateway", logtrace.Fields{ + "chain_id": s.chainID, + "port": s.port, + }) + } + httpMux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/" { http.Redirect(w, r, "/swagger-ui/", http.StatusFound) @@ -87,8 +137,9 @@ func (s *Server) Run(ctx context.Context) error { } logtrace.Debug(ctx, "Starting HTTP gateway server", logtrace.Fields{ - "address": s.ipAddress, - "port": s.port, + "address": s.ipAddress, + "port": s.port, + "pprof_enabled": s.pprofEnabled, }) // Start server @@ -124,3 +175,19 @@ func (s *Server) corsMiddleware(h http.Handler) http.Handler { h.ServeHTTP(w, r) }) } + +// pprofHandler proxies requests to the pprof handlers +func (s *Server) pprofHandler(w http.ResponseWriter, r *http.Request) { + // Check if pprof is enabled + if !s.pprofEnabled { + http.Error(w, "Profiling is not enabled", http.StatusForbidden) + return + } + + // Get the default pprof handler and serve + if handler, pattern := http.DefaultServeMux.Handler(r); pattern != "" { + handler.ServeHTTP(w, r) + } else { + http.NotFound(w, r) + } +} diff --git a/supernode/transport/grpc/status/pprof_handlers.go b/supernode/transport/grpc/status/pprof_handlers.go new file mode 100644 index 00000000..4557e5f6 --- /dev/null +++ b/supernode/transport/grpc/status/pprof_handlers.go @@ -0,0 +1,223 @@ +package server + +import ( + "bytes" + "context" + "fmt" + "os" + "runtime" + "runtime/pprof" + "strings" + "time" + + pb "github.com/LumeraProtocol/supernode/v2/gen/supernode" +) + +// isPprofEnabled checks if pprof should be enabled based on chain ID or environment variable +func (s *SupernodeServer) isPprofEnabled() bool { + // Check if chain ID contains testnet + if s.statusService != nil && s.statusService.GetChainID() != "" { + if strings.Contains(strings.ToLower(s.statusService.GetChainID()), "testnet") { + return true + } + } + + // Check environment variable + return os.Getenv("ENABLE_PPROF") == "true" +} + +// GetPprofIndex returns the pprof index page +func (s *SupernodeServer) GetPprofIndex(ctx context.Context, req *pb.GetPprofIndexRequest) (*pb.GetPprofIndexResponse, error) { + if !s.isPprofEnabled() { + return &pb.GetPprofIndexResponse{ + Html: "", + Enabled: false, + }, nil + } + + // Generate a simple index page with links to available profiles + html := ` + + +Supernode Profiling + + + +

Supernode Profiling

+

Available profiles:

+ + +` + + return &pb.GetPprofIndexResponse{ + Html: html, + Enabled: true, + }, nil +} + +// GetPprofHeap returns the heap profile +func (s *SupernodeServer) GetPprofHeap(ctx context.Context, req *pb.GetPprofProfileRequest) (*pb.GetPprofProfileResponse, error) { + return s.getPprofProfile("heap", req.GetDebug()) +} + +// GetPprofGoroutine returns the goroutine profile +func (s *SupernodeServer) GetPprofGoroutine(ctx context.Context, req *pb.GetPprofProfileRequest) (*pb.GetPprofProfileResponse, error) { + return s.getPprofProfile("goroutine", req.GetDebug()) +} + +// GetPprofAllocs returns the allocations profile +func (s *SupernodeServer) GetPprofAllocs(ctx context.Context, req *pb.GetPprofProfileRequest) (*pb.GetPprofProfileResponse, error) { + return s.getPprofProfile("allocs", req.GetDebug()) +} + +// GetPprofBlock returns the block profile +func (s *SupernodeServer) GetPprofBlock(ctx context.Context, req *pb.GetPprofProfileRequest) (*pb.GetPprofProfileResponse, error) { + return s.getPprofProfile("block", req.GetDebug()) +} + +// GetPprofMutex returns the mutex profile +func (s *SupernodeServer) GetPprofMutex(ctx context.Context, req *pb.GetPprofProfileRequest) (*pb.GetPprofProfileResponse, error) { + return s.getPprofProfile("mutex", req.GetDebug()) +} + +// GetPprofThreadcreate returns the threadcreate profile +func (s *SupernodeServer) GetPprofThreadcreate(ctx context.Context, req *pb.GetPprofProfileRequest) (*pb.GetPprofProfileResponse, error) { + return s.getPprofProfile("threadcreate", req.GetDebug()) +} + +// GetPprofProfile returns the CPU profile +func (s *SupernodeServer) GetPprofProfile(ctx context.Context, req *pb.GetPprofCpuProfileRequest) (*pb.GetPprofProfileResponse, error) { + if !s.isPprofEnabled() { + return &pb.GetPprofProfileResponse{ + Enabled: false, + Error: "Profiling is disabled. Enable on testnet or set ENABLE_PPROF=true", + }, nil + } + + seconds := req.GetSeconds() + if seconds <= 0 { + seconds = 30 // Default to 30 seconds + } + if seconds > 300 { + seconds = 300 // Cap at 5 minutes + } + + var buf bytes.Buffer + if err := pprof.StartCPUProfile(&buf); err != nil { + return &pb.GetPprofProfileResponse{ + Enabled: true, + Error: fmt.Sprintf("Failed to start CPU profile: %v", err), + }, nil + } + + // Profile for the specified duration + time.Sleep(time.Duration(seconds) * time.Second) + pprof.StopCPUProfile() + + return &pb.GetPprofProfileResponse{ + Data: buf.Bytes(), + ContentType: "application/octet-stream", + Enabled: true, + }, nil +} + +// getPprofProfile is a helper function to get various runtime profiles +func (s *SupernodeServer) getPprofProfile(profileType string, debug int32) (*pb.GetPprofProfileResponse, error) { + if !s.isPprofEnabled() { + return &pb.GetPprofProfileResponse{ + Enabled: false, + Error: "Profiling is disabled. Enable on testnet or set ENABLE_PPROF=true", + }, nil + } + + var buf bytes.Buffer + var contentType string + + // Get the appropriate profile + var p *pprof.Profile + switch profileType { + case "heap": + runtime.GC() // Force GC before heap profile + p = pprof.Lookup("heap") + contentType = "application/octet-stream" + case "goroutine": + p = pprof.Lookup("goroutine") + contentType = "application/octet-stream" + case "allocs": + p = pprof.Lookup("allocs") + contentType = "application/octet-stream" + case "block": + p = pprof.Lookup("block") + contentType = "application/octet-stream" + case "mutex": + p = pprof.Lookup("mutex") + contentType = "application/octet-stream" + case "threadcreate": + p = pprof.Lookup("threadcreate") + contentType = "application/octet-stream" + default: + return &pb.GetPprofProfileResponse{ + Enabled: true, + Error: fmt.Sprintf("Unknown profile type: %s", profileType), + }, nil + } + + if p == nil { + return &pb.GetPprofProfileResponse{ + Enabled: true, + Error: fmt.Sprintf("Profile %s not found", profileType), + }, nil + } + + // Write the profile to buffer + // If debug > 0, write in text format for human reading + if debug > 0 { + if err := p.WriteTo(&buf, int(debug)); err != nil { + return &pb.GetPprofProfileResponse{ + Enabled: true, + Error: fmt.Sprintf("Failed to write profile: %v", err), + }, nil + } + contentType = "text/plain" + } else { + // Write in binary pprof format + if err := p.WriteTo(&buf, 0); err != nil { + return &pb.GetPprofProfileResponse{ + Enabled: true, + Error: fmt.Sprintf("Failed to write profile: %v", err), + }, nil + } + } + + return &pb.GetPprofProfileResponse{ + Data: buf.Bytes(), + ContentType: contentType, + Enabled: true, + }, nil +} \ No newline at end of file