diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-05-01 15:13:05 -0600 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-05-01 15:13:05 -0600 |
commit | a18135e055eaa4e3c13bd181247cd7b4bbc1ddd0 (patch) | |
tree | 192814044780f9c8b84892b88d10a04de7e4956a /cmd/bolt/main.go | |
parent | Merge pull request #146 from benbjohnson/bench-batch (diff) | |
parent | Add streaming stats to bolt bench. (diff) | |
download | dedo-a18135e055eaa4e3c13bd181247cd7b4bbc1ddd0.tar.gz dedo-a18135e055eaa4e3c13bd181247cd7b4bbc1ddd0.tar.xz |
Merge pull request #147 from benbjohnson/stats
Add streaming stats to bolt bench.
Diffstat (limited to 'cmd/bolt/main.go')
-rw-r--r-- | cmd/bolt/main.go | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/cmd/bolt/main.go b/cmd/bolt/main.go index cb2d47a..3558500 100644 --- a/cmd/bolt/main.go +++ b/cmd/bolt/main.go @@ -6,6 +6,7 @@ import ( "fmt" "log" "os" + "time" "github.com/codegangsta/cli" ) @@ -104,19 +105,26 @@ func NewApp() *cli.App { &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.StringFlag{Name: "stats-interval", Value: "0s", Usage: "Continuous stats interval"}, }, Action: func(c *cli.Context) { + statsInterval, err := time.ParseDuration(c.String("stats-interval")) + if err != nil { + fatal(err) + } + Bench(&BenchOptions{ - ProfileMode: c.String("profile-mode"), - WriteMode: c.String("write-mode"), - ReadMode: c.String("read-mode"), - Iterations: c.Int("count"), - BatchSize: c.Int("batch-size"), - KeySize: c.Int("key-size"), - ValueSize: c.Int("value-size"), - CPUProfile: c.String("cpuprofile"), - MemProfile: c.String("memprofile"), - BlockProfile: c.String("blockprofile"), + ProfileMode: c.String("profile-mode"), + WriteMode: c.String("write-mode"), + ReadMode: c.String("read-mode"), + Iterations: c.Int("count"), + BatchSize: c.Int("batch-size"), + KeySize: c.Int("key-size"), + ValueSize: c.Int("value-size"), + CPUProfile: c.String("cpuprofile"), + MemProfile: c.String("memprofile"), + BlockProfile: c.String("blockprofile"), + StatsInterval: statsInterval, }) }, }} |