Skip to content

Commit

Permalink
tests/riot.go add delay param
Browse files Browse the repository at this point in the history
  • Loading branch information
suizman authored and iknite committed Feb 19, 2019
1 parent 02d6b39 commit d50a062
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/riot.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var (
numRequests int
readConcurrency int
writeConcurrency int
delay_ms int
)

func init() {
Expand All @@ -62,6 +63,7 @@ func init() {
flag.StringVar(&endpoint, "endpoint", "http://localhost:8800", "The endopoint to make the load")
flag.StringVar(&apiKey, "apikey", "my-key", "The key to use qed servers")
flag.BoolVar(&wantAdd, "add", false, "Execute add benchmark")
flag.IntVar(&delay_ms, "delay", 0, "Set request delay in milliseconds")

usage := "Benchmark MembershipProof"
flag.BoolVar(&wantMembership, "membership", false, usage)
Expand Down Expand Up @@ -165,6 +167,8 @@ func Attacker(goRoutineId int, c *Config, f func(j int, c *Config) ([]byte, erro

_, _ = io.Copy(ioutil.Discard, res.Body)
res.Body.Close()

c.delay_ms = time.Duration(delay_ms)
time.Sleep(c.delay_ms * time.Millisecond)
}
c.counter = 0
Expand Down

0 comments on commit d50a062

Please sign in to comment.