diff --git a/Makefile b/Makefile index 5d8a97b..703c315 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ genbin: mkdir -p devbin build: genproto genbin - go build -pgo=auto -o devbin/yagpcc $(LDFLAGS) ./cmd/server + go build -pgo=auto -o devbin/yagpcc $(GOFLAGS) ./cmd/server ####################### TESTS ####################### @@ -32,3 +32,8 @@ fmt: lint: golangci-lint run --timeout=10m + +version = $(shell git describe --tags --abbrev=0) +package: + sed -i 's/YAGPCC_VERSION/${version}/g' debian/changelog + dpkg-buildpackage -us -uc diff --git a/README.md b/README.md index 70a0dab..9905e1b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,11 @@ ## Building -**Prerequisites:** Go 1.25+ (see `go.mod`). +**Prerequisites:** +- Go 1.25+ (see `go.mod`). +- protoc compiler (see https://protobuf.dev/installation/ `apt install -y protobuf-compiler`) +- protoc-gen-go, use https://protobuf.dev/reference/go/go-generated/ `go install google.golang.org/protobuf/cmd/protoc-gen-go@latest` +- protoc-gen-go-grpc, use `go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest` Build the binary (generates protos and outputs to `devbin/yagpcc`): diff --git a/api/proto/agent_master/yagpcc_action_service.pb.go b/api/proto/agent_master/yagpcc_action_service.pb.go index b2a0cc5..959d64f 100644 --- a/api/proto/agent_master/yagpcc_action_service.pb.go +++ b/api/proto/agent_master/yagpcc_action_service.pb.go @@ -1,16 +1,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v6.33.4 +// protoc v3.12.4 // source: api/proto/agent_master/yagpcc_action_service.proto package greenplum import ( + empty "github.com/golang/protobuf/ptypes/empty" common "github.com/open-gpdb/yagpcc/api/proto/common" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -313,7 +313,7 @@ var file_api_proto_agent_master_yagpcc_action_service_proto_goTypes = []any{ (*TerminateSessionRequest)(nil), // 4: yagpcc.TerminateSessionRequest (*common.QueryKey)(nil), // 5: yagpcc.QueryKey (*common.SessionKey)(nil), // 6: yagpcc.SessionKey - (*emptypb.Empty)(nil), // 7: google.protobuf.Empty + (*empty.Empty)(nil), // 7: google.protobuf.Empty } var file_api_proto_agent_master_yagpcc_action_service_proto_depIdxs = []int32{ 5, // 0: yagpcc.MoveQueryToResourceGroupRequest.query_key:type_name -> yagpcc.QueryKey diff --git a/api/proto/agent_master/yagpcc_action_service_grpc.pb.go b/api/proto/agent_master/yagpcc_action_service_grpc.pb.go index 79312e8..1e7115f 100644 --- a/api/proto/agent_master/yagpcc_action_service_grpc.pb.go +++ b/api/proto/agent_master/yagpcc_action_service_grpc.pb.go @@ -1,17 +1,17 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.1 -// - protoc v6.33.4 +// - protoc v3.12.4 // source: api/proto/agent_master/yagpcc_action_service.proto package greenplum import ( context "context" + empty "github.com/golang/protobuf/ptypes/empty" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file @@ -29,7 +29,7 @@ const ( // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ActionServiceClient interface { - MoveQueryToResourceGroup(ctx context.Context, in *MoveQueryToResourceGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + MoveQueryToResourceGroup(ctx context.Context, in *MoveQueryToResourceGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error) TerminateQuery(ctx context.Context, in *TerminateQueryRequest, opts ...grpc.CallOption) (*TerminateResponse, error) TerminateSession(ctx context.Context, in *TerminateSessionRequest, opts ...grpc.CallOption) (*TerminateResponse, error) } @@ -42,9 +42,9 @@ func NewActionServiceClient(cc grpc.ClientConnInterface) ActionServiceClient { return &actionServiceClient{cc} } -func (c *actionServiceClient) MoveQueryToResourceGroup(ctx context.Context, in *MoveQueryToResourceGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *actionServiceClient) MoveQueryToResourceGroup(ctx context.Context, in *MoveQueryToResourceGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) + out := new(empty.Empty) err := c.cc.Invoke(ctx, ActionService_MoveQueryToResourceGroup_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -76,7 +76,7 @@ func (c *actionServiceClient) TerminateSession(ctx context.Context, in *Terminat // All implementations must embed UnimplementedActionServiceServer // for forward compatibility. type ActionServiceServer interface { - MoveQueryToResourceGroup(context.Context, *MoveQueryToResourceGroupRequest) (*emptypb.Empty, error) + MoveQueryToResourceGroup(context.Context, *MoveQueryToResourceGroupRequest) (*empty.Empty, error) TerminateQuery(context.Context, *TerminateQueryRequest) (*TerminateResponse, error) TerminateSession(context.Context, *TerminateSessionRequest) (*TerminateResponse, error) mustEmbedUnimplementedActionServiceServer() @@ -89,7 +89,7 @@ type ActionServiceServer interface { // pointer dereference when methods are called. type UnimplementedActionServiceServer struct{} -func (UnimplementedActionServiceServer) MoveQueryToResourceGroup(context.Context, *MoveQueryToResourceGroupRequest) (*emptypb.Empty, error) { +func (UnimplementedActionServiceServer) MoveQueryToResourceGroup(context.Context, *MoveQueryToResourceGroupRequest) (*empty.Empty, error) { return nil, status.Error(codes.Unimplemented, "method MoveQueryToResourceGroup not implemented") } func (UnimplementedActionServiceServer) TerminateQuery(context.Context, *TerminateQueryRequest) (*TerminateResponse, error) { diff --git a/api/proto/agent_master/yagpcc_get_service.pb.go b/api/proto/agent_master/yagpcc_get_service.pb.go index 7c41a90..da01308 100644 --- a/api/proto/agent_master/yagpcc_get_service.pb.go +++ b/api/proto/agent_master/yagpcc_get_service.pb.go @@ -1,16 +1,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v6.33.4 +// protoc v3.12.4 // source: api/proto/agent_master/yagpcc_get_service.proto package greenplum import ( + timestamp "github.com/golang/protobuf/ptypes/timestamp" common "github.com/open-gpdb/yagpcc/api/proto/common" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -1501,13 +1501,13 @@ type QueryStat struct { state protoimpl.MessageState `protogen:"open.v1"` ClusterId string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"` - CollectTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=collect_time,json=collectTime,proto3" json:"collect_time,omitempty"` + CollectTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=collect_time,json=collectTime,proto3" json:"collect_time,omitempty"` QueryKey *common.QueryKey `protobuf:"bytes,4,opt,name=query_key,json=queryKey,proto3" json:"query_key,omitempty"` QueryInfo *common.QueryInfo `protobuf:"bytes,5,opt,name=query_info,json=queryInfo,proto3" json:"query_info,omitempty"` StatKind StatKind `protobuf:"varint,6,opt,name=stat_kind,json=statKind,proto3,enum=yagpcc.StatKind" json:"stat_kind,omitempty"` QueryStatus common.QueryStatus `protobuf:"varint,7,opt,name=query_status,json=queryStatus,proto3,enum=yagpcc.QueryStatus" json:"query_status,omitempty"` - StartTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - EndTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + StartTime *timestamp.Timestamp `protobuf:"bytes,8,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + EndTime *timestamp.Timestamp `protobuf:"bytes,9,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` Completed bool `protobuf:"varint,10,opt,name=completed,proto3" json:"completed,omitempty"` // query completed or not TotalQueryMetrics *common.GPMetrics `protobuf:"bytes,11,opt,name=total_query_metrics,json=totalQueryMetrics,proto3" json:"total_query_metrics,omitempty"` // query metrics calculated as sum from segments AggregatedMetrics *AggregatedMetrics `protobuf:"bytes,12,opt,name=aggregated_metrics,json=aggregatedMetrics,proto3" json:"aggregated_metrics,omitempty"` // set if stat_kind == SK_AGGREGATED - for short queries @@ -1566,7 +1566,7 @@ func (x *QueryStat) GetHostname() string { return "" } -func (x *QueryStat) GetCollectTime() *timestamppb.Timestamp { +func (x *QueryStat) GetCollectTime() *timestamp.Timestamp { if x != nil { return x.CollectTime } @@ -1601,14 +1601,14 @@ func (x *QueryStat) GetQueryStatus() common.QueryStatus { return common.QueryStatus(0) } -func (x *QueryStat) GetStartTime() *timestamppb.Timestamp { +func (x *QueryStat) GetStartTime() *timestamp.Timestamp { if x != nil { return x.StartTime } return nil } -func (x *QueryStat) GetEndTime() *timestamppb.Timestamp { +func (x *QueryStat) GetEndTime() *timestamp.Timestamp { if x != nil { return x.EndTime } @@ -1961,11 +1961,11 @@ type SegmentMetrics struct { state protoimpl.MessageState `protogen:"open.v1"` ClusterId string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"` - CollectTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=collect_time,json=collectTime,proto3" json:"collect_time,omitempty"` + CollectTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=collect_time,json=collectTime,proto3" json:"collect_time,omitempty"` SegmentKey *common.SegmentKey `protobuf:"bytes,4,opt,name=segment_key,json=segmentKey,proto3" json:"segment_key,omitempty"` QueryStatus common.QueryStatus `protobuf:"varint,6,opt,name=query_status,json=queryStatus,proto3,enum=yagpcc.QueryStatus" json:"query_status,omitempty"` - StartTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - EndTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + StartTime *timestamp.Timestamp `protobuf:"bytes,7,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + EndTime *timestamp.Timestamp `protobuf:"bytes,8,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` SegmentMetrics *common.GPMetrics `protobuf:"bytes,9,opt,name=segment_metrics,json=segmentMetrics,proto3" json:"segment_metrics,omitempty"` QueryKey *common.QueryKey `protobuf:"bytes,11,opt,name=query_key,json=queryKey,proto3" json:"query_key,omitempty"` // set is used outside of TotalQueryData QueryInfo *common.QueryInfo `protobuf:"bytes,12,opt,name=query_info,json=queryInfo,proto3" json:"query_info,omitempty"` // set is used outside of TotalQueryData @@ -2017,7 +2017,7 @@ func (x *SegmentMetrics) GetHostname() string { return "" } -func (x *SegmentMetrics) GetCollectTime() *timestamppb.Timestamp { +func (x *SegmentMetrics) GetCollectTime() *timestamp.Timestamp { if x != nil { return x.CollectTime } @@ -2038,14 +2038,14 @@ func (x *SegmentMetrics) GetQueryStatus() common.QueryStatus { return common.QueryStatus(0) } -func (x *SegmentMetrics) GetStartTime() *timestamppb.Timestamp { +func (x *SegmentMetrics) GetStartTime() *timestamp.Timestamp { if x != nil { return x.StartTime } return nil } -func (x *SegmentMetrics) GetEndTime() *timestamppb.Timestamp { +func (x *SegmentMetrics) GetEndTime() *timestamp.Timestamp { if x != nil { return x.EndTime } @@ -2733,7 +2733,7 @@ var file_api_proto_agent_master_yagpcc_get_service_proto_goTypes = []any{ (*common.SessionState)(nil), // 23: yagpcc.SessionState (*common.QueryKey)(nil), // 24: yagpcc.QueryKey (*common.SessionKey)(nil), // 25: yagpcc.SessionKey - (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + (*timestamp.Timestamp)(nil), // 26: google.protobuf.Timestamp (*common.QueryInfo)(nil), // 27: yagpcc.QueryInfo (common.QueryStatus)(0), // 28: yagpcc.QueryStatus (*common.GPMetrics)(nil), // 29: yagpcc.GPMetrics diff --git a/api/proto/agent_master/yagpcc_get_service_grpc.pb.go b/api/proto/agent_master/yagpcc_get_service_grpc.pb.go index 896bd75..892c20d 100644 --- a/api/proto/agent_master/yagpcc_get_service_grpc.pb.go +++ b/api/proto/agent_master/yagpcc_get_service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.1 -// - protoc v6.33.4 +// - protoc v3.12.4 // source: api/proto/agent_master/yagpcc_get_service.proto package greenplum diff --git a/api/proto/agent_segment/yagpcc_control_service.pb.go b/api/proto/agent_segment/yagpcc_control_service.pb.go index bd0d6fd..e14871a 100644 --- a/api/proto/agent_segment/yagpcc_control_service.pb.go +++ b/api/proto/agent_segment/yagpcc_control_service.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v6.33.4 +// protoc v3.12.4 // source: api/proto/agent_segment/yagpcc_control_service.proto package greenplum import ( + timestamp "github.com/golang/protobuf/ptypes/timestamp" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -146,7 +146,7 @@ func (*GetInfoReq) Descriptor() ([]byte, []int) { type InfoRepsonse struct { state protoimpl.MessageState `protogen:"open.v1"` Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - ResetTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=reset_time,json=resetTime,proto3" json:"reset_time,omitempty"` + ResetTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=reset_time,json=resetTime,proto3" json:"reset_time,omitempty"` QueriesCount uint64 `protobuf:"varint,3,opt,name=queries_count,json=queriesCount,proto3" json:"queries_count,omitempty"` PlannodesCount uint64 `protobuf:"varint,4,opt,name=plannodes_count,json=plannodesCount,proto3" json:"plannodes_count,omitempty"` QueriesWipedOut uint64 `protobuf:"varint,5,opt,name=queries_wiped_out,json=queriesWipedOut,proto3" json:"queries_wiped_out,omitempty"` @@ -196,7 +196,7 @@ func (x *InfoRepsonse) GetVersion() string { return "" } -func (x *InfoRepsonse) GetResetTime() *timestamppb.Timestamp { +func (x *InfoRepsonse) GetResetTime() *timestamp.Timestamp { if x != nil { return x.ResetTime } @@ -368,7 +368,7 @@ var file_api_proto_agent_segment_yagpcc_control_service_proto_goTypes = []any{ (*GetInfoReq)(nil), // 2: yagpcc.GetInfoReq (*InfoRepsonse)(nil), // 3: yagpcc.InfoRepsonse (*ControlResponse)(nil), // 4: yagpcc.ControlResponse - (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp + (*timestamp.Timestamp)(nil), // 5: google.protobuf.Timestamp } var file_api_proto_agent_segment_yagpcc_control_service_proto_depIdxs = []int32{ 5, // 0: yagpcc.InfoRepsonse.reset_time:type_name -> google.protobuf.Timestamp diff --git a/api/proto/agent_segment/yagpcc_control_service_grpc.pb.go b/api/proto/agent_segment/yagpcc_control_service_grpc.pb.go index 52f4359..b6cd8e0 100644 --- a/api/proto/agent_segment/yagpcc_control_service_grpc.pb.go +++ b/api/proto/agent_segment/yagpcc_control_service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.1 -// - protoc v6.33.4 +// - protoc v3.12.4 // source: api/proto/agent_segment/yagpcc_control_service.proto package greenplum diff --git a/api/proto/agent_segment/yagpcc_get_service.pb.go b/api/proto/agent_segment/yagpcc_get_service.pb.go index 3463f73..c7a807d 100644 --- a/api/proto/agent_segment/yagpcc_get_service.pb.go +++ b/api/proto/agent_segment/yagpcc_get_service.pb.go @@ -1,16 +1,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v6.33.4 +// protoc v3.12.4 // source: api/proto/agent_segment/yagpcc_get_service.proto package greenplum import ( + timestamp "github.com/golang/protobuf/ptypes/timestamp" common "github.com/open-gpdb/yagpcc/api/proto/common" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -26,8 +26,8 @@ const ( type QueryData struct { state protoimpl.MessageState `protogen:"open.v1"` QueryStatus common.QueryStatus `protobuf:"varint,1,opt,name=query_status,json=queryStatus,proto3,enum=yagpcc.QueryStatus" json:"query_status,omitempty"` - QueryStart *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=query_start,json=queryStart,proto3" json:"query_start,omitempty"` - QueryEnd *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=query_end,json=queryEnd,proto3" json:"query_end,omitempty"` + QueryStart *timestamp.Timestamp `protobuf:"bytes,2,opt,name=query_start,json=queryStart,proto3" json:"query_start,omitempty"` + QueryEnd *timestamp.Timestamp `protobuf:"bytes,3,opt,name=query_end,json=queryEnd,proto3" json:"query_end,omitempty"` QueryKey *common.QueryKey `protobuf:"bytes,4,opt,name=query_key,json=queryKey,proto3" json:"query_key,omitempty"` SegmentKey *common.SegmentKey `protobuf:"bytes,5,opt,name=segment_key,json=segmentKey,proto3" json:"segment_key,omitempty"` QueryInfo *common.QueryInfo `protobuf:"bytes,6,opt,name=query_info,json=queryInfo,proto3" json:"query_info,omitempty"` @@ -75,14 +75,14 @@ func (x *QueryData) GetQueryStatus() common.QueryStatus { return common.QueryStatus(0) } -func (x *QueryData) GetQueryStart() *timestamppb.Timestamp { +func (x *QueryData) GetQueryStart() *timestamp.Timestamp { if x != nil { return x.QueryStart } return nil } -func (x *QueryData) GetQueryEnd() *timestamppb.Timestamp { +func (x *QueryData) GetQueryEnd() *timestamp.Timestamp { if x != nil { return x.QueryEnd } @@ -178,8 +178,8 @@ func (x *GetQueriesInfoResponse) GetQueriesData() []*QueryData { type GetQueriesInfoReq struct { state protoimpl.MessageState `protogen:"open.v1"` FilterQueries []*common.QueryKey `protobuf:"bytes,1,rep,name=filter_queries,json=filterQueries,proto3" json:"filter_queries,omitempty"` // if set show queries with specific QueryKey's - FromTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=from_time,json=fromTime,proto3" json:"from_time,omitempty"` // if set filter out entries with query start before from_time - ToTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=to_time,json=toTime,proto3" json:"to_time,omitempty"` // if set filter out entries with query end after to_time + FromTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=from_time,json=fromTime,proto3" json:"from_time,omitempty"` // if set filter out entries with query start before from_time + ToTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=to_time,json=toTime,proto3" json:"to_time,omitempty"` // if set filter out entries with query end after to_time ClearSent bool `protobuf:"varint,4,opt,name=clear_sent,json=clearSent,proto3" json:"clear_sent,omitempty"` // clear info after sent query data unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -222,14 +222,14 @@ func (x *GetQueriesInfoReq) GetFilterQueries() []*common.QueryKey { return nil } -func (x *GetQueriesInfoReq) GetFromTime() *timestamppb.Timestamp { +func (x *GetQueriesInfoReq) GetFromTime() *timestamp.Timestamp { if x != nil { return x.FromTime } return nil } -func (x *GetQueriesInfoReq) GetToTime() *timestamppb.Timestamp { +func (x *GetQueriesInfoReq) GetToTime() *timestamp.Timestamp { if x != nil { return x.ToTime } @@ -291,7 +291,7 @@ var file_api_proto_agent_segment_yagpcc_get_service_proto_goTypes = []any{ (*GetQueriesInfoResponse)(nil), // 1: yagpcc.GetQueriesInfoResponse (*GetQueriesInfoReq)(nil), // 2: yagpcc.GetQueriesInfoReq (common.QueryStatus)(0), // 3: yagpcc.QueryStatus - (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*timestamp.Timestamp)(nil), // 4: google.protobuf.Timestamp (*common.QueryKey)(nil), // 5: yagpcc.QueryKey (*common.SegmentKey)(nil), // 6: yagpcc.SegmentKey (*common.QueryInfo)(nil), // 7: yagpcc.QueryInfo diff --git a/api/proto/agent_segment/yagpcc_get_service_grpc.pb.go b/api/proto/agent_segment/yagpcc_get_service_grpc.pb.go index b2bdd75..465a7b1 100644 --- a/api/proto/agent_segment/yagpcc_get_service_grpc.pb.go +++ b/api/proto/agent_segment/yagpcc_get_service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.1 -// - protoc v6.33.4 +// - protoc v3.12.4 // source: api/proto/agent_segment/yagpcc_get_service.proto package greenplum diff --git a/api/proto/agent_segment/yagpcc_set_service.pb.go b/api/proto/agent_segment/yagpcc_set_service.pb.go index 6561df0..1f075ac 100644 --- a/api/proto/agent_segment/yagpcc_set_service.pb.go +++ b/api/proto/agent_segment/yagpcc_set_service.pb.go @@ -1,16 +1,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v6.33.4 +// protoc v3.12.4 // source: api/proto/agent_segment/yagpcc_set_service.proto package greenplum import ( + timestamp "github.com/golang/protobuf/ptypes/timestamp" common "github.com/open-gpdb/yagpcc/api/proto/common" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -127,14 +127,14 @@ func (x *MetricResponse) GetErrorText() string { type SetQueryReq struct { state protoimpl.MessageState `protogen:"open.v1"` QueryStatus common.QueryStatus `protobuf:"varint,1,opt,name=query_status,json=queryStatus,proto3,enum=yagpcc.QueryStatus" json:"query_status,omitempty"` - Datetime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=datetime,proto3" json:"datetime,omitempty"` + Datetime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=datetime,proto3" json:"datetime,omitempty"` QueryKey *common.QueryKey `protobuf:"bytes,3,opt,name=query_key,json=queryKey,proto3" json:"query_key,omitempty"` SegmentKey *common.SegmentKey `protobuf:"bytes,4,opt,name=segment_key,json=segmentKey,proto3" json:"segment_key,omitempty"` QueryInfo *common.QueryInfo `protobuf:"bytes,5,opt,name=query_info,json=queryInfo,proto3" json:"query_info,omitempty"` QueryMetrics *common.GPMetrics `protobuf:"bytes,6,opt,name=query_metrics,json=queryMetrics,proto3" json:"query_metrics,omitempty"` - SubmitTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=submit_time,json=submitTime,proto3" json:"submit_time,omitempty"` - StartTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - EndTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + SubmitTime *timestamp.Timestamp `protobuf:"bytes,8,opt,name=submit_time,json=submitTime,proto3" json:"submit_time,omitempty"` + StartTime *timestamp.Timestamp `protobuf:"bytes,9,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + EndTime *timestamp.Timestamp `protobuf:"bytes,10,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` AddInfo *common.AdditionalQueryInfo `protobuf:"bytes,11,opt,name=add_info,json=addInfo,proto3" json:"add_info,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -177,7 +177,7 @@ func (x *SetQueryReq) GetQueryStatus() common.QueryStatus { return common.QueryStatus(0) } -func (x *SetQueryReq) GetDatetime() *timestamppb.Timestamp { +func (x *SetQueryReq) GetDatetime() *timestamp.Timestamp { if x != nil { return x.Datetime } @@ -212,21 +212,21 @@ func (x *SetQueryReq) GetQueryMetrics() *common.GPMetrics { return nil } -func (x *SetQueryReq) GetSubmitTime() *timestamppb.Timestamp { +func (x *SetQueryReq) GetSubmitTime() *timestamp.Timestamp { if x != nil { return x.SubmitTime } return nil } -func (x *SetQueryReq) GetStartTime() *timestamppb.Timestamp { +func (x *SetQueryReq) GetStartTime() *timestamp.Timestamp { if x != nil { return x.StartTime } return nil } -func (x *SetQueryReq) GetEndTime() *timestamppb.Timestamp { +func (x *SetQueryReq) GetEndTime() *timestamp.Timestamp { if x != nil { return x.EndTime } @@ -292,7 +292,7 @@ var file_api_proto_agent_segment_yagpcc_set_service_proto_goTypes = []any{ (*MetricResponse)(nil), // 1: yagpcc.MetricResponse (*SetQueryReq)(nil), // 2: yagpcc.SetQueryReq (common.QueryStatus)(0), // 3: yagpcc.QueryStatus - (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*timestamp.Timestamp)(nil), // 4: google.protobuf.Timestamp (*common.QueryKey)(nil), // 5: yagpcc.QueryKey (*common.SegmentKey)(nil), // 6: yagpcc.SegmentKey (*common.QueryInfo)(nil), // 7: yagpcc.QueryInfo diff --git a/api/proto/agent_segment/yagpcc_set_service_grpc.pb.go b/api/proto/agent_segment/yagpcc_set_service_grpc.pb.go index d1e4663..c762732 100644 --- a/api/proto/agent_segment/yagpcc_set_service_grpc.pb.go +++ b/api/proto/agent_segment/yagpcc_set_service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.1 -// - protoc v6.33.4 +// - protoc v3.12.4 // source: api/proto/agent_segment/yagpcc_set_service.proto package greenplum diff --git a/api/proto/common/yagpcc_metrics.pb.go b/api/proto/common/yagpcc_metrics.pb.go index 80f8e3e..d44e896 100644 --- a/api/proto/common/yagpcc_metrics.pb.go +++ b/api/proto/common/yagpcc_metrics.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v6.33.4 +// protoc v3.12.4 // source: api/proto/common/yagpcc_metrics.proto package greenplum import ( + timestamp "github.com/golang/protobuf/ptypes/timestamp" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -173,11 +173,11 @@ type QueryInfo struct { // analyze_text: explain analyze in text format. AnalyzeText string `protobuf:"bytes,11,opt,name=analyze_text,json=analyzeText,proto3" json:"analyze_text,omitempty"` // submit time: time when query was submitted - SubmitTime *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=submit_time,json=submitTime,proto3" json:"submit_time,omitempty"` + SubmitTime *timestamp.Timestamp `protobuf:"bytes,12,opt,name=submit_time,json=submitTime,proto3" json:"submit_time,omitempty"` // start time: time when query started execution - StartTime *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + StartTime *timestamp.Timestamp `protobuf:"bytes,13,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` // end time: time when query finished - EndTime *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + EndTime *timestamp.Timestamp `protobuf:"bytes,14,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -291,21 +291,21 @@ func (x *QueryInfo) GetAnalyzeText() string { return "" } -func (x *QueryInfo) GetSubmitTime() *timestamppb.Timestamp { +func (x *QueryInfo) GetSubmitTime() *timestamp.Timestamp { if x != nil { return x.SubmitTime } return nil } -func (x *QueryInfo) GetStartTime() *timestamppb.Timestamp { +func (x *QueryInfo) GetStartTime() *timestamp.Timestamp { if x != nil { return x.StartTime } return nil } -func (x *QueryInfo) GetEndTime() *timestamppb.Timestamp { +func (x *QueryInfo) GetEndTime() *timestamp.Timestamp { if x != nil { return x.EndTime } @@ -1778,7 +1778,7 @@ var file_api_proto_common_yagpcc_metrics_proto_goTypes = []any{ (*InterconnectStat)(nil), // 10: yagpcc.InterconnectStat (*MetricInstrumentation)(nil), // 11: yagpcc.MetricInstrumentation (*SpillInfo)(nil), // 12: yagpcc.SpillInfo - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (*timestamp.Timestamp)(nil), // 13: google.protobuf.Timestamp } var file_api_proto_common_yagpcc_metrics_proto_depIdxs = []int32{ 1, // 0: yagpcc.QueryInfo.generator:type_name -> yagpcc.PlanGenerator diff --git a/api/proto/common/yagpcc_session.pb.go b/api/proto/common/yagpcc_session.pb.go index 28f1a7a..1f8b038 100644 --- a/api/proto/common/yagpcc_session.pb.go +++ b/api/proto/common/yagpcc_session.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v6.33.4 +// protoc v3.12.4 // source: api/proto/common/yagpcc_session.proto package greenplum import ( + timestamp "github.com/golang/protobuf/ptypes/timestamp" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -111,18 +111,18 @@ type SessionInfo struct { ClientPort int64 `protobuf:"varint,7,opt,name=client_port,json=clientPort,proto3" json:"client_port,omitempty"` // backend_start: time backend process was started. // Same as pg_stat_activity.backend_start. - BackendStart *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=backend_start,json=backendStart,proto3" json:"backend_start,omitempty"` + BackendStart *timestamp.Timestamp `protobuf:"bytes,8,opt,name=backend_start,json=backendStart,proto3" json:"backend_start,omitempty"` // xact_start: transaction start time. // If this field is null, it indicates that there is no transaction in progress in the session. // Same as pg_stat_activity.xact_start. - XactStart *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=xact_start,json=xactStart,proto3" json:"xact_start,omitempty"` + XactStart *timestamp.Timestamp `protobuf:"bytes,9,opt,name=xact_start,json=xactStart,proto3" json:"xact_start,omitempty"` // query_start: time query began execution. // If this field is null, it indicates that no query was executed in the session. // Same as pg_stat_activity.query_start. - QueryStart *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=query_start,json=queryStart,proto3" json:"query_start,omitempty"` + QueryStart *timestamp.Timestamp `protobuf:"bytes,10,opt,name=query_start,json=queryStart,proto3" json:"query_start,omitempty"` // state_change: time when the `state` was last changed. // Same as pg_stat_activity.state_change. - StateChange *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=state_change,json=stateChange,proto3" json:"state_change,omitempty"` + StateChange *timestamp.Timestamp `protobuf:"bytes,11,opt,name=state_change,json=stateChange,proto3" json:"state_change,omitempty"` // waiting_reason: reason the session is waiting. // The value can be: lock, replication, or resgroup. // Same as pg_stat_activity.waiting_reason. @@ -245,28 +245,28 @@ func (x *SessionInfo) GetClientPort() int64 { return 0 } -func (x *SessionInfo) GetBackendStart() *timestamppb.Timestamp { +func (x *SessionInfo) GetBackendStart() *timestamp.Timestamp { if x != nil { return x.BackendStart } return nil } -func (x *SessionInfo) GetXactStart() *timestamppb.Timestamp { +func (x *SessionInfo) GetXactStart() *timestamp.Timestamp { if x != nil { return x.XactStart } return nil } -func (x *SessionInfo) GetQueryStart() *timestamppb.Timestamp { +func (x *SessionInfo) GetQueryStart() *timestamp.Timestamp { if x != nil { return x.QueryStart } return nil } -func (x *SessionInfo) GetStateChange() *timestamppb.Timestamp { +func (x *SessionInfo) GetStateChange() *timestamp.Timestamp { if x != nil { return x.StateChange } @@ -370,7 +370,7 @@ type QueryDesc struct { // query_level: level of the query nesting. QueryLevel int64 `protobuf:"varint,4,opt,name=query_level,json=queryLevel,proto3" json:"query_level,omitempty"` // query_start: query start timestamp. - QueryStart *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=query_start,json=queryStart,proto3" json:"query_start,omitempty"` + QueryStart *timestamp.Timestamp `protobuf:"bytes,5,opt,name=query_start,json=queryStart,proto3" json:"query_start,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -433,7 +433,7 @@ func (x *QueryDesc) GetQueryLevel() int64 { return 0 } -func (x *QueryDesc) GetQueryStart() *timestamppb.Timestamp { +func (x *QueryDesc) GetQueryStart() *timestamp.Timestamp { if x != nil { return x.QueryStart } @@ -444,7 +444,7 @@ func (x *QueryDesc) GetQueryStart() *timestamppb.Timestamp { type SessionState struct { state protoimpl.MessageState `protogen:"open.v1"` // time: timestamp when statistics was collected. - Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` + Time *timestamp.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` // cluster_id: unique identifier of the cluster. ClusterId string `protobuf:"bytes,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` // hostname: host name of the master primary host. @@ -509,7 +509,7 @@ func (*SessionState) Descriptor() ([]byte, []int) { return file_api_proto_common_yagpcc_session_proto_rawDescGZIP(), []int{3} } -func (x *SessionState) GetTime() *timestamppb.Timestamp { +func (x *SessionState) GetTime() *timestamp.Timestamp { if x != nil { return x.Time } @@ -706,15 +706,15 @@ func file_api_proto_common_yagpcc_session_proto_rawDescGZIP() []byte { var file_api_proto_common_yagpcc_session_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_api_proto_common_yagpcc_session_proto_goTypes = []any{ - (*SessionKey)(nil), // 0: yagpcc.SessionKey - (*SessionInfo)(nil), // 1: yagpcc.SessionInfo - (*QueryDesc)(nil), // 2: yagpcc.QueryDesc - (*SessionState)(nil), // 3: yagpcc.SessionState - (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp - (*QueryKey)(nil), // 5: yagpcc.QueryKey - (*QueryInfo)(nil), // 6: yagpcc.QueryInfo - (QueryStatus)(0), // 7: yagpcc.QueryStatus - (*GPMetrics)(nil), // 8: yagpcc.GPMetrics + (*SessionKey)(nil), // 0: yagpcc.SessionKey + (*SessionInfo)(nil), // 1: yagpcc.SessionInfo + (*QueryDesc)(nil), // 2: yagpcc.QueryDesc + (*SessionState)(nil), // 3: yagpcc.SessionState + (*timestamp.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*QueryKey)(nil), // 5: yagpcc.QueryKey + (*QueryInfo)(nil), // 6: yagpcc.QueryInfo + (QueryStatus)(0), // 7: yagpcc.QueryStatus + (*GPMetrics)(nil), // 8: yagpcc.GPMetrics } var file_api_proto_common_yagpcc_session_proto_depIdxs = []int32{ 4, // 0: yagpcc.SessionInfo.backend_start:type_name -> google.protobuf.Timestamp diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..ff68a6d --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +yagpcc (YAGPCC_VERSION) stable; urgency=low + + * Package build + + -- Leonid Borchuk Fri, 27 Mar 2026 12:00:00 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..c28e1d3 --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: yagpcc +Section: database +Priority: optional +Maintainer: Leonid Borchuk +Build-Depends: +Standards-Version: 3.8.0 +Homepage: https://github.com/open-gpdb/yagpcc + +Package: yagpcc +Conflicts: +Architecture: any +Depends: +Description: yagpcc (Yet Another MPP Postgres Command Center) is a diagnostic and monitoring agent for Apache Cloudberry/Greenplum clusters. It collects query and session telemetry from the database (via the gp-hooks-collector extension), aggregates it across Master and Segment hosts, and exposes it over gRPC for real-time and historical use diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..f30d799 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +debian/build/* /usr/bin diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..a8fb843 --- /dev/null +++ b/debian/rules @@ -0,0 +1,14 @@ +#!/usr/bin/make -f +%: + dh $@ + +override_dh_auto_build: + make build + +override_dh_auto_test: + + +override_dh_auto_install: + mkdir -p $(PWD)/debian/build + cp $(PWD)/devbin/* $(PWD)/debian/build + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native)