实现基础的统计指标

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

@@ -0,0 +1,259 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: models/model_metric_stat.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// 统计数据
type MetricStat struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
ServerId int64 `protobuf:"varint,3,opt,name=serverId,proto3" json:"serverId,omitempty"`
ItemId int64 `protobuf:"varint,4,opt,name=itemId,proto3" json:"itemId,omitempty"`
Keys []string `protobuf:"bytes,5,rep,name=keys,proto3" json:"keys,omitempty"`
Value float32 `protobuf:"fixed32,6,opt,name=value,proto3" json:"value,omitempty"`
Time string `protobuf:"bytes,7,opt,name=time,proto3" json:"time,omitempty"`
Version int32 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty"`
NodeCluster *NodeCluster `protobuf:"bytes,30,opt,name=nodeCluster,proto3" json:"nodeCluster,omitempty"`
Node *Node `protobuf:"bytes,31,opt,name=node,proto3" json:"node,omitempty"`
Server *Server `protobuf:"bytes,32,opt,name=server,proto3" json:"server,omitempty"`
}
func (x *MetricStat) Reset() {
*x = MetricStat{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_metric_stat_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MetricStat) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MetricStat) ProtoMessage() {}
func (x *MetricStat) ProtoReflect() protoreflect.Message {
mi := &file_models_model_metric_stat_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MetricStat.ProtoReflect.Descriptor instead.
func (*MetricStat) Descriptor() ([]byte, []int) {
return file_models_model_metric_stat_proto_rawDescGZIP(), []int{0}
}
func (x *MetricStat) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *MetricStat) GetHash() string {
if x != nil {
return x.Hash
}
return ""
}
func (x *MetricStat) GetServerId() int64 {
if x != nil {
return x.ServerId
}
return 0
}
func (x *MetricStat) GetItemId() int64 {
if x != nil {
return x.ItemId
}
return 0
}
func (x *MetricStat) GetKeys() []string {
if x != nil {
return x.Keys
}
return nil
}
func (x *MetricStat) GetValue() float32 {
if x != nil {
return x.Value
}
return 0
}
func (x *MetricStat) GetTime() string {
if x != nil {
return x.Time
}
return ""
}
func (x *MetricStat) GetVersion() int32 {
if x != nil {
return x.Version
}
return 0
}
func (x *MetricStat) GetNodeCluster() *NodeCluster {
if x != nil {
return x.NodeCluster
}
return nil
}
func (x *MetricStat) GetNode() *Node {
if x != nil {
return x.Node
}
return nil
}
func (x *MetricStat) GetServer() *Server {
if x != nil {
return x.Server
}
return nil
}
var File_models_model_metric_stat_proto protoreflect.FileDescriptor
var file_models_model_metric_stat_proto_rawDesc = []byte{
0x0a, 0x1e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6d,
0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64,
0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f,
0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19,
0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb1, 0x02, 0x0a, 0x0a, 0x4d, 0x65,
0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08,
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x74, 0x65, 0x6d,
0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x64,
0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04,
0x6b, 0x65, 0x79, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20,
0x01, 0x28, 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69,
0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x18,
0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52,
0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65,
0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e,
0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x0b,
0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x04, 0x6e,
0x6f, 0x64, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e,
0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x53,
0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_metric_stat_proto_rawDescOnce sync.Once
file_models_model_metric_stat_proto_rawDescData = file_models_model_metric_stat_proto_rawDesc
)
func file_models_model_metric_stat_proto_rawDescGZIP() []byte {
file_models_model_metric_stat_proto_rawDescOnce.Do(func() {
file_models_model_metric_stat_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_metric_stat_proto_rawDescData)
})
return file_models_model_metric_stat_proto_rawDescData
}
var file_models_model_metric_stat_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_metric_stat_proto_goTypes = []interface{}{
(*MetricStat)(nil), // 0: pb.MetricStat
(*NodeCluster)(nil), // 1: pb.NodeCluster
(*Node)(nil), // 2: pb.Node
(*Server)(nil), // 3: pb.Server
}
var file_models_model_metric_stat_proto_depIdxs = []int32{
1, // 0: pb.MetricStat.nodeCluster:type_name -> pb.NodeCluster
2, // 1: pb.MetricStat.node:type_name -> pb.Node
3, // 2: pb.MetricStat.server:type_name -> pb.Server
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_models_model_metric_stat_proto_init() }
func file_models_model_metric_stat_proto_init() {
if File_models_model_metric_stat_proto != nil {
return
}
file_models_model_node_cluster_proto_init()
file_models_model_node_proto_init()
file_models_model_server_proto_init()
if !protoimpl.UnsafeEnabled {
file_models_model_metric_stat_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MetricStat); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_model_metric_stat_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_metric_stat_proto_goTypes,
DependencyIndexes: file_models_model_metric_stat_proto_depIdxs,
MessageInfos: file_models_model_metric_stat_proto_msgTypes,
}.Build()
File_models_model_metric_stat_proto = out.File
file_models_model_metric_stat_proto_rawDesc = nil
file_models_model_metric_stat_proto_goTypes = nil
file_models_model_metric_stat_proto_depIdxs = nil
}

