36147379c3
* feat: add go protobuf generation * ci: check go protbuf generation * refactor: use 'namely/protoc-all:1.51_1' to compile the proto instead of locally binary * refactor: no need to add the 'bin/' igore * chore: modify code format * refactor: add some comments to describe our modification
95 lines
2.2 KiB
Protocol Buffer
95 lines
2.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package greptime.v1.meta;
|
|
|
|
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
|
|
|
|
import "greptime/v1/meta/common.proto";
|
|
|
|
service Heartbeat {
|
|
// Heartbeat, there may be many contents of the heartbeat, such as:
|
|
// 1. Metadata to be registered to meta server and discoverable by other nodes.
|
|
// 2. Some performance metrics, such as Load, CPU usage, etc.
|
|
// 3. The number of computing tasks being executed.
|
|
rpc Heartbeat(stream HeartbeatRequest) returns (stream HeartbeatResponse) {}
|
|
|
|
// Ask leader's endpoint.
|
|
rpc AskLeader(AskLeaderRequest) returns (AskLeaderResponse) {}
|
|
}
|
|
|
|
message HeartbeatRequest {
|
|
RequestHeader header = 1;
|
|
|
|
// Self peer
|
|
Peer peer = 2;
|
|
// Leader node
|
|
bool is_leader = 3;
|
|
// Actually reported time interval
|
|
TimeInterval report_interval = 4;
|
|
// Node stat
|
|
NodeStat node_stat = 5;
|
|
// Region stats on this node
|
|
repeated RegionStat region_stats = 6;
|
|
// Follower nodes and stats, empty on follower nodes
|
|
repeated ReplicaStat replica_stats = 7;
|
|
}
|
|
|
|
message NodeStat {
|
|
// The read capacity units during this period
|
|
int64 rcus = 1;
|
|
// The write capacity units during this period
|
|
int64 wcus = 2;
|
|
// How many tables on this node
|
|
int64 table_num = 3;
|
|
// How many regions on this node
|
|
int64 region_num = 4;
|
|
|
|
double cpu_usage = 5;
|
|
double load = 6;
|
|
// Read disk IO on this node
|
|
double read_io_rate = 7;
|
|
// Write disk IO on this node
|
|
double write_io_rate = 8;
|
|
|
|
// Others
|
|
map<string, string> attrs = 100;
|
|
}
|
|
|
|
message RegionStat {
|
|
uint64 region_id = 1;
|
|
TableName table_name = 2;
|
|
// The read capacity units during this period
|
|
int64 rcus = 3;
|
|
// The write capacity units during this period
|
|
int64 wcus = 4;
|
|
// Approximate bytes of this region
|
|
int64 approximate_bytes = 5;
|
|
// Approximate number of rows in this region
|
|
int64 approximate_rows = 6;
|
|
|
|
// Others
|
|
map<string, string> attrs = 100;
|
|
}
|
|
|
|
message ReplicaStat {
|
|
Peer peer = 1;
|
|
bool in_sync = 2;
|
|
bool is_learner = 3;
|
|
}
|
|
|
|
message HeartbeatResponse {
|
|
ResponseHeader header = 1;
|
|
|
|
repeated bytes payload = 2;
|
|
}
|
|
|
|
message AskLeaderRequest {
|
|
RequestHeader header = 1;
|
|
}
|
|
|
|
message AskLeaderResponse {
|
|
ResponseHeader header = 1;
|
|
|
|
Peer leader = 2;
|
|
}
|