Browse Source

Merge pull request #6610 from heyitsanthony/bench-lease

benchmark: submit keepalive requests concurrently with report.Run()
Anthony Romano 9 years ago
parent
commit
3a6fe61c03
1 changed files with 8 additions and 4 deletions
  1. 8 4
      tools/benchmark/cmd/lease.go

+ 8 - 4
tools/benchmark/cmd/lease.go

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