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

@ -22,7 +22,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"
)
@ -59,22 +58,14 @@ func rangeFunc(cmd *cobra.Command, args []string) {
requests := make(chan etcdserverpb.RangeRequest, totalClients)
bar = pb.New(rangeTotal)
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 doRange(clients[i], requests)
go doRange(clients[i].KV, requests)
}
pdoneC := printReport(results)