Skip to content

Commit 84843b0

Browse files
authored
Fix: add insight when configured DIMM speed is less than DIMM max speed
Insight logic was backwards.
1 parent 42744e4 commit 84843b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd/report/report_tables.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,19 +1153,20 @@ func dimmTableInsights(outputs map[string]script.ScriptOutput, tableValues table
11531153
speedParts := strings.Split(speed, " ")
11541154
configuredSpeedParts := strings.Split(configuredSpeed, " ")
11551155
if len(speedParts) > 0 && len(configuredSpeedParts) > 0 {
1156-
speedVal, err := strconv.Atoi(speedParts[0])
1156+
maximumSpeedVal, err := strconv.Atoi(speedParts[0])
11571157
if err != nil {
11581158
slog.Warn(err.Error())
11591159
} else {
11601160
configuredSpeedVal, err := strconv.Atoi(configuredSpeedParts[0])
11611161
if err != nil {
11621162
slog.Warn(err.Error())
11631163
} else {
1164-
if speedVal < configuredSpeedVal {
1164+
if configuredSpeedVal < maximumSpeedVal {
11651165
insights = append(insights, table.Insight{
11661166
Recommendation: "Consider configuring DIMMs for their maximum speed.",
1167-
Justification: fmt.Sprintf("DIMMs configured for %s when their maximum speed is %s.", configuredSpeed, speed),
1167+
Justification: fmt.Sprintf("At least one DIMM was found with configured speed %s when their maximum speed is %s.", configuredSpeed, speed),
11681168
})
1169+
break
11691170
}
11701171
}
11711172
}
@@ -1176,7 +1177,6 @@ func dimmTableInsights(outputs map[string]script.ScriptOutput, tableValues table
11761177
}
11771178
return insights
11781179
}
1179-
11801180
func nicTableValues(outputs map[string]script.ScriptOutput) []table.Field {
11811181
allNicsInfo := extract.ParseNicInfo(outputs[script.NicInfoScriptName].Stdout)
11821182
if len(allNicsInfo) == 0 {

0 commit comments

Comments
 (0)