collector/redfish: skip deep DIMM subresources and remove memory from critical warmup
This commit is contained in:
@@ -969,7 +969,6 @@ func redfishCriticalEndpoints(systemPaths, chassisPaths, managerPaths []string)
|
||||
add(joinPath(p, "/Oem/Public/ThermalConfig"))
|
||||
add(joinPath(p, "/ThermalConfig"))
|
||||
add(joinPath(p, "/Processors"))
|
||||
add(joinPath(p, "/Memory"))
|
||||
add(joinPath(p, "/Storage"))
|
||||
add(joinPath(p, "/SimpleStorage"))
|
||||
add(joinPath(p, "/PCIeDevices"))
|
||||
@@ -1157,6 +1156,15 @@ func shouldCrawlPath(path string) bool {
|
||||
if path == "" {
|
||||
return false
|
||||
}
|
||||
normalized := normalizeRedfishPath(path)
|
||||
if strings.Contains(normalized, "/Memory/") {
|
||||
after := strings.SplitN(normalized, "/Memory/", 2)
|
||||
if len(after) == 2 && strings.Count(after[1], "/") >= 1 {
|
||||
// Keep direct DIMM resources (/Memory/<slot>) but skip nested subresources
|
||||
// like /Memory/<slot>/Assembly and /Memory/<slot>/MemoryMetrics.
|
||||
return false
|
||||
}
|
||||
}
|
||||
heavyParts := []string{
|
||||
"/JsonSchemas",
|
||||
"/LogServices/",
|
||||
|
||||
@@ -768,3 +768,15 @@ func TestReplayCollectGPUs_DropsModelOnlyPlaceholderWhenConcreteDiscoveredLater(
|
||||
t.Fatalf("expected concrete PCIe GPU to remain, got slot=%q", got[0].Slot)
|
||||
}
|
||||
}
|
||||
|
||||
func TestShouldCrawlPath_MemorySubresourcesAreSkipped(t *testing.T) {
|
||||
if !shouldCrawlPath("/redfish/v1/Systems/1/Memory/CPU0_C0D0") {
|
||||
t.Fatalf("expected direct DIMM resource to be crawlable")
|
||||
}
|
||||
if shouldCrawlPath("/redfish/v1/Systems/1/Memory/CPU0_C0D0/Assembly") {
|
||||
t.Fatalf("expected DIMM assembly subresource to be skipped")
|
||||
}
|
||||
if shouldCrawlPath("/redfish/v1/Systems/1/Memory/CPU0_C0D0/MemoryMetrics") {
|
||||
t.Fatalf("expected DIMM metrics subresource to be skipped")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user