mirror of https://github.com/ledisdb/ledisdb.git
update bench tool
This commit is contained in:
parent
c471b4538f
commit
b787ddbbd1
|
@ -58,9 +58,10 @@ func bench(cmd string, f func()) {
|
||||||
var kvSetBase int64 = 0
|
var kvSetBase int64 = 0
|
||||||
var kvGetBase int64 = 0
|
var kvGetBase int64 = 0
|
||||||
|
|
||||||
|
var value []byte
|
||||||
|
|
||||||
func benchSet() {
|
func benchSet() {
|
||||||
f := func() {
|
f := func() {
|
||||||
value := make([]byte, *valueSize)
|
|
||||||
n := atomic.AddInt64(&kvSetBase, 1)
|
n := atomic.AddInt64(&kvSetBase, 1)
|
||||||
|
|
||||||
db.Set(num.Int64ToBytes(n), value)
|
db.Set(num.Int64ToBytes(n), value)
|
||||||
|
@ -122,6 +123,8 @@ func main() {
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
value = make([]byte, *valueSize)
|
||||||
|
|
||||||
cfg := config.NewConfigDefault()
|
cfg := config.NewConfigDefault()
|
||||||
cfg.DataDir = "./var/ledis_dbbench"
|
cfg.DataDir = "./var/ledis_dbbench"
|
||||||
cfg.DBName = *name
|
cfg.DBName = *name
|
||||||
|
|
Loading…
Reference in New Issue