feat: add standalone server topology view

This commit is contained in:
Mikhail Chusavitin
2026-09-14 10:29:36 +03:00
parent 5b8be0e464
commit 9ac38c2914
28 changed files with 1287 additions and 31 deletions
+22 -3
View File
@@ -488,7 +488,7 @@ func parsePCIeDeviceView(props map[string]string, result *models.AnalysisResult)
DeviceID: deviceID,
BDF: formatBDF(props["busnumber"], props["devicenumber"], props["functionnumber"]),
Manufacturer: manufacturer,
NUMANode: parseIntLoose(props["cpuaffinity"]),
NUMANode: parseOptionalIntLoose(props["cpuaffinity"]),
Status: normalizeStatus(props["primarystatus"]),
}
result.Hardware.PCIeDevices = append(result.Hardware.PCIeDevices, p)
@@ -535,7 +535,7 @@ func parseNICView(props map[string]string, result *models.AnalysisResult) {
props["controllerbiosversion"],
)),
PortCount: inferPortCountFromFQDD(fqdd),
NUMANode: parseIntLoose(props["cpuaffinity"]),
NUMANode: parseOptionalIntLoose(props["cpuaffinity"]),
Status: normalizeStatus(props["primarystatus"]),
}
if mac != "" {
@@ -589,7 +589,7 @@ func parseControllerView(props map[string]string, result *models.AnalysisResult)
DeviceClass: "storage-controller",
Manufacturer: strings.TrimSpace(firstNonEmpty(props["devicecardmanufacturer"], props["manufacturer"])),
PartNumber: strings.TrimSpace(firstNonEmpty(props["ppid"], props["boardpartnumber"])),
NUMANode: parseIntLoose(props["cpuaffinity"]),
NUMANode: parseOptionalIntLoose(props["cpuaffinity"]),
Status: normalizeStatus(props["primarystatus"]),
})
@@ -983,6 +983,25 @@ func parseIntLoose(v string) int {
return n
}
// parseOptionalIntLoose preserves zero as a real value while keeping missing
// and textual N/A values distinct. CPUAffinity is the motivating field: NUMA
// node 0 is valid, whereas "Not Applicable" means there is no affinity.
func parseOptionalIntLoose(v string) *int {
v = strings.TrimSpace(v)
if v == "" {
return nil
}
num := firstNumberRE.FindString(v)
if num == "" {
return nil
}
n, err := strconv.Atoi(num)
if err != nil {
return nil
}
return &n
}
func parseInt64Loose(v string) int64 {
v = strings.TrimSpace(v)
if v == "" {