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;
24 private final List<JLoadProfileUsers> userGroups;
25 private final int delayBetweenInvocationsInSeconds;
26 private final int tickInterval;
29 this.userGroups = builder.userGroups;
30 this.delayBetweenInvocationsInSeconds = builder.delayBetweenInvocationsInSeconds;
31 this.tickInterval = builder.tickInterval;
52 return new Builder(userGroup, userGroups);
56 static final int DEFAULT_TICK_INTERVAL = 1000;
57 private final List<JLoadProfileUsers> userGroups;
58 private int delayBetweenInvocationsInSeconds;
61 private int tickInterval;
70 Objects.requireNonNull(userGroup);
71 this.userGroups = singletonList(userGroup);
72 this.tickInterval = DEFAULT_TICK_INTERVAL;
83 Objects.requireNonNull(userGroup);
84 ArrayList<JLoadProfileUsers> groups =
new ArrayList<>();
85 groups.add(userGroup);
86 Collections.addAll(groups, userGroups);
87 this.userGroups = groups;
88 this.tickInterval = DEFAULT_TICK_INTERVAL;
104 if (delayBetweenInvocationsInSeconds < 0) {
105 throw new IllegalArgumentException(
106 String.format(
"Delay between invocations must be >= 0. Provided value is %s", delayBetweenInvocationsInSeconds));
108 this.delayBetweenInvocationsInSeconds = delayBetweenInvocationsInSeconds;
118 return delayBetweenInvocationsInSeconds;