From d9e7e0257b4855bd2a4072f56597485a341841f0 Mon Sep 17 00:00:00 2001 From: Martin Kobetic Date: Thu, 24 Apr 2014 16:30:39 -0400 Subject: add -stats and -batch-size support to bench cmd --- cmd/bolt/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cmd/bolt/main.go') diff --git a/cmd/bolt/main.go b/cmd/bolt/main.go index 719bf00..cab4e0e 100644 --- a/cmd/bolt/main.go +++ b/cmd/bolt/main.go @@ -100,11 +100,17 @@ func NewApp() *cli.App { &cli.IntFlag{Name: "count", Value: 1000, Usage: "Item count"}, &cli.IntFlag{Name: "key-size", Value: 8, Usage: "Key size"}, &cli.IntFlag{Name: "value-size", Value: 32, Usage: "Value size"}, + &cli.IntFlag{Name: "batch-size", Value: 0, Usage: "Write batch size"}, &cli.StringFlag{Name: "cpuprofile", Usage: "CPU profile output path"}, &cli.StringFlag{Name: "memprofile", Usage: "Memory profile output path"}, &cli.StringFlag{Name: "blockprofile", Usage: "Block profile output path"}, + &cli.BoolFlag{Name: "stats", Usage: "Output storage and transaction stats"}, }, Action: func(c *cli.Context) { + bs := c.Int("batch-size") + if bs == 0 { + bs = c.Int("count") + } Bench(&BenchOptions{ ProfileMode: c.String("profile-mode"), WriteMode: c.String("write-mode"), @@ -112,9 +118,11 @@ func NewApp() *cli.App { Iterations: c.Int("count"), KeySize: c.Int("key-size"), ValueSize: c.Int("value-size"), + BatchSize: bs, CPUProfile: c.String("cpuprofile"), MemProfile: c.String("memprofile"), BlockProfile: c.String("blockprofile"), + Stats: c.Bool("stats"), }) }, }} -- cgit v1.2.3