update bench tool

This commit is contained in:
siddontang 2014-10-31 09:18:45 +08:00
parent c471b4538f
commit b787ddbbd1
1 changed files with 4 additions and 1 deletions

View File

@ -58,9 +58,10 @@ func bench(cmd string, f func()) {
var kvSetBase int64 = 0
var kvGetBase int64 = 0
var value []byte
func benchSet() {
f := func() {
value := make([]byte, *valueSize)
n := atomic.AddInt64(&kvSetBase, 1)
db.Set(num.Int64ToBytes(n), value)
@ -122,6 +123,8 @@ func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
flag.Parse()
value = make([]byte, *valueSize)
cfg := config.NewConfigDefault()
cfg.DataDir = "./var/ledis_dbbench"
cfg.DBName = *name