From 84843b0f247c5e34273a441fb737e79e901c0ca6 Mon Sep 17 00:00:00 2001 From: Jason Harper <78619061+harp-intel@users.noreply.github.com> Date: Wed, 8 Apr 2026 07:03:09 -0700 Subject: [PATCH] Fix: add insight when configured DIMM speed is less than DIMM max speed Insight logic was backwards. --- cmd/report/report_tables.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/report/report_tables.go b/cmd/report/report_tables.go index f3c157c5..30906f15 100644 --- a/cmd/report/report_tables.go +++ b/cmd/report/report_tables.go @@ -1153,7 +1153,7 @@ func dimmTableInsights(outputs map[string]script.ScriptOutput, tableValues table speedParts := strings.Split(speed, " ") configuredSpeedParts := strings.Split(configuredSpeed, " ") if len(speedParts) > 0 && len(configuredSpeedParts) > 0 { - speedVal, err := strconv.Atoi(speedParts[0]) + maximumSpeedVal, err := strconv.Atoi(speedParts[0]) if err != nil { slog.Warn(err.Error()) } else { @@ -1161,11 +1161,12 @@ func dimmTableInsights(outputs map[string]script.ScriptOutput, tableValues table if err != nil { slog.Warn(err.Error()) } else { - if speedVal < configuredSpeedVal { + if configuredSpeedVal < maximumSpeedVal { insights = append(insights, table.Insight{ Recommendation: "Consider configuring DIMMs for their maximum speed.", - Justification: fmt.Sprintf("DIMMs configured for %s when their maximum speed is %s.", configuredSpeed, speed), + Justification: fmt.Sprintf("At least one DIMM was found with configured speed %s when their maximum speed is %s.", configuredSpeed, speed), }) + break } } } @@ -1176,7 +1177,6 @@ func dimmTableInsights(outputs map[string]script.ScriptOutput, tableValues table } return insights } - func nicTableValues(outputs map[string]script.ScriptOutput) []table.Field { allNicsInfo := extract.ParseNicInfo(outputs[script.NicInfoScriptName].Stdout) if len(allNicsInfo) == 0 {