diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-04-30 12:00:39 -0600 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-04-30 12:00:39 -0600 |
commit | 2bfb1b3db56490d10951f104a892347d1a6db632 (patch) | |
tree | 682ce04dd86fdfe06f1cb0fc2b084c56c7bdaded /cmd/bolt/bench.go | |
parent | Remove bolt bench -stat. (diff) | |
parent | Add --batch-size to 'bolt bench'. (diff) | |
download | dedo-2bfb1b3db56490d10951f104a892347d1a6db632.tar.gz dedo-2bfb1b3db56490d10951f104a892347d1a6db632.tar.xz |
Merge branch 'bench-batch' into moar_bench
Conflicts:
cmd/bolt/bench.go
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 |