mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-19 21:51:12 +02:00
Add ability to retrieve node memory stats ( /proc/meminfo ). Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
187 lines
4.2 KiB
Protocol Buffer
187 lines
4.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package os;
|
|
|
|
option go_package = "github.com/talos-systems/talos/api/os";
|
|
option java_multiple_files = true;
|
|
option java_outer_classname = "OsApi";
|
|
option java_package = "com.os.api";
|
|
|
|
import "google/protobuf/empty.proto";
|
|
import "common/common.proto";
|
|
|
|
// The OS service definition.
|
|
//
|
|
// OS Service also implements all the API of Init Service
|
|
service OS {
|
|
rpc Containers(ContainersRequest) returns (ContainersReply);
|
|
rpc Dmesg(google.protobuf.Empty) returns (common.DataReply);
|
|
rpc Memory(google.protobuf.Empty) returns (MemInfoReply);
|
|
rpc Processes(google.protobuf.Empty) returns (ProcessesReply);
|
|
rpc Restart(RestartRequest) returns (RestartReply);
|
|
rpc Stats(StatsRequest) returns (StatsReply);
|
|
}
|
|
|
|
// rpc Containers
|
|
|
|
|
|
message ContainersRequest {
|
|
string namespace = 1;
|
|
// driver might be default "containerd" or "cri"
|
|
common.ContainerDriver driver = 2;
|
|
}
|
|
|
|
// The response message containing the requested containers.
|
|
message Container {
|
|
string namespace = 1;
|
|
string id = 2;
|
|
string image = 3;
|
|
uint32 pid = 4;
|
|
string status = 5;
|
|
string pod_id = 6;
|
|
string name = 7;
|
|
}
|
|
|
|
// The response message containing the requested containers.
|
|
message ContainerResponse {
|
|
common.NodeMetadata metadata = 1;
|
|
repeated Container containers = 2;
|
|
}
|
|
|
|
message ContainersReply {
|
|
repeated ContainerResponse response = 1;
|
|
}
|
|
|
|
// rpc processes
|
|
message ProcessesRequest {}
|
|
|
|
message ProcessesReply {
|
|
repeated ProcessResponse response = 1;
|
|
}
|
|
|
|
message ProcessResponse {
|
|
common.NodeMetadata metadata = 1;
|
|
repeated Process processes = 2;
|
|
}
|
|
|
|
message Process {
|
|
int32 pid = 1;
|
|
int32 ppid = 2;
|
|
string state = 3;
|
|
int32 threads = 4;
|
|
double cpu_time = 5;
|
|
uint64 virtual_memory = 6;
|
|
uint64 resident_memory = 7;
|
|
string command = 8;
|
|
string executable = 9;
|
|
string args = 10;
|
|
}
|
|
|
|
// rpc restart
|
|
// The request message containing the process to restart.
|
|
message RestartRequest {
|
|
string namespace = 1;
|
|
string id = 2;
|
|
// driver might be default "containerd" or "cri"
|
|
common.ContainerDriver driver = 3;
|
|
}
|
|
|
|
message RestartResponse {
|
|
common.NodeMetadata metadata = 1;
|
|
}
|
|
|
|
// The response message containing the restart status.
|
|
message RestartReply {
|
|
repeated RestartResponse response = 1;
|
|
}
|
|
|
|
// rpc stats
|
|
|
|
// The request message containing the containerd namespace.
|
|
message StatsRequest {
|
|
string namespace = 1;
|
|
// driver might be default "containerd" or "cri"
|
|
common.ContainerDriver driver = 2;
|
|
}
|
|
|
|
// The response message containing the requested stats.
|
|
message StatsResponse {
|
|
common.NodeMetadata metadata = 1;
|
|
repeated Stat stats = 2;
|
|
}
|
|
|
|
message StatsReply {
|
|
repeated StatsResponse response = 1;
|
|
}
|
|
|
|
// The response message containing the requested stat.
|
|
message Stat {
|
|
string namespace = 1;
|
|
string id = 2;
|
|
uint64 memory_usage = 4;
|
|
uint64 cpu_usage = 5;
|
|
string pod_id = 6;
|
|
string name = 7;
|
|
}
|
|
|
|
|
|
message MemInfoResponse {
|
|
common.NodeMetadata metadata = 1;
|
|
MemInfo meminfo = 2;
|
|
}
|
|
|
|
message MemInfoReply {
|
|
repeated MemInfoResponse response = 1;
|
|
}
|
|
|
|
message MemInfo {
|
|
uint64 memtotal = 1;
|
|
uint64 memfree = 2;
|
|
uint64 memavailable = 3;
|
|
uint64 buffers = 4;
|
|
uint64 cached = 5;
|
|
uint64 swapcached = 6;
|
|
uint64 active = 7;
|
|
uint64 inactive = 8;
|
|
uint64 activeanon = 9;
|
|
uint64 inactiveanon = 10;
|
|
uint64 activefile = 11;
|
|
uint64 inactivefile = 12;
|
|
uint64 unevictable = 13;
|
|
uint64 mlocked = 14;
|
|
uint64 swaptotal = 15;
|
|
uint64 swapfree = 16;
|
|
uint64 dirty = 17;
|
|
uint64 writeback = 18;
|
|
uint64 anonpages = 19;
|
|
uint64 mapped = 20;
|
|
uint64 shmem = 21;
|
|
uint64 slab = 22;
|
|
uint64 sreclaimable = 23;
|
|
uint64 sunreclaim = 24;
|
|
uint64 kernelstack = 25;
|
|
uint64 pagetables = 26;
|
|
uint64 nfsunstable = 27;
|
|
uint64 bounce = 28;
|
|
uint64 writebacktmp = 29;
|
|
uint64 commitlimit = 30;
|
|
uint64 committedas = 31;
|
|
uint64 vmalloctotal = 32;
|
|
uint64 vmallocused = 33;
|
|
uint64 vmallocchunk = 34;
|
|
uint64 hardwarecorrupted = 35;
|
|
uint64 anonhugepages = 36;
|
|
uint64 shmemhugepages = 37;
|
|
uint64 shmempmdmapped = 38;
|
|
uint64 cmatotal = 39;
|
|
uint64 cmafree = 40;
|
|
uint64 hugepagestotal = 41;
|
|
uint64 hugepagesfree = 42;
|
|
uint64 hugepagesrsvd = 43;
|
|
uint64 hugepagessurp = 44;
|
|
uint64 hugepagesize = 45;
|
|
uint64 directmap4k = 46;
|
|
uint64 directmap2m = 47;
|
|
uint64 directmap1g = 48;
|
|
}
|