实现基础的统计指标

This commit is contained in:
刘祥超
2021-06-30 20:50:17 +08:00
parent e4b59c5e85
commit 32cb66db4c
14 changed files with 1481 additions and 110 deletions

View File

@@ -147,7 +147,8 @@ type FindAllNodeClusterMetricItemsRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
NodeClusterId int64 `protobuf:"varint,1,opt,name=nodeClusterId,proto3" json:"nodeClusterId,omitempty"`
NodeClusterId int64 `protobuf:"varint,1,opt,name=nodeClusterId,proto3" json:"nodeClusterId,omitempty"`
Category string `protobuf:"bytes,2,opt,name=category,proto3" json:"category,omitempty"`
}
func (x *FindAllNodeClusterMetricItemsRequest) Reset() {
@@ -189,6 +190,13 @@ func (x *FindAllNodeClusterMetricItemsRequest) GetNodeClusterId() int64 {
return 0
}
func (x *FindAllNodeClusterMetricItemsRequest) GetCategory() string {
if x != nil {
return x.Category
}
return ""
}
type FindAllNodeClusterMetricItemsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -236,6 +244,62 @@ func (x *FindAllNodeClusterMetricItemsResponse) GetMetricItems() []*MetricItem {
return nil
}
// 检查是否已添加某个指标
type ExistsNodeClusterMetricItemRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
NodeClusterId int64 `protobuf:"varint,1,opt,name=nodeClusterId,proto3" json:"nodeClusterId,omitempty"`
MetricItemId int64 `protobuf:"varint,2,opt,name=metricItemId,proto3" json:"metricItemId,omitempty"`
}
func (x *ExistsNodeClusterMetricItemRequest) Reset() {
*x = ExistsNodeClusterMetricItemRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_node_cluster_metric_item_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExistsNodeClusterMetricItemRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExistsNodeClusterMetricItemRequest) ProtoMessage() {}
func (x *ExistsNodeClusterMetricItemRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_node_cluster_metric_item_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExistsNodeClusterMetricItemRequest.ProtoReflect.Descriptor instead.
func (*ExistsNodeClusterMetricItemRequest) Descriptor() ([]byte, []int) {
return file_service_node_cluster_metric_item_proto_rawDescGZIP(), []int{4}
}
func (x *ExistsNodeClusterMetricItemRequest) GetNodeClusterId() int64 {
if x != nil {
return x.NodeClusterId
}
return 0
}
func (x *ExistsNodeClusterMetricItemRequest) GetMetricItemId() int64 {
if x != nil {
return x.MetricItemId
}
return 0
}
var File_service_node_cluster_metric_item_proto protoreflect.FileDescriptor
var file_service_node_cluster_metric_item_proto_rawDesc = []byte{
@@ -259,39 +323,53 @@ var file_service_node_cluster_metric_item_proto_rawDesc = []byte{
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74,
0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74,
0x65, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x72,
0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x22, 0x4c, 0x0a, 0x24, 0x46, 0x69, 0x6e, 0x64,
0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x22, 0x68, 0x0a, 0x24, 0x46, 0x69, 0x6e, 0x64,
0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65,
0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75,
0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x59, 0x0a, 0x25, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c,
0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72,
0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x30, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63,
0x49, 0x74, 0x65, 0x6d, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d,
0x73, 0x32, 0xc4, 0x02, 0x0a, 0x1c, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x12, 0x55, 0x0a, 0x1b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65,
0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65,
0x6d, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64,
0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f,
0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f,
0x72, 0x79, 0x22, 0x59, 0x0a, 0x25, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64,
0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74,
0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52,
0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x57, 0x0a, 0x1c, 0x64, 0x69, 0x73,
0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d,
0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x44,
0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x12, 0x74, 0x0a, 0x1d, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64,
0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74,
0x65, 0x6d, 0x73, 0x12, 0x28, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c,
0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0b, 0x6d,
0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d,
0x52, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x6e, 0x0a,
0x22, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74,
0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74,
0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6e, 0x6f, 0x64, 0x65,
0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x65, 0x74,
0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x32, 0x9a, 0x03,
0x0a, 0x1c, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74,
0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x55,
0x0a, 0x1b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73,
0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x26, 0x2e,
0x70, 0x62, 0x2e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75,
0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75,
0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x57, 0x0a, 0x1c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65,
0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69,
0x63, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e,
0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c,
0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x63, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62,
0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74,
0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e,
0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x74,
0x0a, 0x1d, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75,
0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12,
0x28, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65,
0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65,
0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x70, 0x62, 0x2e, 0x46,
0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x1b, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4e, 0x6f,
0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49,
0x74, 0x65, 0x6d, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x4e,
0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63,
0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x70, 0x62,
0x2e, 0x52, 0x50, 0x43, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -306,25 +384,29 @@ func file_service_node_cluster_metric_item_proto_rawDescGZIP() []byte {
return file_service_node_cluster_metric_item_proto_rawDescData
}
var file_service_node_cluster_metric_item_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_service_node_cluster_metric_item_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_service_node_cluster_metric_item_proto_goTypes = []interface{}{
(*EnableNodeClusterMetricItemRequest)(nil), // 0: pb.EnableNodeClusterMetricItemRequest
(*DisableNodeClusterMetricItemRequest)(nil), // 1: pb.DisableNodeClusterMetricItemRequest
(*FindAllNodeClusterMetricItemsRequest)(nil), // 2: pb.FindAllNodeClusterMetricItemsRequest
(*FindAllNodeClusterMetricItemsResponse)(nil), // 3: pb.FindAllNodeClusterMetricItemsResponse
(*MetricItem)(nil), // 4: pb.MetricItem
(*RPCSuccess)(nil), // 5: pb.RPCSuccess
(*ExistsNodeClusterMetricItemRequest)(nil), // 4: pb.ExistsNodeClusterMetricItemRequest
(*MetricItem)(nil), // 5: pb.MetricItem
(*RPCSuccess)(nil), // 6: pb.RPCSuccess
(*RPCExists)(nil), // 7: pb.RPCExists
}
var file_service_node_cluster_metric_item_proto_depIdxs = []int32{
4, // 0: pb.FindAllNodeClusterMetricItemsResponse.metricItems:type_name -> pb.MetricItem
5, // 0: pb.FindAllNodeClusterMetricItemsResponse.metricItems:type_name -> pb.MetricItem
0, // 1: pb.NodeClusterMetricItemService.enableNodeClusterMetricItem:input_type -> pb.EnableNodeClusterMetricItemRequest
1, // 2: pb.NodeClusterMetricItemService.disableNodeClusterMetricItem:input_type -> pb.DisableNodeClusterMetricItemRequest
2, // 3: pb.NodeClusterMetricItemService.findAllNodeClusterMetricItems:input_type -> pb.FindAllNodeClusterMetricItemsRequest
5, // 4: pb.NodeClusterMetricItemService.enableNodeClusterMetricItem:output_type -> pb.RPCSuccess
5, // 5: pb.NodeClusterMetricItemService.disableNodeClusterMetricItem:output_type -> pb.RPCSuccess
3, // 6: pb.NodeClusterMetricItemService.findAllNodeClusterMetricItems:output_type -> pb.FindAllNodeClusterMetricItemsResponse
4, // [4:7] is the sub-list for method output_type
1, // [1:4] is the sub-list for method input_type
4, // 4: pb.NodeClusterMetricItemService.existsNodeClusterMetricItem:input_type -> pb.ExistsNodeClusterMetricItemRequest
6, // 5: pb.NodeClusterMetricItemService.enableNodeClusterMetricItem:output_type -> pb.RPCSuccess
6, // 6: pb.NodeClusterMetricItemService.disableNodeClusterMetricItem:output_type -> pb.RPCSuccess
3, // 7: pb.NodeClusterMetricItemService.findAllNodeClusterMetricItems:output_type -> pb.FindAllNodeClusterMetricItemsResponse
7, // 8: pb.NodeClusterMetricItemService.existsNodeClusterMetricItem:output_type -> pb.RPCExists
5, // [5:9] is the sub-list for method output_type
1, // [1:5] 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
@@ -386,6 +468,18 @@ func file_service_node_cluster_metric_item_proto_init() {
return nil
}
}
file_service_node_cluster_metric_item_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExistsNodeClusterMetricItemRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -393,7 +487,7 @@ func file_service_node_cluster_metric_item_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_node_cluster_metric_item_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
@@ -425,6 +519,8 @@ type NodeClusterMetricItemServiceClient interface {
DisableNodeClusterMetricItem(ctx context.Context, in *DisableNodeClusterMetricItemRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 查找集群中所有指标
FindAllNodeClusterMetricItems(ctx context.Context, in *FindAllNodeClusterMetricItemsRequest, opts ...grpc.CallOption) (*FindAllNodeClusterMetricItemsResponse, error)
// 检查是否已添加某个指标
ExistsNodeClusterMetricItem(ctx context.Context, in *ExistsNodeClusterMetricItemRequest, opts ...grpc.CallOption) (*RPCExists, error)
}
type nodeClusterMetricItemServiceClient struct {
@@ -462,6 +558,15 @@ func (c *nodeClusterMetricItemServiceClient) FindAllNodeClusterMetricItems(ctx c
return out, nil
}
func (c *nodeClusterMetricItemServiceClient) ExistsNodeClusterMetricItem(ctx context.Context, in *ExistsNodeClusterMetricItemRequest, opts ...grpc.CallOption) (*RPCExists, error) {
out := new(RPCExists)
err := c.cc.Invoke(ctx, "/pb.NodeClusterMetricItemService/existsNodeClusterMetricItem", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// NodeClusterMetricItemServiceServer is the server API for NodeClusterMetricItemService service.
type NodeClusterMetricItemServiceServer interface {
// 启用某个指标
@@ -470,6 +575,8 @@ type NodeClusterMetricItemServiceServer interface {
DisableNodeClusterMetricItem(context.Context, *DisableNodeClusterMetricItemRequest) (*RPCSuccess, error)
// 查找集群中所有指标
FindAllNodeClusterMetricItems(context.Context, *FindAllNodeClusterMetricItemsRequest) (*FindAllNodeClusterMetricItemsResponse, error)
// 检查是否已添加某个指标
ExistsNodeClusterMetricItem(context.Context, *ExistsNodeClusterMetricItemRequest) (*RPCExists, error)
}
// UnimplementedNodeClusterMetricItemServiceServer can be embedded to have forward compatible implementations.
@@ -485,6 +592,9 @@ func (*UnimplementedNodeClusterMetricItemServiceServer) DisableNodeClusterMetric
func (*UnimplementedNodeClusterMetricItemServiceServer) FindAllNodeClusterMetricItems(context.Context, *FindAllNodeClusterMetricItemsRequest) (*FindAllNodeClusterMetricItemsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindAllNodeClusterMetricItems not implemented")
}
func (*UnimplementedNodeClusterMetricItemServiceServer) ExistsNodeClusterMetricItem(context.Context, *ExistsNodeClusterMetricItemRequest) (*RPCExists, error) {
return nil, status.Errorf(codes.Unimplemented, "method ExistsNodeClusterMetricItem not implemented")
}
func RegisterNodeClusterMetricItemServiceServer(s *grpc.Server, srv NodeClusterMetricItemServiceServer) {
s.RegisterService(&_NodeClusterMetricItemService_serviceDesc, srv)
@@ -544,6 +654,24 @@ func _NodeClusterMetricItemService_FindAllNodeClusterMetricItems_Handler(srv int
return interceptor(ctx, in, info, handler)
}
func _NodeClusterMetricItemService_ExistsNodeClusterMetricItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ExistsNodeClusterMetricItemRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NodeClusterMetricItemServiceServer).ExistsNodeClusterMetricItem(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.NodeClusterMetricItemService/ExistsNodeClusterMetricItem",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NodeClusterMetricItemServiceServer).ExistsNodeClusterMetricItem(ctx, req.(*ExistsNodeClusterMetricItemRequest))
}
return interceptor(ctx, in, info, handler)
}
var _NodeClusterMetricItemService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.NodeClusterMetricItemService",
HandlerType: (*NodeClusterMetricItemServiceServer)(nil),
@@ -560,6 +688,10 @@ var _NodeClusterMetricItemService_serviceDesc = grpc.ServiceDesc{
MethodName: "findAllNodeClusterMetricItems",
Handler: _NodeClusterMetricItemService_FindAllNodeClusterMetricItems_Handler,
},
{
MethodName: "existsNodeClusterMetricItem",
Handler: _NodeClusterMetricItemService_ExistsNodeClusterMetricItem_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_node_cluster_metric_item.proto",