From 3b449559cf34cbcc74460b59041a4399d3226e5a Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Sun, 12 Apr 2015 09:36:45 -0600 Subject: Add --path to bolt bench. --- cmd/bolt/bench.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmd/bolt/bench.go') diff --git a/cmd/bolt/bench.go b/cmd/bolt/bench.go index 91af960..3ade8b8 100644 --- a/cmd/bolt/bench.go +++ b/cmd/bolt/bench.go @@ -31,8 +31,11 @@ func Bench(options *BenchOptions) { fatal("number of iterations must be divisible by the batch size") } - // Find temporary location. - path := tempfile() + // Generate temp path if one is not passed in. + path := options.Path + if path == "" { + path = tempfile() + } if options.Clean { defer os.Remove(path) @@ -368,6 +371,7 @@ type BenchOptions struct { FillPercent float64 NoSync bool Clean bool + Path string } // BenchResults represents the performance results of the benchmark. -- cgit v1.2.3