Skip to content

Commit

Permalink
fix bug when duration and slurpmode was specified
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwelin committed Jun 11, 2020
1 parent 68522b3 commit 1c2ef1f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/client/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,20 @@ func (c *Cassowary) Coordinate() (ResultMetrics, error) {
nextTick := durationMS / c.Requests
ticker := time.NewTicker(time.Duration(nextTick) * time.Millisecond)
done := make(chan bool)
iter := 0

go func() {
for {
select {
case <-done:
return
case _ = <-ticker.C:
workerChan <- "a"
if c.FileMode {
workerChan <- c.URLPaths[iter]
iter++
} else {
workerChan <- "a"
}
}
}
}()
Expand Down

0 comments on commit 1c2ef1f

Please sign in to comment.