Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed Aug 5, 2024
1 parent e5d00bc commit d4e6bc3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions disk/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@ func parseResultDD(tempText, blockCount string) string {
}
result += fmt.Sprintf("%-30s", strings.TrimSpace(ioSpeed)+" "+ioSpeedFlat+"("+iopsText+")") + " "
}
if len(tp2) == 3 {
usageTime, _ = strconv.ParseFloat(strings.Split(strings.TrimSpace(tp2[1]), " ")[0], 64)
ioSpeed := strings.Split(strings.TrimSpace(tp2[2]), " ")[0]
ioSpeedFlat := strings.Split(strings.TrimSpace(tp2[2]), " ")[1]
iops := records / usageTime
var iopsText string
if iops >= 1000 {
iopsText = strconv.FormatFloat(iops/1000, 'f', 2, 64) + "K IOPS, " + strconv.FormatFloat(usageTime, 'f', 2, 64) + "s"
} else {
iopsText = strconv.FormatFloat(iops, 'f', 2, 64) + " IOPS, " + strconv.FormatFloat(usageTime, 'f', 2, 64) + "s"
}
result += fmt.Sprintf("%-30s", strings.TrimSpace(ioSpeed)+" "+ioSpeedFlat+"("+iopsText+")") + " "
}
}
}
return result
Expand Down

0 comments on commit d4e6bc3

Please sign in to comment.