diff options
author | Zach Koopmans <zkoopmans@google.com> | 2021-02-19 17:10:27 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-02-19 17:12:42 -0800 |
commit | 7544eeb242d0aba2da054a1663e043feaedb9618 (patch) | |
tree | f5babceeed52f0e8771c269c35972d7a648ef398 /test/benchmarks/tools | |
parent | 5e22ab93e6b44c036a6ec56858df0874729c4baa (diff) |
Correctly set and respect b.N in fio benchmark.
fio should scale by written/read bytes and not iterate runs
of the fio container.
PiperOrigin-RevId: 358511771
Diffstat (limited to 'test/benchmarks/tools')
-rw-r--r-- | test/benchmarks/tools/fio.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/benchmarks/tools/fio.go b/test/benchmarks/tools/fio.go index f6324c3ab..ea12436d2 100644 --- a/test/benchmarks/tools/fio.go +++ b/test/benchmarks/tools/fio.go @@ -62,18 +62,15 @@ func (f *Fio) Report(b *testing.B, output string) { // parseBandwidth reports the bandwidth in b/s. func (f *Fio) parseBandwidth(data string, isRead bool) (float64, error) { + op := "write" if isRead { - result, err := f.parseFioJSON(data, "read", "bw") - if err != nil { - return 0, err - } - return 1024 * result, nil + op = "read" } - result, err := f.parseFioJSON(data, "write", "bw") + result, err := f.parseFioJSON(data, op, "bw") if err != nil { return 0, err } - return 1024 * result, nil + return result * 1024, nil } // parseIOps reports the write IO per second metric. |