Skip to content

Commit e094f2c

Browse files
committed
check for storage benchmark errors earlier to catch conditions like
insufficient diskspace log partial storage benchmark output if unable to find fio output
1 parent 5923923 commit e094f2c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

internal/report/table_helpers_benchmarking.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,20 @@ func cpuSpeedFromOutput(outputs map[string]script.ScriptOutput) string {
123123
func storagePerfFromOutput(outputs map[string]script.ScriptOutput) (fioOutput, error) {
124124
output := outputs[script.StorageBenchmarkScriptName].Stdout
125125

126+
if strings.Contains(output, "ERROR:") {
127+
return fioOutput{}, fmt.Errorf("failed to run storage benchmark: %s", output)
128+
}
126129
i := strings.Index(output, "{\n \"fio version\"")
127130
if i >= 0 {
128131
output = output[i:]
129132
} else {
133+
outputLen := len(output)
134+
if outputLen > 100 {
135+
outputLen = 100
136+
}
137+
slog.Info("fio output snip", "output", output[:outputLen], "stderr", outputs[script.StorageBenchmarkScriptName].Stderr)
130138
return fioOutput{}, fmt.Errorf("unable to find fio output")
131139
}
132-
if strings.Contains(output, "ERROR:") {
133-
return fioOutput{}, fmt.Errorf("failed to run storage benchmark: %s", output)
134-
}
135140

136141
slog.Debug("parsing storage benchmark output")
137142
var fioData fioOutput

0 commit comments

Comments
 (0)