From f6152b81acc0e79018a563e749fb5fe629b778aa Mon Sep 17 00:00:00 2001 From: luomingmeng Date: Fri, 15 Dec 2023 12:38:27 +0800 Subject: [PATCH] support report numa count to kcnr (cherry picked from commit 0c8f537800893ce105930e716452d6bd8d6bac47) --- .../resourcemanager/fetcher/system/systemplugin.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/agent/resourcemanager/fetcher/system/systemplugin.go b/pkg/agent/resourcemanager/fetcher/system/systemplugin.go index 62403b478..b127fdb18 100644 --- a/pkg/agent/resourcemanager/fetcher/system/systemplugin.go +++ b/pkg/agent/resourcemanager/fetcher/system/systemplugin.go @@ -45,6 +45,7 @@ const ( ResourceNameNBW v1.ResourceName = "nbw" PropertyNameCIS = "cis" + PropertyNameNUMA = "numa" PropertyNameTopology = "topology" ) @@ -122,6 +123,7 @@ func (p *systemPlugin) getResourceProperties() ([]*v1alpha1.ReportContent, error // append all properties to one property list properties = append(properties, + p.getNUMACount(), p.getNetworkBandwidth(), p.getCPUCount(), p.getMemoryCapacity(), @@ -148,6 +150,14 @@ func (p *systemPlugin) getResourceProperties() ([]*v1alpha1.ReportContent, error }, nil } +// getNUMACount get numa count of this machine. +func (p *systemPlugin) getNUMACount() *nodev1alpha1.Property { + return &nodev1alpha1.Property{ + PropertyName: PropertyNameNUMA, + PropertyQuantity: resource.NewQuantity(int64(p.metaServer.CPUTopology.NumNUMANodes), resource.DecimalSI), + } +} + // getNetworkBandwidth get max network bandwidth of all the interfaces in this machine. func (p *systemPlugin) getNetworkBandwidth() *nodev1alpha1.Property { // check all interface, save max speed of all enabled interfaces