summaryrefslogtreecommitdiffhomepage
path: root/test/benchmarks/tools/fio.go
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-12-29 18:26:46 -0800
committergVisor bot <gvisor-bot@google.com>2020-12-29 18:29:12 -0800
commitffa9a715aaf4ebc4c8d8bef948649af358e4f4e4 (patch)
tree47e16fdc85a56d00f8c8e5380cfc28a44957f877 /test/benchmarks/tools/fio.go
parent3c58405a544dcd599bd84406b5d52848941675f7 (diff)
Simplify profiling and benchmarks.
- Tweak the benchmarks to work with b.N where appropriate. In many cases, b.N was simply being ignored. This creates an implicit dependency in the user passing a reasonable benchtime (less than or equal to the actual runtime of the test, or using the X syntax) otherwise the test runs forever. - In cases where the above is impossible, explicitly set benchtime from the test wrapper, to prevent the above behavior (tensorflow). - Drop the *Reverse variants, which are simply hey benchmarks. We should just add a hey benchmark. The platforms benchmarks already include a native platform, and thus these benchmarks are incredibly confusing. (In other words, BenchmarkNginxReverse has nothing to do with an nginx benchmark for runsc.) - Remove the redunant Harness object, which contains no state, in order to slightly simplify the code. - Make Block and Heap profiling actually work, but setting appropriate runtime parameters (and plumbing them through the config). - Split the profiling into two phases: start and stop, since some will need to be started early, and others will need to happen at the end. PiperOrigin-RevId: 349495377
Diffstat (limited to 'test/benchmarks/tools/fio.go')
-rw-r--r--test/benchmarks/tools/fio.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/test/benchmarks/tools/fio.go b/test/benchmarks/tools/fio.go
index f5f60fa84..f6324c3ab 100644
--- a/test/benchmarks/tools/fio.go
+++ b/test/benchmarks/tools/fio.go
@@ -25,25 +25,20 @@ import (
// Fio makes 'fio' commands and parses their output.
type Fio struct {
Test string // test to run: read, write, randread, randwrite.
- Size string // total size to be read/written of format N[GMK] (e.g. 5G).
- Blocksize string // blocksize to be read/write of format N[GMK] (e.g. 4K).
- Iodepth int // iodepth for reads/writes.
- Time int // time to run the test in seconds, usually for rand(read/write).
+ Size int // total size to be read/written in megabytes.
+ BlockSize int // block size to be read/written in kilobytes.
+ IODepth int // I/O depth for reads/writes.
}
// MakeCmd makes a 'fio' command.
func (f *Fio) MakeCmd(filename string) []string {
cmd := []string{"fio", "--output-format=json", "--ioengine=sync"}
cmd = append(cmd, fmt.Sprintf("--name=%s", f.Test))
- cmd = append(cmd, fmt.Sprintf("--size=%s", f.Size))
- cmd = append(cmd, fmt.Sprintf("--blocksize=%s", f.Blocksize))
+ cmd = append(cmd, fmt.Sprintf("--size=%dM", f.Size))
+ cmd = append(cmd, fmt.Sprintf("--blocksize=%dK", f.BlockSize))
cmd = append(cmd, fmt.Sprintf("--filename=%s", filename))
- cmd = append(cmd, fmt.Sprintf("--iodepth=%d", f.Iodepth))
+ cmd = append(cmd, fmt.Sprintf("--iodepth=%d", f.IODepth))
cmd = append(cmd, fmt.Sprintf("--rw=%s", f.Test))
- if f.Time != 0 {
- cmd = append(cmd, "--time_based")
- cmd = append(cmd, fmt.Sprintf("--runtime=%d", f.Time))
- }
return cmd
}