Skip to content

Commit

Permalink
Fix perf-produce cannot be closed (#255)
Browse files Browse the repository at this point in the history
* Fix perf-produce cannot be closed

Signed-off-by: xiaolong.ran <rxl@apache.org>

* fix comments

Signed-off-by: xiaolong.ran <rxl@apache.org>

* fix comments

Signed-off-by: xiaolong.ran <rxl@apache.org>

* fix comments

Signed-off-by: xiaolong.ran <rxl@apache.org>
  • Loading branch information
wolfstudy committed May 19, 2020
1 parent 77f0806 commit e6d73af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions perf/perf-producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ func produce(produceArgs *ProduceArgs, stop <-chan struct{}) {

ch := make(chan float64)

go func() {
go func(stopCh <-chan struct{}) {
var rateLimiter *rate.RateLimiter
if produceArgs.Rate > 0 {
rateLimiter = rate.New(produceArgs.Rate, time.Second)
}

for {
select {
case <-stop:
case <-stopCh:
return
default:
}
Expand All @@ -128,7 +128,7 @@ func produce(produceArgs *ProduceArgs, stop <-chan struct{}) {
ch <- latency
})
}
}()
}(stop)

// Print stats of the publish rate and latencies
tick := time.NewTicker(10 * time.Second)
Expand Down

0 comments on commit e6d73af

Please sign in to comment.