Skip to content

Commit f6152b8

Browse files
luomingmengwaynepeking348
authored andcommitted
support report numa count to kcnr
(cherry picked from commit 0c8f537)
1 parent b6e790d commit f6152b8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/agent/resourcemanager/fetcher/system/systemplugin.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const (
4545
ResourceNameNBW v1.ResourceName = "nbw"
4646

4747
PropertyNameCIS = "cis"
48+
PropertyNameNUMA = "numa"
4849
PropertyNameTopology = "topology"
4950
)
5051

@@ -122,6 +123,7 @@ func (p *systemPlugin) getResourceProperties() ([]*v1alpha1.ReportContent, error
122123

123124
// append all properties to one property list
124125
properties = append(properties,
126+
p.getNUMACount(),
125127
p.getNetworkBandwidth(),
126128
p.getCPUCount(),
127129
p.getMemoryCapacity(),
@@ -148,6 +150,14 @@ func (p *systemPlugin) getResourceProperties() ([]*v1alpha1.ReportContent, error
148150
}, nil
149151
}
150152

153+
// getNUMACount get numa count of this machine.
154+
func (p *systemPlugin) getNUMACount() *nodev1alpha1.Property {
155+
return &nodev1alpha1.Property{
156+
PropertyName: PropertyNameNUMA,
157+
PropertyQuantity: resource.NewQuantity(int64(p.metaServer.CPUTopology.NumNUMANodes), resource.DecimalSI),
158+
}
159+
}
160+
151161
// getNetworkBandwidth get max network bandwidth of all the interfaces in this machine.
152162
func (p *systemPlugin) getNetworkBandwidth() *nodev1alpha1.Property {
153163
// check all interface, save max speed of all enabled interfaces

0 commit comments

Comments
 (0)