View File

@@ -112,6 +112,54 @@ func (x *RPCCountResponse) GetCount() int64 {
return 0
}
// 是否存在
type RPCExists struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"`
}
func (x *RPCExists) Reset() {
*x = RPCExists{}
if protoimpl.UnsafeEnabled {
mi := &file_models_rpc_messages_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RPCExists) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RPCExists) ProtoMessage() {}
func (x *RPCExists) ProtoReflect() protoreflect.Message {
mi := &file_models_rpc_messages_proto_msgTypes[2]
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 RPCExists.ProtoReflect.Descriptor instead.
func (*RPCExists) Descriptor() ([]byte, []int) {
return file_models_rpc_messages_proto_rawDescGZIP(), []int{2}
}
func (x *RPCExists) GetExists() bool {
if x != nil {
return x.Exists
}
return false
}
var File_models_rpc_messages_proto protoreflect.FileDescriptor
var file_models_rpc_messages_proto_rawDesc = []byte{
@@ -120,8 +168,10 @@ var file_models_rpc_messages_proto_rawDesc = []byte{
0x0c, 0x0a, 0x0a, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x28, 0x0a,
0x10, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x23, 0x0a, 0x09, 0x52, 0x50, 0x43, 0x45, 0x78,
0x69, 0x73, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01,
0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -136,10 +186,11 @@ func file_models_rpc_messages_proto_rawDescGZIP() []byte {
return file_models_rpc_messages_proto_rawDescData
}
var file_models_rpc_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_models_rpc_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_models_rpc_messages_proto_goTypes = []interface{}{
(*RPCSuccess)(nil), // 0: pb.RPCSuccess
(*RPCCountResponse)(nil), // 1: pb.RPCCountResponse
(*RPCExists)(nil), // 2: pb.RPCExists
}
var file_models_rpc_messages_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
@@ -179,6 +230,18 @@ func file_models_rpc_messages_proto_init() {
return nil
}
}
file_models_rpc_messages_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RPCExists); 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{
@@ -186,7 +249,7 @@ func file_models_rpc_messages_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_models_rpc_messages_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},

View File

@@ -0,0 +1,557 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: service_metric_stat.proto
package pb
import (
context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// 上传统计数据
type UploadMetricStatsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
MetricStats []*MetricStat `protobuf:"bytes,1,rep,name=metricStats,proto3" json:"metricStats,omitempty"`
}
func (x *UploadMetricStatsRequest) Reset() {
*x = UploadMetricStatsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_metric_stat_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UploadMetricStatsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UploadMetricStatsRequest) ProtoMessage() {}
func (x *UploadMetricStatsRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_metric_stat_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UploadMetricStatsRequest.ProtoReflect.Descriptor instead.
func (*UploadMetricStatsRequest) Descriptor() ([]byte, []int) {
return file_service_metric_stat_proto_rawDescGZIP(), []int{0}
}
func (x *UploadMetricStatsRequest) GetMetricStats() []*MetricStat {
if x != nil {
return x.MetricStats
}
return nil
}
// 计算指标数据数量
type CountMetricStatsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
MetricItemId int64 `protobuf:"varint,1,opt,name=metricItemId,proto3" json:"metricItemId,omitempty"`
}
func (x *CountMetricStatsRequest) Reset() {
*x = CountMetricStatsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_metric_stat_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CountMetricStatsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CountMetricStatsRequest) ProtoMessage() {}
func (x *CountMetricStatsRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_metric_stat_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CountMetricStatsRequest.ProtoReflect.Descriptor instead.
func (*CountMetricStatsRequest) Descriptor() ([]byte, []int) {
return file_service_metric_stat_proto_rawDescGZIP(), []int{1}
}
func (x *CountMetricStatsRequest) GetMetricItemId() int64 {
if x != nil {
return x.MetricItemId
}
return 0
}
// 读取单页指标数据
type ListMetricStatsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
MetricItemId int64 `protobuf:"varint,1,opt,name=metricItemId,proto3" json:"metricItemId,omitempty"`
Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
}
func (x *ListMetricStatsRequest) Reset() {
*x = ListMetricStatsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_metric_stat_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListMetricStatsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListMetricStatsRequest) ProtoMessage() {}
func (x *ListMetricStatsRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_metric_stat_proto_msgTypes[2]
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 ListMetricStatsRequest.ProtoReflect.Descriptor instead.
func (*ListMetricStatsRequest) Descriptor() ([]byte, []int) {
return file_service_metric_stat_proto_rawDescGZIP(), []int{2}
}
func (x *ListMetricStatsRequest) GetMetricItemId() int64 {
if x != nil {
return x.MetricItemId
}
return 0
}
func (x *ListMetricStatsRequest) GetOffset() int64 {
if x != nil {
return x.Offset
}
return 0
}
func (x *ListMetricStatsRequest) GetSize() int64 {
if x != nil {
return x.Size
}
return 0
}
type ListMetricStatsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
MetricStats []*MetricStat `protobuf:"bytes,1,rep,name=metricStats,proto3" json:"metricStats,omitempty"`
}
func (x *ListMetricStatsResponse) Reset() {
*x = ListMetricStatsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_metric_stat_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListMetricStatsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListMetricStatsResponse) ProtoMessage() {}
func (x *ListMetricStatsResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_metric_stat_proto_msgTypes[3]
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 ListMetricStatsResponse.ProtoReflect.Descriptor instead.
func (*ListMetricStatsResponse) Descriptor() ([]byte, []int) {
return file_service_metric_stat_proto_rawDescGZIP(), []int{3}
}
func (x *ListMetricStatsResponse) GetMetricStats() []*MetricStat {
if x != nil {
return x.MetricStats
}
return nil
}
var File_service_metric_stat_proto protoreflect.FileDescriptor
var file_service_metric_stat_proto_rawDesc = []byte{
0x0a, 0x19, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63,
0x5f, 0x73, 0x74, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a,
0x1e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6d, 0x65,
0x74, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4c, 0x0a, 0x18, 0x55, 0x70,
0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63,
0x53, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62,
0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x52, 0x0b, 0x6d, 0x65, 0x74,
0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x22, 0x3d, 0x0a, 0x17, 0x43, 0x6f, 0x75, 0x6e,
0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65,
0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69,
0x63, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x22, 0x68, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4d,
0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49,
0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a,
0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a,
0x65, 0x22, 0x4b, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53,
0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0b,
0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61,
0x74, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x32, 0xe9,
0x01, 0x0a, 0x11, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x11, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65,
0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55,
0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43,
0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x45, 0x0a, 0x10, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62,
0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50,
0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a,
0x0a, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74,
0x73, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69,
0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e,
0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x74, 0x61,
0x74, 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,
}
var (
file_service_metric_stat_proto_rawDescOnce sync.Once
file_service_metric_stat_proto_rawDescData = file_service_metric_stat_proto_rawDesc
)
func file_service_metric_stat_proto_rawDescGZIP() []byte {
file_service_metric_stat_proto_rawDescOnce.Do(func() {
file_service_metric_stat_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_metric_stat_proto_rawDescData)
})
return file_service_metric_stat_proto_rawDescData
}
var file_service_metric_stat_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_service_metric_stat_proto_goTypes = []interface{}{
(*UploadMetricStatsRequest)(nil), // 0: pb.UploadMetricStatsRequest
(*CountMetricStatsRequest)(nil), // 1: pb.CountMetricStatsRequest
(*ListMetricStatsRequest)(nil), // 2: pb.ListMetricStatsRequest
(*ListMetricStatsResponse)(nil), // 3: pb.ListMetricStatsResponse
(*MetricStat)(nil), // 4: pb.MetricStat
(*RPCSuccess)(nil), // 5: pb.RPCSuccess
(*RPCCountResponse)(nil), // 6: pb.RPCCountResponse
}
var file_service_metric_stat_proto_depIdxs = []int32{
4, // 0: pb.UploadMetricStatsRequest.metricStats:type_name -> pb.MetricStat
4, // 1: pb.ListMetricStatsResponse.metricStats:type_name -> pb.MetricStat
0, // 2: pb.MetricStatService.uploadMetricStats:input_type -> pb.UploadMetricStatsRequest
1, // 3: pb.MetricStatService.countMetricStats:input_type -> pb.CountMetricStatsRequest
2, // 4: pb.MetricStatService.listMetricStats:input_type -> pb.ListMetricStatsRequest
5, // 5: pb.MetricStatService.uploadMetricStats:output_type -> pb.RPCSuccess
6, // 6: pb.MetricStatService.countMetricStats:output_type -> pb.RPCCountResponse
3, // 7: pb.MetricStatService.listMetricStats:output_type -> pb.ListMetricStatsResponse
5, // [5:8] is the sub-list for method output_type
2, // [2:5] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_service_metric_stat_proto_init() }
func file_service_metric_stat_proto_init() {
if File_service_metric_stat_proto != nil {
return
}
file_models_model_metric_stat_proto_init()
file_models_rpc_messages_proto_init()
if !protoimpl.UnsafeEnabled {
file_service_metric_stat_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UploadMetricStatsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_metric_stat_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CountMetricStatsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_metric_stat_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListMetricStatsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_metric_stat_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListMetricStatsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_metric_stat_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_service_metric_stat_proto_goTypes,
DependencyIndexes: file_service_metric_stat_proto_depIdxs,
MessageInfos: file_service_metric_stat_proto_msgTypes,
}.Build()
File_service_metric_stat_proto = out.File
file_service_metric_stat_proto_rawDesc = nil
file_service_metric_stat_proto_goTypes = nil
file_service_metric_stat_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// MetricStatServiceClient is the client API for MetricStatService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type MetricStatServiceClient interface {
// 上传统计数据
UploadMetricStats(ctx context.Context, in *UploadMetricStatsRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 计算指标数据数量
CountMetricStats(ctx context.Context, in *CountMetricStatsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error)
// 读取单页指标数据
ListMetricStats(ctx context.Context, in *ListMetricStatsRequest, opts ...grpc.CallOption) (*ListMetricStatsResponse, error)
}
type metricStatServiceClient struct {
cc grpc.ClientConnInterface
}
func NewMetricStatServiceClient(cc grpc.ClientConnInterface) MetricStatServiceClient {
return &metricStatServiceClient{cc}
}
func (c *metricStatServiceClient) UploadMetricStats(ctx context.Context, in *UploadMetricStatsRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.MetricStatService/uploadMetricStats", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *metricStatServiceClient) CountMetricStats(ctx context.Context, in *CountMetricStatsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) {
out := new(RPCCountResponse)
err := c.cc.Invoke(ctx, "/pb.MetricStatService/countMetricStats", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *metricStatServiceClient) ListMetricStats(ctx context.Context, in *ListMetricStatsRequest, opts ...grpc.CallOption) (*ListMetricStatsResponse, error) {
out := new(ListMetricStatsResponse)
err := c.cc.Invoke(ctx, "/pb.MetricStatService/listMetricStats", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// MetricStatServiceServer is the server API for MetricStatService service.
type MetricStatServiceServer interface {
// 上传统计数据
UploadMetricStats(context.Context, *UploadMetricStatsRequest) (*RPCSuccess, error)
// 计算指标数据数量
CountMetricStats(context.Context, *CountMetricStatsRequest) (*RPCCountResponse, error)
// 读取单页指标数据
ListMetricStats(context.Context, *ListMetricStatsRequest) (*ListMetricStatsResponse, error)
}
// UnimplementedMetricStatServiceServer can be embedded to have forward compatible implementations.
type UnimplementedMetricStatServiceServer struct {
}
func (*UnimplementedMetricStatServiceServer) UploadMetricStats(context.Context, *UploadMetricStatsRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UploadMetricStats not implemented")
}
func (*UnimplementedMetricStatServiceServer) CountMetricStats(context.Context, *CountMetricStatsRequest) (*RPCCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CountMetricStats not implemented")
}
func (*UnimplementedMetricStatServiceServer) ListMetricStats(context.Context, *ListMetricStatsRequest) (*ListMetricStatsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListMetricStats not implemented")
}
func RegisterMetricStatServiceServer(s *grpc.Server, srv MetricStatServiceServer) {
s.RegisterService(&_MetricStatService_serviceDesc, srv)
}
func _MetricStatService_UploadMetricStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadMetricStatsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MetricStatServiceServer).UploadMetricStats(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.MetricStatService/UploadMetricStats",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MetricStatServiceServer).UploadMetricStats(ctx, req.(*UploadMetricStatsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _MetricStatService_CountMetricStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CountMetricStatsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MetricStatServiceServer).CountMetricStats(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.MetricStatService/CountMetricStats",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MetricStatServiceServer).CountMetricStats(ctx, req.(*CountMetricStatsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _MetricStatService_ListMetricStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListMetricStatsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MetricStatServiceServer).ListMetricStats(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.MetricStatService/ListMetricStats",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MetricStatServiceServer).ListMetricStats(ctx, req.(*ListMetricStatsRequest))
}
return interceptor(ctx, in, info, handler)
}
var _MetricStatService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.MetricStatService",
HandlerType: (*MetricStatServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "uploadMetricStats",
Handler: _MetricStatService_UploadMetricStats_Handler,
},
{
MethodName: "countMetricStats",
Handler: _MetricStatService_CountMetricStats_Handler,
},
{
MethodName: "listMetricStats",
Handler: _MetricStatService_ListMetricStats_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_metric_stat.proto",
}

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",

View File

@@ -0,0 +1,24 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_node_cluster.proto";
import "models/model_node.proto";
import "models/model_server.proto";
// 统计数据
message MetricStat {
int64 id = 1;
string hash = 2;
int64 serverId = 3;
int64 itemId = 4;
repeated string keys = 5;
float value = 6;
string time = 7;
int32 version = 8;
NodeCluster nodeCluster = 30;
Node node = 31;
Server server = 32;
}

View File

@@ -12,3 +12,8 @@ message RPCSuccess {
message RPCCountResponse {
int64 count = 1;
}
// 是否存在
message RPCExists {
bool exists = 1;
}

View File

@@ -0,0 +1,39 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_metric_stat.proto";
import "models/rpc_messages.proto";
// 指标统计数据相关服务
service MetricStatService {
// 上传统计数据
rpc uploadMetricStats (UploadMetricStatsRequest) returns (RPCSuccess);
// 计算指标数据数量
rpc countMetricStats (CountMetricStatsRequest) returns (RPCCountResponse);
// 读取单页指标数据
rpc listMetricStats (ListMetricStatsRequest) returns (ListMetricStatsResponse);
}
// 上传统计数据
message UploadMetricStatsRequest {
repeated MetricStat metricStats = 1;
}
// 计算指标数据数量
message CountMetricStatsRequest {
int64 metricItemId = 1;
}
// 读取单页指标数据
message ListMetricStatsRequest {
int64 metricItemId = 1;
int64 offset = 2;
int64 size = 3;
}
message ListMetricStatsResponse {
repeated MetricStat metricStats = 1;
}

View File

@@ -16,6 +16,9 @@ service NodeClusterMetricItemService {
// 查找集群中所有指标
rpc findAllNodeClusterMetricItems (FindAllNodeClusterMetricItemsRequest) returns (FindAllNodeClusterMetricItemsResponse);
// 检查是否已添加某个指标
rpc existsNodeClusterMetricItem (ExistsNodeClusterMetricItemRequest) returns (RPCExists);
}
// 启用某个指标
@@ -33,8 +36,15 @@ message DisableNodeClusterMetricItemRequest {
// 查找集群中所有指标
message FindAllNodeClusterMetricItemsRequest {
int64 nodeClusterId = 1;
string category = 2;
}
message FindAllNodeClusterMetricItemsResponse {
repeated MetricItem metricItems = 1;
}
// 检查是否已添加某个指标
message ExistsNodeClusterMetricItemRequest {
int64 nodeClusterId = 1;
int64 metricItemId = 2;
}