tools/benchmark: use clientv3

This commit is contained in:
Anthony Romano
2016-01-27 12:11:16 -08:00
parent 9a5a3ebc79
commit a7b6bbff3f
4 changed files with 24 additions and 39 deletions

View File

@ -24,7 +24,6 @@ import (
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/cheggaaa/pb"
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra"
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
"github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc"
"github.com/coreos/etcd/etcdserver/etcdserverpb"
)
@ -67,22 +66,14 @@ func putFunc(cmd *cobra.Command, args []string) {
k, v := make([]byte, keySize), mustRandBytes(valSize)
conns := make([]*grpc.ClientConn, totalConns)
for i := range conns {
conns[i] = mustCreateConn()
}
clients := make([]etcdserverpb.KVClient, totalClients)
for i := range clients {
clients[i] = etcdserverpb.NewKVClient(conns[i%int(totalConns)])
}
clients := mustCreateClients(totalClients, totalConns)
bar.Format("Bom !")
bar.Start()
for i := range clients {
wg.Add(1)
go doPut(context.Background(), clients[i], requests)
go doPut(context.Background(), clients[i].KV, requests)
}
pdoneC := printReport(results)