benchmarks: fix wrong file size for fio read

According to MakeCmd function of fio, the unit of --size option is MB.

Signed-off-by: Chen Hui <cedriccchen@tencent.com>
This commit is contained in:
Chen Hui
2022-09-23 12:32:18 +08:00
parent ac982d4a93
commit 18657459ac
+1 -1
View File
@@ -126,7 +126,7 @@ func BenchmarkFio(b *testing.B) {
// For reads, we need a file to read so make one inside the container.
if strings.Contains(tc.Test, "read") {
fallocateCmd := fmt.Sprintf("fallocate -l %dK %s", tc.Size, outfile)
fallocateCmd := fmt.Sprintf("fallocate -l %dM %s", tc.Size, outfile)
if out, err := container.Exec(ctx, dockerutil.ExecOpts{},
strings.Split(fallocateCmd, " ")...); err != nil {
b.Fatalf("failed to create readable file on mount: %v, %s", err, out)