mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
benchmark: Fix the panic when running benchmark watch
Signed-off-by: SimFG <1142838399@qq.com>
This commit is contained in:
parent
9609a46629
commit
508fa22a91
@ -23,7 +23,7 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.etcd.io/etcd/client/v3"
|
clientv3 "go.etcd.io/etcd/client/v3"
|
||||||
"go.etcd.io/etcd/pkg/v3/report"
|
"go.etcd.io/etcd/pkg/v3/report"
|
||||||
|
|
||||||
"github.com/cheggaaa/pb/v3"
|
"github.com/cheggaaa/pb/v3"
|
||||||
@ -209,7 +209,12 @@ func benchPutWatches(clients []*clientv3.Client, wk *watchedKeys) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
limit := rate.NewLimiter(rate.Limit(watchPutRate), 1)
|
watchPutLimit := rate.Inf
|
||||||
|
if watchPutRate > 0 {
|
||||||
|
watchPutLimit = rate.Limit(watchPutRate)
|
||||||
|
}
|
||||||
|
|
||||||
|
limit := rate.NewLimiter(watchPutLimit, 1)
|
||||||
for _, cc := range clients {
|
for _, cc := range clients {
|
||||||
go func(c *clientv3.Client) {
|
go func(c *clientv3.Client) {
|
||||||
for op := range putreqc {
|
for op := range putreqc {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user