Allow loadgen to run forever
@@ -39,7 +39,8 @@ import (
)
var (
- runFor = flag.Duration("run_for", 5*time.Second, "how long to run the load test for")
+ runFor = flag.Duration("run_for", 5*time.Second,
+ "how long to run the load test for; 0 to run forever until SIGTERM")
scratchTable = flag.String("scratch_table", "loadtest-scratch", "name of table to use; should not already exist")
csvOutput = flag.String("csv_output", "",
"output path for statistics in .csv format. If this file already exists it will be overwritten.")
@@ -125,7 +126,7 @@ func main() {
var reads, writes stats
stopTime := time.Now().Add(*runFor)
var wg sync.WaitGroup
- for time.Now().Before(stopTime) {
+ for time.Now().Before(stopTime) || *runFor == 0 {
sem <- 1
wg.Add(1)
go func() {
