Skip to content

Commit 4360008

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 4360008

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

protect/control/v1/control.proto

Lines changed: 32 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,37 @@ 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+
//
730+
// Memory figures are in bytes. CPU usage is the busy fraction as a percentage
731+
// (0-100); CPU total time is the cumulative elapsed CPU time since boot, summed
732+
// across all logical CPUs, in nanoseconds. Core counts are physical cores; see
733+
// GetHostCpuTopology for the per-CPU breakdown.
734+
message GetHostResourcesReply {
735+
uint64 hypervisor_total_memory = 1;
736+
uint64 hypervisor_used_memory = 2;
737+
uint64 hypervisor_free_memory = 3;
738+
double hypervisor_cpu_usage = 4;
739+
uint64 hypervisor_cpu_total_time = 5;
740+
uint32 hypervisor_numa_nodes = 6;
741+
uint32 hypervisor_cpu_sockets = 7;
742+
uint32 hypervisor_cpu_cores = 8;
743+
744+
uint64 host_total_memory = 9;
745+
uint64 host_used_memory = 10;
746+
uint64 host_free_memory = 11;
747+
double host_cpu_usage = 12;
748+
uint64 host_cpu_total_time = 13;
749+
uint32 host_numa_nodes = 14;
750+
uint32 host_cpu_sockets = 15;
751+
uint32 host_cpu_cores = 16;
752+
}
753+
722754
// Sets the host power management policy. `scheduler` is a CPU frequency governor name,
723755
// applied to all host CPUs. `smt_awareness` toggles SMT-aware power management.
724756
message SetHostPowerManagementPolicyRequest {

0 commit comments

Comments
 (0)