Skip to content

Commit

Permalink
webrtc-load-tester: Randomize player start interval
Browse files Browse the repository at this point in the history
  • Loading branch information
victorges committed Dec 7, 2023
1 parent 54a8793 commit c680674
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/webrtc-load-tester/roles/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"flag"
"fmt"
"log"
"math/rand"
"net/url"
"os"
"strings"
Expand Down Expand Up @@ -93,7 +94,8 @@ func runPlayerTest(args playerArguments) {
i := i // avoid go's loop variable capture

if args.PlayerStartInterval > 0 {
time.Sleep(args.PlayerStartInterval)
dur := (0.5 + rand.Float64()) * float64(args.PlayerStartInterval)
time.Sleep(time.Duration(dur))
}

go func() {
Expand Down

0 comments on commit c680674

Please sign in to comment.