benchmark: submit keepalive requests concurrently with report.Run()

Otherwise report won't consume the results and the benchmark hangs.
This commit is contained in:
Anthony Romano 2016-10-07 15:55:42 -07:00
parent 71f8f3ceb6
commit c1d115b322

View File

@ -68,10 +68,14 @@ func leaseKeepaliveFunc(cmd *cobra.Command, args []string) {
}(clients[i]) }(clients[i])
} }
wg.Add(1)
go func() {
defer wg.Done()
for i := 0; i < leaseKeepaliveTotal; i++ { for i := 0; i < leaseKeepaliveTotal; i++ {
requests <- struct{}{} requests <- struct{}{}
} }
close(requests) close(requests)
}()
rc := r.Run() rc := r.Run()
wg.Wait() wg.Wait()