From b5ae095a8728b63a2cc6f946096f242358fe73ee Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Mon, 12 May 2014 15:34:07 -0600 Subject: Add -work flag to 'bolt bench'. This commit adds a 'work' flag to the bolt bench utility so that databases generated by the bench CLI can be saved for analysis. --- cmd/bolt/bench.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cmd/bolt/bench.go') diff --git a/cmd/bolt/bench.go b/cmd/bolt/bench.go index fef8e54..e8bf376 100644 --- a/cmd/bolt/bench.go +++ b/cmd/bolt/bench.go @@ -33,7 +33,12 @@ func Bench(options *BenchOptions) { // Find temporary location. path := tempfile() - defer os.Remove(path) + + if options.Clean { + defer os.Remove(path) + } else { + println("work:", path) + } // Create database. db, err := bolt.Open(path, 0600) @@ -275,6 +280,7 @@ type BenchOptions struct { MemProfile string BlockProfile string StatsInterval time.Duration + Clean bool } // BenchResults represents the performance results of the benchmark. -- cgit v1.2.3