don't use nested b.Run calls
One level with fmt.Sprintf is enough for what we need,
and is also easier to follow.
@@ -57,15 +57,14 @@ func BenchmarkPut(b *testing.B) {
},
}}
for _, ttr := range tt {
- b.Run(ttr.storeName, func(b *testing.B) {
for _, scale := range []int{
- 1 << 8, // probably too small to be useful; b.N will always be much bigger than this.
+ // 1 << 8, // probably too small to be useful; b.N will always be much bigger than this.
1 << 12,
1 << 16,
// 1 << 20, // already getting too big to fit the setup phase into the default benchmark time windows when using disk storage.
// 1 << 24,
} {
- b.Run(fmt.Sprintf("scale=%d", scale), func(b *testing.B) {
+ b.Run(fmt.Sprintf("%s/scale=%d", ttr.storeName, scale), func(b *testing.B) {
// Make a tempdir. Change cwd to it.
// We'll assume the storage system, if it needs filesystem, can use the cwd.
dir, err := ioutil.TempDir("", "storagebench")
@@ -88,6 +87,5 @@ func BenchmarkPut(b *testing.B) {
tests.BenchPut(b, store, gen, scale)
})
}
- })
}
}
