Skip to content

Commit

Permalink
*: address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
coocood committed Feb 14, 2017
1 parent fdc2c7e commit 5383387
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cmd/pd-tso-bench/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ var (
pdAddrs = flag.String("pd", "127.0.0.1:2379", "pd address")
concurrency = flag.Int("C", 100, "concurrency")
num = flag.Int("N", 1000, "number of request per request worker")
sleepFlag = flag.String("sleep", "1ms", "sleep time after a request, used to adjust pressure")
sleep = time.Millisecond
sleep = flag.Duration("sleep", time.Millisecond, "sleep time after a request, used to adjust pressure")
)

func main() {
Expand All @@ -41,10 +40,6 @@ func main() {
if err != nil {
log.Fatal(err)
}
sleep, err = time.ParseDuration(*sleepFlag)
if err != nil {
log.Fatal(err)
}
statsCh := make(chan *stats, *concurrency)
for i := 0; i < *concurrency; i++ {
go reqWorker(pdCli, statsCh)
Expand Down Expand Up @@ -123,7 +118,7 @@ func reqWorker(pdCli pd.Client, statsCh chan *stats) {
}
dur := time.Since(start)
s.update(dur)
time.Sleep(sleep)
time.Sleep(*sleep)
}
statsCh <- s
}

0 comments on commit 5383387

Please sign in to comment.