Skip to content

Commit 2df09e8

Browse files
committed
feat(control): add GetHostResources RPC
Add GetHostResources to the control service, reporting aggregate hypervisor and host memory, CPU usage, and CPU/NUMA topology figures.
1 parent 982eba2 commit 2df09e8

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

protect/control/v1/control.proto

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ service ControlService {
1111
// Other control API snoops will be skipped from the responses.
1212
rpc SnoopControl(SnoopControlRequest) returns (stream SnoopControlReply);
1313
rpc GetHostCpuTopology(GetHostCpuTopologyRequest) returns (GetHostCpuTopologyReply);
14+
rpc GetHostResources(GetHostResourcesRequest) returns (GetHostResourcesReply);
1415

1516
rpc ListDevices(ListDevicesRequest) returns (ListDevicesReply);
1617

@@ -719,6 +720,36 @@ message GetHostCpuTopologyReply {
719720
repeated HostCpuTopologyInfo cpus = 1;
720721
}
721722

723+
// Requests aggregate memory, CPU, and topology figures for this machine.
724+
message GetHostResourcesRequest {}
725+
726+
// Memory, CPU, and topology figures for this machine. `hypervisor_*` values
727+
// describe the whole machine as the hypervisor sees it; `host_*` values
728+
// describe the host (dom0) that Edera runs in.
729+
message GetHostResourcesReply {
730+
// Memory figures are in bytes.
731+
uint64 hypervisor_free_memory = 1;
732+
uint64 hypervisor_used_memory = 2;
733+
uint64 hypervisor_total_memory = 3;
734+
uint64 host_free_memory = 4;
735+
uint64 host_used_memory = 5;
736+
uint64 host_total_memory = 6;
737+
738+
// CPU usage is the busy fraction as a percentage (0-100). Total time is the
739+
// cumulative elapsed CPU time since boot, summed across all logical CPUs, in
740+
// nanoseconds.
741+
double hypervisor_cpu_usage = 7;
742+
double host_cpu_usage = 8;
743+
uint64 hypervisor_cpu_total_time = 9;
744+
uint64 host_cpu_total_time = 10;
745+
746+
uint32 hypervisor_numa_nodes = 11;
747+
uint32 hypervisor_cpu_cores = 12;
748+
uint32 hypervisor_cpu_sockets = 13;
749+
uint32 host_cpu_cores = 14;
750+
uint32 host_cpu_sockets = 15;
751+
}
752+
722753
// Sets the host power management policy. `scheduler` is a CPU frequency governor name,
723754
// applied to all host CPUs. `smt_awareness` toggles SMT-aware power management.
724755
message SetHostPowerManagementPolicyRequest {

0 commit comments

Comments
 (0)