diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-04-19 09:09:10 -0500 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-04-19 09:09:10 -0500 |
commit | 4b0c7e3d42e34cd1babf92f69de383da432a421f (patch) | |
tree | b32ca009bfaeae67cc0db5e388ba574b07cfa333 /cmd/bolt/main.go | |
parent | Merge pull request #131 from benbjohnson/cursor-bucket (diff) | |
parent | Add 'bolt bench'. (diff) | |
download | dedo-4b0c7e3d42e34cd1babf92f69de383da432a421f.tar.gz dedo-4b0c7e3d42e34cd1babf92f69de383da432a421f.tar.xz |
Merge pull request #135 from benbjohnson/bench
Bench
Diffstat (limited to 'cmd/bolt/main.go')
-rw-r--r-- | cmd/bolt/main.go | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/cmd/bolt/main.go b/cmd/bolt/main.go index 1930e7d..719bf00 100644 --- a/cmd/bolt/main.go +++ b/cmd/bolt/main.go @@ -90,7 +90,34 @@ func NewApp() *cli.App { Check(path) }, }, - } + { + Name: "bench", + Usage: "Performs a synthetic benchmark", + Flags: []cli.Flag{ + &cli.StringFlag{Name: "profile-mode", Value: "rw", Usage: "Profile mode"}, + &cli.StringFlag{Name: "write-mode", Value: "seq", Usage: "Write mode"}, + &cli.StringFlag{Name: "read-mode", Value: "seq", Usage: "Read mode"}, + &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.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"}, + }, + Action: func(c *cli.Context) { + Bench(&BenchOptions{ + ProfileMode: c.String("profile-mode"), + WriteMode: c.String("write-mode"), + ReadMode: c.String("read-mode"), + Iterations: c.Int("count"), + KeySize: c.Int("key-size"), + ValueSize: c.Int("value-size"), + CPUProfile: c.String("cpuprofile"), + MemProfile: c.String("memprofile"), + BlockProfile: c.String("blockprofile"), + }) + }, + }} return app } |