1 package com.griddynamics.jagger.user.test.configurations.load;
3 import java.util.ArrayList;
4 import java.util.Collections;
6 import java.util.Objects;
8 import static java.util.Collections.singletonList;
33 private final List<JLoadProfileUsers> userGroups;
34 private final int delayBetweenInvocationsInMilliseconds;
35 private final int tickInterval;
38 this.userGroups = builder.userGroups;
39 this.delayBetweenInvocationsInMilliseconds = builder.delayBetweenInvocationsInMilliseconds;
40 this.tickInterval = builder.tickInterval;
61 return new Builder(userGroup, userGroups);
65 static final int DEFAULT_TICK_INTERVAL = 1000;
66 private final List<JLoadProfileUsers> userGroups;
67 private int delayBetweenInvocationsInMilliseconds;
70 private int tickInterval;
79 Objects.requireNonNull(userGroup);
80 this.userGroups = singletonList(userGroup);
81 this.tickInterval = DEFAULT_TICK_INTERVAL;
92 Objects.requireNonNull(userGroup);
93 ArrayList<JLoadProfileUsers> groups =
new ArrayList<>();
94 groups.add(userGroup);
95 Collections.addAll(groups, userGroups);
96 this.userGroups = groups;
97 this.tickInterval = DEFAULT_TICK_INTERVAL;
113 if (delayBetweenInvocationsInMilliseconds < 0) {
114 throw new IllegalArgumentException(
115 String.format(
"Delay between invocations must be >= 0. Provided value is %s", delayBetweenInvocationsInMilliseconds));
117 this.delayBetweenInvocationsInMilliseconds = delayBetweenInvocationsInMilliseconds;
127 return delayBetweenInvocationsInMilliseconds;