Skip to content

Commit

Permalink
v0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed Aug 14, 2024
1 parent fa33375 commit 0034eb2
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions memory/memorytest.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,14 @@ func parseOutput(tempText, language string, records float64) (string, error) {
if err != nil {
return "", err
}
ioSpeed := strings.Split(strings.TrimSpace(tp2[3]), " ")[0]
ioSpeedFlat := strings.Split(strings.TrimSpace(tp2[3]), " ")[1]
var ioSpeed, ioSpeedFlat string
parts := strings.Fields(strings.TrimSpace(tp2[3]))
if len(parts) < 2 {
return "", fmt.Errorf("Wrong len of parts in tp2_4")
} else {
ioSpeed = parts[0]
ioSpeedFlat = parts[1]
}
iops := records / usageTime
var iopsText string
if iops >= 1000 {
Expand All @@ -216,8 +222,14 @@ func parseOutput(tempText, language string, records float64) (string, error) {
if err != nil {
return "", err
}
ioSpeed := strings.Split(strings.TrimSpace(tp2[2]), " ")[0]
ioSpeedFlat := strings.Split(strings.TrimSpace(tp2[2]), " ")[1]
var ioSpeed, ioSpeedFlat string
parts := strings.Fields(strings.TrimSpace(tp2[2]))
if len(parts) < 2 {
return "", fmt.Errorf("Wrong len of parts in tp2_3")
} else {
ioSpeed = parts[0]
ioSpeedFlat = parts[1]
}
iops := records / usageTime
var iopsText string
if iops >= 1000 {
Expand Down

0 comments on commit 0034eb2

Please sign in to comment.