mirror of https://github.com/dragonflyoss/api.git
feat: update host content in v2 (#76)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
db4e9c74e2
commit
8e4b04619f
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -176,28 +176,137 @@ message Task {
|
||||||
message Host {
|
message Host {
|
||||||
// Host id.
|
// Host id.
|
||||||
string id = 1 [(validate.rules).string.min_len = 1];
|
string id = 1 [(validate.rules).string.min_len = 1];
|
||||||
|
// Host type.
|
||||||
|
uint32 type = 2 [(validate.rules).uint32.lte = 3];
|
||||||
|
// Hostname.
|
||||||
|
string hostname = 3 [(validate.rules).string.min_len = 1];
|
||||||
// Host ip.
|
// Host ip.
|
||||||
string ip = 2 [(validate.rules).string.min_len = 1];
|
string ip = 4 [(validate.rules).string.ip = true];
|
||||||
// Peer hostname.
|
|
||||||
string hostname = 3 [(validate.rules).string.hostname = true];
|
|
||||||
// Port of grpc service.
|
// Port of grpc service.
|
||||||
int32 port = 4 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
|
int32 port = 5 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
|
||||||
// Port of download server.
|
// Port of download server.
|
||||||
int32 download_port = 5 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
|
int32 download_port = 6 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
|
||||||
// Security domain for network.
|
// Host OS.
|
||||||
string security_domain = 6 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
|
string os = 7;
|
||||||
// Host location, eg: area|country|province|city.
|
// Host platform.
|
||||||
string location = 7 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
|
string platform = 8;
|
||||||
// IDC where the peer host is located.
|
// Host platform family.
|
||||||
string idc = 8 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
|
string platform_family = 9;
|
||||||
|
// Host platform version.
|
||||||
|
string platform_version = 10;
|
||||||
|
// Host kernel version.
|
||||||
|
string kernel_version = 11;
|
||||||
|
// CPU Stat.
|
||||||
|
CPU cpu = 12 [(validate.rules).message.required = true];
|
||||||
|
// Memory Stat.
|
||||||
|
Memory memory = 13 [(validate.rules).message.required = true];
|
||||||
|
// Network Stat.
|
||||||
|
Network network = 14 [(validate.rules).message.required = true];
|
||||||
|
// Disk Stat.
|
||||||
|
Disk disk = 15 [(validate.rules).message.required = true];
|
||||||
|
// Build information.
|
||||||
|
Build build = 16 [(validate.rules).message.required = true];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Range represents download range.
|
// CPU Stat.
|
||||||
message Range {
|
message CPU {
|
||||||
// Start of range.
|
// Number of logical cores in the system.
|
||||||
int64 start = 1;
|
uint32 logical_count = 1;
|
||||||
// Length of range.
|
// Number of physical cores in the system
|
||||||
int64 length = 2;
|
uint32 physical_count = 2;
|
||||||
|
// Percent calculates the percentage of cpu used.
|
||||||
|
double percent = 3 [(validate.rules).double = {gte: 0, lte: 100}];
|
||||||
|
// Calculates the percentage of cpu used by process.
|
||||||
|
double process_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
|
||||||
|
// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
|
||||||
|
CPUTimes times = 5 [(validate.rules).message.required = true];
|
||||||
|
}
|
||||||
|
|
||||||
|
// CPUTimes contains the amounts of time the CPU has spent performing different
|
||||||
|
// kinds of work. Time units are in seconds.
|
||||||
|
message CPUTimes {
|
||||||
|
// CPU time of user.
|
||||||
|
double user = 1 [(validate.rules).double.gte = 0];
|
||||||
|
// CPU time of system.
|
||||||
|
double system = 2 [(validate.rules).double.gte = 0];
|
||||||
|
// CPU time of idle.
|
||||||
|
double idle = 3 [(validate.rules).double.gte = 0];
|
||||||
|
// CPU time of nice.
|
||||||
|
double nice = 4 [(validate.rules).double.gte = 0];
|
||||||
|
// CPU time of iowait.
|
||||||
|
double iowait = 5 [(validate.rules).double.gte = 0];
|
||||||
|
// CPU time of irq.
|
||||||
|
double irq = 6 [(validate.rules).double.gte = 0];
|
||||||
|
// CPU time of softirq.
|
||||||
|
double softirq = 7 [(validate.rules).double.gte = 0];
|
||||||
|
// CPU time of steal.
|
||||||
|
double steal = 8 [(validate.rules).double.gte = 0];
|
||||||
|
// CPU time of guest.
|
||||||
|
double guest = 9 [(validate.rules).double.gte = 0];
|
||||||
|
// CPU time of guest nice.
|
||||||
|
double guest_nice = 10 [(validate.rules).double.gte = 0];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Memory Stat.
|
||||||
|
message Memory {
|
||||||
|
// Total amount of RAM on this system.
|
||||||
|
uint64 total = 1;
|
||||||
|
// RAM available for programs to allocate.
|
||||||
|
uint64 available = 2;
|
||||||
|
// RAM used by programs.
|
||||||
|
uint64 used = 3;
|
||||||
|
// Percentage of RAM used by programs.
|
||||||
|
double used_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
|
||||||
|
// Calculates the percentage of memory used by process.
|
||||||
|
double process_used_percent = 5 [(validate.rules).double = {gte: 0, lte: 100}];
|
||||||
|
// This is the kernel's notion of free memory.
|
||||||
|
uint64 free = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Network Stat.
|
||||||
|
message Network {
|
||||||
|
// Return count of tcp connections opened and status is ESTABLISHED.
|
||||||
|
uint32 tcp_connection_count = 1;
|
||||||
|
// Return count of upload tcp connections opened and status is ESTABLISHED.
|
||||||
|
uint32 upload_tcp_connection_count = 2;
|
||||||
|
// Security domain for network.
|
||||||
|
string security_domain = 3;
|
||||||
|
// Location path(area|country|province|city|...).
|
||||||
|
string location = 4;
|
||||||
|
// IDC where the peer host is located
|
||||||
|
string idc = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disk Stat.
|
||||||
|
message Disk {
|
||||||
|
// Total amount of disk on the data path of dragonfly.
|
||||||
|
uint64 total = 1;
|
||||||
|
// Free amount of disk on the data path of dragonfly.
|
||||||
|
uint64 free = 2;
|
||||||
|
// Used amount of disk on the data path of dragonfly.
|
||||||
|
uint64 used = 3;
|
||||||
|
// Used percent of disk on the data path of dragonfly directory.
|
||||||
|
double used_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
|
||||||
|
// Total amount of indoes on the data path of dragonfly directory.
|
||||||
|
uint64 inodes_total = 5;
|
||||||
|
// Used amount of indoes on the data path of dragonfly directory.
|
||||||
|
uint64 inodes_used = 6;
|
||||||
|
// Free amount of indoes on the data path of dragonfly directory.
|
||||||
|
uint64 inodes_free = 7;
|
||||||
|
// Used percent of indoes on the data path of dragonfly directory.
|
||||||
|
double inodes_used_percent = 8 [(validate.rules).double = {gte: 0, lte: 100}];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build information.
|
||||||
|
message Build {
|
||||||
|
// Git version.
|
||||||
|
string git_version = 1;
|
||||||
|
// Git commit.
|
||||||
|
string git_commit = 2;
|
||||||
|
// Golang version.
|
||||||
|
string go_version = 3;
|
||||||
|
// Build platform.
|
||||||
|
string platform = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download information.
|
// Download information.
|
||||||
|
@ -232,6 +341,14 @@ message Download {
|
||||||
bool need_back_to_source = 14;
|
bool need_back_to_source = 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Range represents download range.
|
||||||
|
message Range {
|
||||||
|
// Start of range.
|
||||||
|
int64 start = 1;
|
||||||
|
// Length of range.
|
||||||
|
int64 length = 2;
|
||||||
|
}
|
||||||
|
|
||||||
// Piece represents information of piece.
|
// Piece represents information of piece.
|
||||||
message Piece {
|
message Piece {
|
||||||
// Piece number.
|
// Piece number.
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -178,139 +178,8 @@ message StatTaskRequest {
|
||||||
|
|
||||||
// AnnounceHostRequest represents request of AnnounceHost.
|
// AnnounceHostRequest represents request of AnnounceHost.
|
||||||
message AnnounceHostRequest {
|
message AnnounceHostRequest {
|
||||||
// Host id.
|
// Host info.
|
||||||
string id = 1 [(validate.rules).string.min_len = 1];
|
common.v2.Host host = 1 [(validate.rules).message.required = true];
|
||||||
// Host type.
|
|
||||||
uint32 type = 2 [(validate.rules).uint32.lte = 3];
|
|
||||||
// Hostname.
|
|
||||||
string hostname = 3 [(validate.rules).string.min_len = 1];
|
|
||||||
// Host ip.
|
|
||||||
string ip = 4 [(validate.rules).string.ip = true];
|
|
||||||
// Port of grpc service.
|
|
||||||
int32 port = 5 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
|
|
||||||
// Port of download server.
|
|
||||||
int32 download_port = 6 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
|
|
||||||
// Host OS.
|
|
||||||
string os = 7;
|
|
||||||
// Host platform.
|
|
||||||
string platform = 8;
|
|
||||||
// Host platform family.
|
|
||||||
string platform_family = 9;
|
|
||||||
// Host platform version.
|
|
||||||
string platform_version = 10;
|
|
||||||
// Host kernel version.
|
|
||||||
string kernel_version = 11;
|
|
||||||
// CPU Stat.
|
|
||||||
CPU cpu = 12 [(validate.rules).message.required = true];
|
|
||||||
// Memory Stat.
|
|
||||||
Memory memory = 13 [(validate.rules).message.required = true];
|
|
||||||
// Network Stat.
|
|
||||||
Network network = 14 [(validate.rules).message.required = true];
|
|
||||||
// Disk Stat.
|
|
||||||
Disk disk = 15 [(validate.rules).message.required = true];
|
|
||||||
// Build information.
|
|
||||||
Build build = 16 [(validate.rules).message.required = true];
|
|
||||||
}
|
|
||||||
|
|
||||||
// CPU Stat.
|
|
||||||
message CPU {
|
|
||||||
// Number of logical cores in the system.
|
|
||||||
uint32 logical_count = 1;
|
|
||||||
// Number of physical cores in the system
|
|
||||||
uint32 physical_count = 2;
|
|
||||||
// Percent calculates the percentage of cpu used.
|
|
||||||
double percent = 3 [(validate.rules).double = {gte: 0, lte: 100}];
|
|
||||||
// Calculates the percentage of cpu used by process.
|
|
||||||
double process_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
|
|
||||||
// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
|
|
||||||
CPUTimes times = 5 [(validate.rules).message.required = true];
|
|
||||||
}
|
|
||||||
|
|
||||||
// CPUTimes contains the amounts of time the CPU has spent performing different
|
|
||||||
// kinds of work. Time units are in seconds.
|
|
||||||
message CPUTimes {
|
|
||||||
// CPU time of user.
|
|
||||||
double user = 1 [(validate.rules).double.gte = 0];
|
|
||||||
// CPU time of system.
|
|
||||||
double system = 2 [(validate.rules).double.gte = 0];
|
|
||||||
// CPU time of idle.
|
|
||||||
double idle = 3 [(validate.rules).double.gte = 0];
|
|
||||||
// CPU time of nice.
|
|
||||||
double nice = 4 [(validate.rules).double.gte = 0];
|
|
||||||
// CPU time of iowait.
|
|
||||||
double iowait = 5 [(validate.rules).double.gte = 0];
|
|
||||||
// CPU time of irq.
|
|
||||||
double irq = 6 [(validate.rules).double.gte = 0];
|
|
||||||
// CPU time of softirq.
|
|
||||||
double softirq = 7 [(validate.rules).double.gte = 0];
|
|
||||||
// CPU time of steal.
|
|
||||||
double steal = 8 [(validate.rules).double.gte = 0];
|
|
||||||
// CPU time of guest.
|
|
||||||
double guest = 9 [(validate.rules).double.gte = 0];
|
|
||||||
// CPU time of guest nice.
|
|
||||||
double guest_nice = 10 [(validate.rules).double.gte = 0];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Memory Stat.
|
|
||||||
message Memory {
|
|
||||||
// Total amount of RAM on this system.
|
|
||||||
uint64 total = 1;
|
|
||||||
// RAM available for programs to allocate.
|
|
||||||
uint64 available = 2;
|
|
||||||
// RAM used by programs.
|
|
||||||
uint64 used = 3;
|
|
||||||
// Percentage of RAM used by programs.
|
|
||||||
double used_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
|
|
||||||
// Calculates the percentage of memory used by process.
|
|
||||||
double process_used_percent = 5 [(validate.rules).double = {gte: 0, lte: 100}];
|
|
||||||
// This is the kernel's notion of free memory.
|
|
||||||
uint64 free = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Network Stat.
|
|
||||||
message Network {
|
|
||||||
// Return count of tcp connections opened and status is ESTABLISHED.
|
|
||||||
uint32 tcp_connection_count = 1;
|
|
||||||
// Return count of upload tcp connections opened and status is ESTABLISHED.
|
|
||||||
uint32 upload_tcp_connection_count = 2;
|
|
||||||
// Security domain for network.
|
|
||||||
string security_domain = 3;
|
|
||||||
// Location path(area|country|province|city|...).
|
|
||||||
string location = 4;
|
|
||||||
// IDC where the peer host is located
|
|
||||||
string idc = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disk Stat.
|
|
||||||
message Disk {
|
|
||||||
// Total amount of disk on the data path of dragonfly.
|
|
||||||
uint64 total = 1;
|
|
||||||
// Free amount of disk on the data path of dragonfly.
|
|
||||||
uint64 free = 2;
|
|
||||||
// Used amount of disk on the data path of dragonfly.
|
|
||||||
uint64 used = 3;
|
|
||||||
// Used percent of disk on the data path of dragonfly directory.
|
|
||||||
double used_percent = 4 [(validate.rules).double = {gte: 0, lte: 100}];
|
|
||||||
// Total amount of indoes on the data path of dragonfly directory.
|
|
||||||
uint64 inodes_total = 5;
|
|
||||||
// Used amount of indoes on the data path of dragonfly directory.
|
|
||||||
uint64 inodes_used = 6;
|
|
||||||
// Free amount of indoes on the data path of dragonfly directory.
|
|
||||||
uint64 inodes_free = 7;
|
|
||||||
// Used percent of indoes on the data path of dragonfly directory.
|
|
||||||
double inodes_used_percent = 8 [(validate.rules).double = {gte: 0, lte: 100}];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build information.
|
|
||||||
message Build {
|
|
||||||
// Git version.
|
|
||||||
string git_version = 1;
|
|
||||||
// Git commit.
|
|
||||||
string git_commit = 2;
|
|
||||||
// Golang version.
|
|
||||||
string go_version = 3;
|
|
||||||
// Build platform.
|
|
||||||
string platform = 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LeaveHostRequest represents request of LeaveHost.
|
// LeaveHostRequest represents request of LeaveHost.
|
||||||
|
|
|
@ -170,28 +170,137 @@ message Task {
|
||||||
message Host {
|
message Host {
|
||||||
// Host id.
|
// Host id.
|
||||||
string id = 1;
|
string id = 1;
|
||||||
// Host ip.
|
// Host type.
|
||||||
string ip = 2;
|
uint32 type = 2;
|
||||||
// Peer hostname.
|
// Hostname.
|
||||||
string hostname = 3;
|
string hostname = 3;
|
||||||
|
// Host ip.
|
||||||
|
string ip = 4;
|
||||||
// Port of grpc service.
|
// Port of grpc service.
|
||||||
int32 port = 4;
|
int32 port = 5;
|
||||||
// Port of download server.
|
// Port of download server.
|
||||||
int32 download_port = 5;
|
int32 download_port = 6;
|
||||||
// Security domain for network.
|
// Host OS.
|
||||||
string security_domain = 6;
|
string os = 7;
|
||||||
// Host location, eg: area|country|province|city.
|
// Host platform.
|
||||||
string location = 7;
|
string platform = 8;
|
||||||
// IDC where the peer host is located.
|
// Host platform family.
|
||||||
string idc = 8;
|
string platform_family = 9;
|
||||||
|
// Host platform version.
|
||||||
|
string platform_version = 10;
|
||||||
|
// Host kernel version.
|
||||||
|
string kernel_version = 11;
|
||||||
|
// CPU Stat.
|
||||||
|
CPU cpu = 12;
|
||||||
|
// Memory Stat.
|
||||||
|
Memory memory = 13;
|
||||||
|
// Network Stat.
|
||||||
|
Network network = 14;
|
||||||
|
// Disk Stat.
|
||||||
|
Disk disk = 15;
|
||||||
|
// Build information.
|
||||||
|
Build build = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Range represents download range.
|
// CPU Stat.
|
||||||
message Range {
|
message CPU {
|
||||||
// Start of range.
|
// Number of logical cores in the system.
|
||||||
int64 start = 1;
|
uint32 logical_count = 1;
|
||||||
// Length of range.
|
// Number of physical cores in the system
|
||||||
int64 length = 2;
|
uint32 physical_count = 2;
|
||||||
|
// Percent calculates the percentage of cpu used.
|
||||||
|
double percent = 3;
|
||||||
|
// Calculates the percentage of cpu used by process.
|
||||||
|
double process_percent = 4;
|
||||||
|
// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
|
||||||
|
CPUTimes times = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// CPUTimes contains the amounts of time the CPU has spent performing different
|
||||||
|
// kinds of work. Time units are in seconds.
|
||||||
|
message CPUTimes {
|
||||||
|
// CPU time of user.
|
||||||
|
double user = 1;
|
||||||
|
// CPU time of system.
|
||||||
|
double system = 2;
|
||||||
|
// CPU time of idle.
|
||||||
|
double idle = 3;
|
||||||
|
// CPU time of nice.
|
||||||
|
double nice = 4;
|
||||||
|
// CPU time of iowait.
|
||||||
|
double iowait = 5;
|
||||||
|
// CPU time of irq.
|
||||||
|
double irq = 6;
|
||||||
|
// CPU time of softirq.
|
||||||
|
double softirq = 7;
|
||||||
|
// CPU time of steal.
|
||||||
|
double steal = 8;
|
||||||
|
// CPU time of guest.
|
||||||
|
double guest = 9;
|
||||||
|
// CPU time of guest nice.
|
||||||
|
double guest_nice = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Memory Stat.
|
||||||
|
message Memory {
|
||||||
|
// Total amount of RAM on this system.
|
||||||
|
uint64 total = 1;
|
||||||
|
// RAM available for programs to allocate.
|
||||||
|
uint64 available = 2;
|
||||||
|
// RAM used by programs.
|
||||||
|
uint64 used = 3;
|
||||||
|
// Percentage of RAM used by programs.
|
||||||
|
double used_percent = 4;
|
||||||
|
// Calculates the percentage of memory used by process.
|
||||||
|
double process_used_percent = 5;
|
||||||
|
// This is the kernel's notion of free memory.
|
||||||
|
uint64 free = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Network Stat.
|
||||||
|
message Network {
|
||||||
|
// Return count of tcp connections opened and status is ESTABLISHED.
|
||||||
|
uint32 tcp_connection_count = 1;
|
||||||
|
// Return count of upload tcp connections opened and status is ESTABLISHED.
|
||||||
|
uint32 upload_tcp_connection_count = 2;
|
||||||
|
// Security domain for network.
|
||||||
|
string security_domain = 3;
|
||||||
|
// Location path(area|country|province|city|...).
|
||||||
|
string location = 4;
|
||||||
|
// IDC where the peer host is located
|
||||||
|
string idc = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disk Stat.
|
||||||
|
message Disk {
|
||||||
|
// Total amount of disk on the data path of dragonfly.
|
||||||
|
uint64 total = 1;
|
||||||
|
// Free amount of disk on the data path of dragonfly.
|
||||||
|
uint64 free = 2;
|
||||||
|
// Used amount of disk on the data path of dragonfly.
|
||||||
|
uint64 used = 3;
|
||||||
|
// Used percent of disk on the data path of dragonfly directory.
|
||||||
|
double used_percent = 4;
|
||||||
|
// Total amount of indoes on the data path of dragonfly directory.
|
||||||
|
uint64 inodes_total = 5;
|
||||||
|
// Used amount of indoes on the data path of dragonfly directory.
|
||||||
|
uint64 inodes_used = 6;
|
||||||
|
// Free amount of indoes on the data path of dragonfly directory.
|
||||||
|
uint64 inodes_free = 7;
|
||||||
|
// Used percent of indoes on the data path of dragonfly directory.
|
||||||
|
double inodes_used_percent = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build information.
|
||||||
|
message Build {
|
||||||
|
// Git version.
|
||||||
|
string git_version = 1;
|
||||||
|
// Git commit.
|
||||||
|
string git_commit = 2;
|
||||||
|
// Golang version.
|
||||||
|
string go_version = 3;
|
||||||
|
// Build platform.
|
||||||
|
string platform = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download information.
|
// Download information.
|
||||||
|
@ -226,6 +335,14 @@ message Download {
|
||||||
bool need_back_to_source = 14;
|
bool need_back_to_source = 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Range represents download range.
|
||||||
|
message Range {
|
||||||
|
// Start of range.
|
||||||
|
int64 start = 1;
|
||||||
|
// Length of range.
|
||||||
|
int64 length = 2;
|
||||||
|
}
|
||||||
|
|
||||||
// Piece represents information of piece.
|
// Piece represents information of piece.
|
||||||
message Piece {
|
message Piece {
|
||||||
// Piece number.
|
// Piece number.
|
||||||
|
|
|
@ -171,139 +171,7 @@ message StatTaskRequest {
|
||||||
|
|
||||||
// AnnounceHostRequest represents request of AnnounceHost.
|
// AnnounceHostRequest represents request of AnnounceHost.
|
||||||
message AnnounceHostRequest {
|
message AnnounceHostRequest {
|
||||||
// Host id.
|
common.Host host = 1;
|
||||||
string id = 1;
|
|
||||||
// Host type.
|
|
||||||
uint32 type = 2;
|
|
||||||
// Hostname.
|
|
||||||
string hostname = 3;
|
|
||||||
// Host ip.
|
|
||||||
string ip = 4;
|
|
||||||
// Port of grpc service.
|
|
||||||
int32 port = 5;
|
|
||||||
// Port of download server.
|
|
||||||
int32 download_port = 6;
|
|
||||||
// Host OS.
|
|
||||||
string os = 7;
|
|
||||||
// Host platform.
|
|
||||||
string platform = 8;
|
|
||||||
// Host platform family.
|
|
||||||
string platform_family = 9;
|
|
||||||
// Host platform version.
|
|
||||||
string platform_version = 10;
|
|
||||||
// Host kernel version.
|
|
||||||
string kernel_version = 11;
|
|
||||||
// CPU Stat.
|
|
||||||
CPU cpu = 12;
|
|
||||||
// Memory Stat.
|
|
||||||
Memory memory = 13;
|
|
||||||
// Network Stat.
|
|
||||||
Network network = 14;
|
|
||||||
// Disk Stat.
|
|
||||||
Disk disk = 15;
|
|
||||||
// Build information.
|
|
||||||
Build build = 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
// CPU Stat.
|
|
||||||
message CPU {
|
|
||||||
// Number of logical cores in the system.
|
|
||||||
uint32 logical_count = 1;
|
|
||||||
// Number of physical cores in the system
|
|
||||||
uint32 physical_count = 2;
|
|
||||||
// Percent calculates the percentage of cpu used.
|
|
||||||
double percent = 3;
|
|
||||||
// Calculates the percentage of cpu used by process.
|
|
||||||
double process_percent = 4;
|
|
||||||
// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
|
|
||||||
CPUTimes times = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
// CPUTimes contains the amounts of time the CPU has spent performing different
|
|
||||||
// kinds of work. Time units are in seconds.
|
|
||||||
message CPUTimes {
|
|
||||||
// CPU time of user.
|
|
||||||
double user = 1;
|
|
||||||
// CPU time of system.
|
|
||||||
double system = 2;
|
|
||||||
// CPU time of idle.
|
|
||||||
double idle = 3;
|
|
||||||
// CPU time of nice.
|
|
||||||
double nice = 4;
|
|
||||||
// CPU time of iowait.
|
|
||||||
double iowait = 5;
|
|
||||||
// CPU time of irq.
|
|
||||||
double irq = 6;
|
|
||||||
// CPU time of softirq.
|
|
||||||
double softirq = 7;
|
|
||||||
// CPU time of steal.
|
|
||||||
double steal = 8;
|
|
||||||
// CPU time of guest.
|
|
||||||
double guest = 9;
|
|
||||||
// CPU time of guest nice.
|
|
||||||
double guest_nice = 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Memory Stat.
|
|
||||||
message Memory {
|
|
||||||
// Total amount of RAM on this system.
|
|
||||||
uint64 total = 1;
|
|
||||||
// RAM available for programs to allocate.
|
|
||||||
uint64 available = 2;
|
|
||||||
// RAM used by programs.
|
|
||||||
uint64 used = 3;
|
|
||||||
// Percentage of RAM used by programs.
|
|
||||||
double used_percent = 4;
|
|
||||||
// Calculates the percentage of memory used by process.
|
|
||||||
double process_used_percent = 5;
|
|
||||||
// This is the kernel's notion of free memory.
|
|
||||||
uint64 free = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Network Stat.
|
|
||||||
message Network {
|
|
||||||
// Return count of tcp connections opened and status is ESTABLISHED.
|
|
||||||
uint32 tcp_connection_count = 1;
|
|
||||||
// Return count of upload tcp connections opened and status is ESTABLISHED.
|
|
||||||
uint32 upload_tcp_connection_count = 2;
|
|
||||||
// Security domain for network.
|
|
||||||
string security_domain = 3;
|
|
||||||
// Location path(area|country|province|city|...).
|
|
||||||
string location = 4;
|
|
||||||
// IDC where the peer host is located
|
|
||||||
string idc = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disk Stat.
|
|
||||||
message Disk {
|
|
||||||
// Total amount of disk on the data path of dragonfly.
|
|
||||||
uint64 total = 1;
|
|
||||||
// Free amount of disk on the data path of dragonfly.
|
|
||||||
uint64 free = 2;
|
|
||||||
// Used amount of disk on the data path of dragonfly.
|
|
||||||
uint64 used = 3;
|
|
||||||
// Used percent of disk on the data path of dragonfly directory.
|
|
||||||
double used_percent = 4;
|
|
||||||
// Total amount of indoes on the data path of dragonfly directory.
|
|
||||||
uint64 inodes_total = 5;
|
|
||||||
// Used amount of indoes on the data path of dragonfly directory.
|
|
||||||
uint64 inodes_used = 6;
|
|
||||||
// Free amount of indoes on the data path of dragonfly directory.
|
|
||||||
uint64 inodes_free = 7;
|
|
||||||
// Used percent of indoes on the data path of dragonfly directory.
|
|
||||||
double inodes_used_percent = 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build information.
|
|
||||||
message Build {
|
|
||||||
// Git version.
|
|
||||||
string git_version = 1;
|
|
||||||
// Git commit.
|
|
||||||
string git_commit = 2;
|
|
||||||
// Golang version.
|
|
||||||
string go_version = 3;
|
|
||||||
// Build platform.
|
|
||||||
string platform = 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LeaveHostRequest represents request of LeaveHost.
|
// LeaveHostRequest represents request of LeaveHost.
|
||||||
|
|
211
src/common.rs
211
src/common.rs
|
@ -105,38 +105,196 @@ pub struct Host {
|
||||||
/// Host id.
|
/// Host id.
|
||||||
#[prost(string, tag = "1")]
|
#[prost(string, tag = "1")]
|
||||||
pub id: ::prost::alloc::string::String,
|
pub id: ::prost::alloc::string::String,
|
||||||
/// Host ip.
|
/// Host type.
|
||||||
#[prost(string, tag = "2")]
|
#[prost(uint32, tag = "2")]
|
||||||
pub ip: ::prost::alloc::string::String,
|
pub r#type: u32,
|
||||||
/// Peer hostname.
|
/// Hostname.
|
||||||
#[prost(string, tag = "3")]
|
#[prost(string, tag = "3")]
|
||||||
pub hostname: ::prost::alloc::string::String,
|
pub hostname: ::prost::alloc::string::String,
|
||||||
|
/// Host ip.
|
||||||
|
#[prost(string, tag = "4")]
|
||||||
|
pub ip: ::prost::alloc::string::String,
|
||||||
/// Port of grpc service.
|
/// Port of grpc service.
|
||||||
#[prost(int32, tag = "4")]
|
#[prost(int32, tag = "5")]
|
||||||
pub port: i32,
|
pub port: i32,
|
||||||
/// Port of download server.
|
/// Port of download server.
|
||||||
#[prost(int32, tag = "5")]
|
#[prost(int32, tag = "6")]
|
||||||
pub download_port: i32,
|
pub download_port: i32,
|
||||||
/// Security domain for network.
|
/// Host OS.
|
||||||
#[prost(string, tag = "6")]
|
|
||||||
pub security_domain: ::prost::alloc::string::String,
|
|
||||||
/// Host location, eg: area|country|province|city.
|
|
||||||
#[prost(string, tag = "7")]
|
#[prost(string, tag = "7")]
|
||||||
pub location: ::prost::alloc::string::String,
|
pub os: ::prost::alloc::string::String,
|
||||||
/// IDC where the peer host is located.
|
/// Host platform.
|
||||||
#[prost(string, tag = "8")]
|
#[prost(string, tag = "8")]
|
||||||
pub idc: ::prost::alloc::string::String,
|
pub platform: ::prost::alloc::string::String,
|
||||||
|
/// Host platform family.
|
||||||
|
#[prost(string, tag = "9")]
|
||||||
|
pub platform_family: ::prost::alloc::string::String,
|
||||||
|
/// Host platform version.
|
||||||
|
#[prost(string, tag = "10")]
|
||||||
|
pub platform_version: ::prost::alloc::string::String,
|
||||||
|
/// Host kernel version.
|
||||||
|
#[prost(string, tag = "11")]
|
||||||
|
pub kernel_version: ::prost::alloc::string::String,
|
||||||
|
/// CPU Stat.
|
||||||
|
#[prost(message, optional, tag = "12")]
|
||||||
|
pub cpu: ::core::option::Option<Cpu>,
|
||||||
|
/// Memory Stat.
|
||||||
|
#[prost(message, optional, tag = "13")]
|
||||||
|
pub memory: ::core::option::Option<Memory>,
|
||||||
|
/// Network Stat.
|
||||||
|
#[prost(message, optional, tag = "14")]
|
||||||
|
pub network: ::core::option::Option<Network>,
|
||||||
|
/// Disk Stat.
|
||||||
|
#[prost(message, optional, tag = "15")]
|
||||||
|
pub disk: ::core::option::Option<Disk>,
|
||||||
|
/// Build information.
|
||||||
|
#[prost(message, optional, tag = "16")]
|
||||||
|
pub build: ::core::option::Option<Build>,
|
||||||
}
|
}
|
||||||
/// Range represents download range.
|
/// CPU Stat.
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
pub struct Range {
|
pub struct Cpu {
|
||||||
/// Start of range.
|
/// Number of logical cores in the system.
|
||||||
#[prost(int64, tag = "1")]
|
#[prost(uint32, tag = "1")]
|
||||||
pub start: i64,
|
pub logical_count: u32,
|
||||||
/// Length of range.
|
/// Number of physical cores in the system
|
||||||
#[prost(int64, tag = "2")]
|
#[prost(uint32, tag = "2")]
|
||||||
pub length: i64,
|
pub physical_count: u32,
|
||||||
|
/// Percent calculates the percentage of cpu used.
|
||||||
|
#[prost(double, tag = "3")]
|
||||||
|
pub percent: f64,
|
||||||
|
/// Calculates the percentage of cpu used by process.
|
||||||
|
#[prost(double, tag = "4")]
|
||||||
|
pub process_percent: f64,
|
||||||
|
/// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
|
||||||
|
#[prost(message, optional, tag = "5")]
|
||||||
|
pub times: ::core::option::Option<CpuTimes>,
|
||||||
|
}
|
||||||
|
/// CPUTimes contains the amounts of time the CPU has spent performing different
|
||||||
|
/// kinds of work. Time units are in seconds.
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct CpuTimes {
|
||||||
|
/// CPU time of user.
|
||||||
|
#[prost(double, tag = "1")]
|
||||||
|
pub user: f64,
|
||||||
|
/// CPU time of system.
|
||||||
|
#[prost(double, tag = "2")]
|
||||||
|
pub system: f64,
|
||||||
|
/// CPU time of idle.
|
||||||
|
#[prost(double, tag = "3")]
|
||||||
|
pub idle: f64,
|
||||||
|
/// CPU time of nice.
|
||||||
|
#[prost(double, tag = "4")]
|
||||||
|
pub nice: f64,
|
||||||
|
/// CPU time of iowait.
|
||||||
|
#[prost(double, tag = "5")]
|
||||||
|
pub iowait: f64,
|
||||||
|
/// CPU time of irq.
|
||||||
|
#[prost(double, tag = "6")]
|
||||||
|
pub irq: f64,
|
||||||
|
/// CPU time of softirq.
|
||||||
|
#[prost(double, tag = "7")]
|
||||||
|
pub softirq: f64,
|
||||||
|
/// CPU time of steal.
|
||||||
|
#[prost(double, tag = "8")]
|
||||||
|
pub steal: f64,
|
||||||
|
/// CPU time of guest.
|
||||||
|
#[prost(double, tag = "9")]
|
||||||
|
pub guest: f64,
|
||||||
|
/// CPU time of guest nice.
|
||||||
|
#[prost(double, tag = "10")]
|
||||||
|
pub guest_nice: f64,
|
||||||
|
}
|
||||||
|
/// Memory Stat.
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct Memory {
|
||||||
|
/// Total amount of RAM on this system.
|
||||||
|
#[prost(uint64, tag = "1")]
|
||||||
|
pub total: u64,
|
||||||
|
/// RAM available for programs to allocate.
|
||||||
|
#[prost(uint64, tag = "2")]
|
||||||
|
pub available: u64,
|
||||||
|
/// RAM used by programs.
|
||||||
|
#[prost(uint64, tag = "3")]
|
||||||
|
pub used: u64,
|
||||||
|
/// Percentage of RAM used by programs.
|
||||||
|
#[prost(double, tag = "4")]
|
||||||
|
pub used_percent: f64,
|
||||||
|
/// Calculates the percentage of memory used by process.
|
||||||
|
#[prost(double, tag = "5")]
|
||||||
|
pub process_used_percent: f64,
|
||||||
|
/// This is the kernel's notion of free memory.
|
||||||
|
#[prost(uint64, tag = "6")]
|
||||||
|
pub free: u64,
|
||||||
|
}
|
||||||
|
/// Network Stat.
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct Network {
|
||||||
|
/// Return count of tcp connections opened and status is ESTABLISHED.
|
||||||
|
#[prost(uint32, tag = "1")]
|
||||||
|
pub tcp_connection_count: u32,
|
||||||
|
/// Return count of upload tcp connections opened and status is ESTABLISHED.
|
||||||
|
#[prost(uint32, tag = "2")]
|
||||||
|
pub upload_tcp_connection_count: u32,
|
||||||
|
/// Security domain for network.
|
||||||
|
#[prost(string, tag = "3")]
|
||||||
|
pub security_domain: ::prost::alloc::string::String,
|
||||||
|
/// Location path(area|country|province|city|...).
|
||||||
|
#[prost(string, tag = "4")]
|
||||||
|
pub location: ::prost::alloc::string::String,
|
||||||
|
/// IDC where the peer host is located
|
||||||
|
#[prost(string, tag = "5")]
|
||||||
|
pub idc: ::prost::alloc::string::String,
|
||||||
|
}
|
||||||
|
/// Disk Stat.
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct Disk {
|
||||||
|
/// Total amount of disk on the data path of dragonfly.
|
||||||
|
#[prost(uint64, tag = "1")]
|
||||||
|
pub total: u64,
|
||||||
|
/// Free amount of disk on the data path of dragonfly.
|
||||||
|
#[prost(uint64, tag = "2")]
|
||||||
|
pub free: u64,
|
||||||
|
/// Used amount of disk on the data path of dragonfly.
|
||||||
|
#[prost(uint64, tag = "3")]
|
||||||
|
pub used: u64,
|
||||||
|
/// Used percent of disk on the data path of dragonfly directory.
|
||||||
|
#[prost(double, tag = "4")]
|
||||||
|
pub used_percent: f64,
|
||||||
|
/// Total amount of indoes on the data path of dragonfly directory.
|
||||||
|
#[prost(uint64, tag = "5")]
|
||||||
|
pub inodes_total: u64,
|
||||||
|
/// Used amount of indoes on the data path of dragonfly directory.
|
||||||
|
#[prost(uint64, tag = "6")]
|
||||||
|
pub inodes_used: u64,
|
||||||
|
/// Free amount of indoes on the data path of dragonfly directory.
|
||||||
|
#[prost(uint64, tag = "7")]
|
||||||
|
pub inodes_free: u64,
|
||||||
|
/// Used percent of indoes on the data path of dragonfly directory.
|
||||||
|
#[prost(double, tag = "8")]
|
||||||
|
pub inodes_used_percent: f64,
|
||||||
|
}
|
||||||
|
/// Build information.
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct Build {
|
||||||
|
/// Git version.
|
||||||
|
#[prost(string, tag = "1")]
|
||||||
|
pub git_version: ::prost::alloc::string::String,
|
||||||
|
/// Git commit.
|
||||||
|
#[prost(string, tag = "2")]
|
||||||
|
pub git_commit: ::prost::alloc::string::String,
|
||||||
|
/// Golang version.
|
||||||
|
#[prost(string, tag = "3")]
|
||||||
|
pub go_version: ::prost::alloc::string::String,
|
||||||
|
/// Build platform.
|
||||||
|
#[prost(string, tag = "4")]
|
||||||
|
pub platform: ::prost::alloc::string::String,
|
||||||
}
|
}
|
||||||
/// Download information.
|
/// Download information.
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
|
@ -188,6 +346,17 @@ pub struct Download {
|
||||||
#[prost(bool, tag = "14")]
|
#[prost(bool, tag = "14")]
|
||||||
pub need_back_to_source: bool,
|
pub need_back_to_source: bool,
|
||||||
}
|
}
|
||||||
|
/// Range represents download range.
|
||||||
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct Range {
|
||||||
|
/// Start of range.
|
||||||
|
#[prost(int64, tag = "1")]
|
||||||
|
pub start: i64,
|
||||||
|
/// Length of range.
|
||||||
|
#[prost(int64, tag = "2")]
|
||||||
|
pub length: i64,
|
||||||
|
}
|
||||||
/// Piece represents information of piece.
|
/// Piece represents information of piece.
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
|
195
src/scheduler.rs
195
src/scheduler.rs
|
@ -231,199 +231,8 @@ pub struct StatTaskRequest {
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
pub struct AnnounceHostRequest {
|
pub struct AnnounceHostRequest {
|
||||||
/// Host id.
|
#[prost(message, optional, tag = "1")]
|
||||||
#[prost(string, tag = "1")]
|
pub host: ::core::option::Option<super::common::Host>,
|
||||||
pub id: ::prost::alloc::string::String,
|
|
||||||
/// Host type.
|
|
||||||
#[prost(uint32, tag = "2")]
|
|
||||||
pub r#type: u32,
|
|
||||||
/// Hostname.
|
|
||||||
#[prost(string, tag = "3")]
|
|
||||||
pub hostname: ::prost::alloc::string::String,
|
|
||||||
/// Host ip.
|
|
||||||
#[prost(string, tag = "4")]
|
|
||||||
pub ip: ::prost::alloc::string::String,
|
|
||||||
/// Port of grpc service.
|
|
||||||
#[prost(int32, tag = "5")]
|
|
||||||
pub port: i32,
|
|
||||||
/// Port of download server.
|
|
||||||
#[prost(int32, tag = "6")]
|
|
||||||
pub download_port: i32,
|
|
||||||
/// Host OS.
|
|
||||||
#[prost(string, tag = "7")]
|
|
||||||
pub os: ::prost::alloc::string::String,
|
|
||||||
/// Host platform.
|
|
||||||
#[prost(string, tag = "8")]
|
|
||||||
pub platform: ::prost::alloc::string::String,
|
|
||||||
/// Host platform family.
|
|
||||||
#[prost(string, tag = "9")]
|
|
||||||
pub platform_family: ::prost::alloc::string::String,
|
|
||||||
/// Host platform version.
|
|
||||||
#[prost(string, tag = "10")]
|
|
||||||
pub platform_version: ::prost::alloc::string::String,
|
|
||||||
/// Host kernel version.
|
|
||||||
#[prost(string, tag = "11")]
|
|
||||||
pub kernel_version: ::prost::alloc::string::String,
|
|
||||||
/// CPU Stat.
|
|
||||||
#[prost(message, optional, tag = "12")]
|
|
||||||
pub cpu: ::core::option::Option<Cpu>,
|
|
||||||
/// Memory Stat.
|
|
||||||
#[prost(message, optional, tag = "13")]
|
|
||||||
pub memory: ::core::option::Option<Memory>,
|
|
||||||
/// Network Stat.
|
|
||||||
#[prost(message, optional, tag = "14")]
|
|
||||||
pub network: ::core::option::Option<Network>,
|
|
||||||
/// Disk Stat.
|
|
||||||
#[prost(message, optional, tag = "15")]
|
|
||||||
pub disk: ::core::option::Option<Disk>,
|
|
||||||
/// Build information.
|
|
||||||
#[prost(message, optional, tag = "16")]
|
|
||||||
pub build: ::core::option::Option<Build>,
|
|
||||||
}
|
|
||||||
/// CPU Stat.
|
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
||||||
pub struct Cpu {
|
|
||||||
/// Number of logical cores in the system.
|
|
||||||
#[prost(uint32, tag = "1")]
|
|
||||||
pub logical_count: u32,
|
|
||||||
/// Number of physical cores in the system
|
|
||||||
#[prost(uint32, tag = "2")]
|
|
||||||
pub physical_count: u32,
|
|
||||||
/// Percent calculates the percentage of cpu used.
|
|
||||||
#[prost(double, tag = "3")]
|
|
||||||
pub percent: f64,
|
|
||||||
/// Calculates the percentage of cpu used by process.
|
|
||||||
#[prost(double, tag = "4")]
|
|
||||||
pub process_percent: f64,
|
|
||||||
/// CPUTimes contains the amounts of time the CPU has spent performing different kinds of work.
|
|
||||||
#[prost(message, optional, tag = "5")]
|
|
||||||
pub times: ::core::option::Option<CpuTimes>,
|
|
||||||
}
|
|
||||||
/// CPUTimes contains the amounts of time the CPU has spent performing different
|
|
||||||
/// kinds of work. Time units are in seconds.
|
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
||||||
pub struct CpuTimes {
|
|
||||||
/// CPU time of user.
|
|
||||||
#[prost(double, tag = "1")]
|
|
||||||
pub user: f64,
|
|
||||||
/// CPU time of system.
|
|
||||||
#[prost(double, tag = "2")]
|
|
||||||
pub system: f64,
|
|
||||||
/// CPU time of idle.
|
|
||||||
#[prost(double, tag = "3")]
|
|
||||||
pub idle: f64,
|
|
||||||
/// CPU time of nice.
|
|
||||||
#[prost(double, tag = "4")]
|
|
||||||
pub nice: f64,
|
|
||||||
/// CPU time of iowait.
|
|
||||||
#[prost(double, tag = "5")]
|
|
||||||
pub iowait: f64,
|
|
||||||
/// CPU time of irq.
|
|
||||||
#[prost(double, tag = "6")]
|
|
||||||
pub irq: f64,
|
|
||||||
/// CPU time of softirq.
|
|
||||||
#[prost(double, tag = "7")]
|
|
||||||
pub softirq: f64,
|
|
||||||
/// CPU time of steal.
|
|
||||||
#[prost(double, tag = "8")]
|
|
||||||
pub steal: f64,
|
|
||||||
/// CPU time of guest.
|
|
||||||
#[prost(double, tag = "9")]
|
|
||||||
pub guest: f64,
|
|
||||||
/// CPU time of guest nice.
|
|
||||||
#[prost(double, tag = "10")]
|
|
||||||
pub guest_nice: f64,
|
|
||||||
}
|
|
||||||
/// Memory Stat.
|
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
||||||
pub struct Memory {
|
|
||||||
/// Total amount of RAM on this system.
|
|
||||||
#[prost(uint64, tag = "1")]
|
|
||||||
pub total: u64,
|
|
||||||
/// RAM available for programs to allocate.
|
|
||||||
#[prost(uint64, tag = "2")]
|
|
||||||
pub available: u64,
|
|
||||||
/// RAM used by programs.
|
|
||||||
#[prost(uint64, tag = "3")]
|
|
||||||
pub used: u64,
|
|
||||||
/// Percentage of RAM used by programs.
|
|
||||||
#[prost(double, tag = "4")]
|
|
||||||
pub used_percent: f64,
|
|
||||||
/// Calculates the percentage of memory used by process.
|
|
||||||
#[prost(double, tag = "5")]
|
|
||||||
pub process_used_percent: f64,
|
|
||||||
/// This is the kernel's notion of free memory.
|
|
||||||
#[prost(uint64, tag = "6")]
|
|
||||||
pub free: u64,
|
|
||||||
}
|
|
||||||
/// Network Stat.
|
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
||||||
pub struct Network {
|
|
||||||
/// Return count of tcp connections opened and status is ESTABLISHED.
|
|
||||||
#[prost(uint32, tag = "1")]
|
|
||||||
pub tcp_connection_count: u32,
|
|
||||||
/// Return count of upload tcp connections opened and status is ESTABLISHED.
|
|
||||||
#[prost(uint32, tag = "2")]
|
|
||||||
pub upload_tcp_connection_count: u32,
|
|
||||||
/// Security domain for network.
|
|
||||||
#[prost(string, tag = "3")]
|
|
||||||
pub security_domain: ::prost::alloc::string::String,
|
|
||||||
/// Location path(area|country|province|city|...).
|
|
||||||
#[prost(string, tag = "4")]
|
|
||||||
pub location: ::prost::alloc::string::String,
|
|
||||||
/// IDC where the peer host is located
|
|
||||||
#[prost(string, tag = "5")]
|
|
||||||
pub idc: ::prost::alloc::string::String,
|
|
||||||
}
|
|
||||||
/// Disk Stat.
|
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
||||||
pub struct Disk {
|
|
||||||
/// Total amount of disk on the data path of dragonfly.
|
|
||||||
#[prost(uint64, tag = "1")]
|
|
||||||
pub total: u64,
|
|
||||||
/// Free amount of disk on the data path of dragonfly.
|
|
||||||
#[prost(uint64, tag = "2")]
|
|
||||||
pub free: u64,
|
|
||||||
/// Used amount of disk on the data path of dragonfly.
|
|
||||||
#[prost(uint64, tag = "3")]
|
|
||||||
pub used: u64,
|
|
||||||
/// Used percent of disk on the data path of dragonfly directory.
|
|
||||||
#[prost(double, tag = "4")]
|
|
||||||
pub used_percent: f64,
|
|
||||||
/// Total amount of indoes on the data path of dragonfly directory.
|
|
||||||
#[prost(uint64, tag = "5")]
|
|
||||||
pub inodes_total: u64,
|
|
||||||
/// Used amount of indoes on the data path of dragonfly directory.
|
|
||||||
#[prost(uint64, tag = "6")]
|
|
||||||
pub inodes_used: u64,
|
|
||||||
/// Free amount of indoes on the data path of dragonfly directory.
|
|
||||||
#[prost(uint64, tag = "7")]
|
|
||||||
pub inodes_free: u64,
|
|
||||||
/// Used percent of indoes on the data path of dragonfly directory.
|
|
||||||
#[prost(double, tag = "8")]
|
|
||||||
pub inodes_used_percent: f64,
|
|
||||||
}
|
|
||||||
/// Build information.
|
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
||||||
pub struct Build {
|
|
||||||
/// Git version.
|
|
||||||
#[prost(string, tag = "1")]
|
|
||||||
pub git_version: ::prost::alloc::string::String,
|
|
||||||
/// Git commit.
|
|
||||||
#[prost(string, tag = "2")]
|
|
||||||
pub git_commit: ::prost::alloc::string::String,
|
|
||||||
/// Golang version.
|
|
||||||
#[prost(string, tag = "3")]
|
|
||||||
pub go_version: ::prost::alloc::string::String,
|
|
||||||
/// Build platform.
|
|
||||||
#[prost(string, tag = "4")]
|
|
||||||
pub platform: ::prost::alloc::string::String,
|
|
||||||
}
|
}
|
||||||
/// LeaveHostRequest represents request of LeaveHost.
|
/// LeaveHostRequest represents request of LeaveHost.
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
|
|
Loading…
Reference in New Issue