diff options
Diffstat (limited to 'cmd/bolt/bench.go')
-rw-r--r-- | cmd/bolt/bench.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd/bolt/bench.go b/cmd/bolt/bench.go index e1858df..10a5599 100644 --- a/cmd/bolt/bench.go +++ b/cmd/bolt/bench.go @@ -23,6 +23,13 @@ var benchBucketName = []byte("bench") func Bench(options *BenchOptions) { var results BenchResults + // Validate options. + if options.BatchSize == 0 { + options.BatchSize = options.Iterations + } else if options.Iterations%options.BatchSize != 0 { + fatal("number of iterations must be divisible by the batch size") + } + // Find temporary location. path := tempfile() defer os.Remove(path) @@ -232,9 +239,9 @@ type BenchOptions struct { WriteMode string ReadMode string Iterations int + BatchSize int KeySize int ValueSize int - BatchSize int CPUProfile string MemProfile string BlockProfile string |