1 package com.griddynamics.jagger.user.test.configurations.load;
3 import com.griddynamics.jagger.user.test.configurations.load.auxiliary.NumberOfUsers;
5 import java.util.Objects;
32 private final long numberOfUsers;
33 private final long lifeTimeInSeconds;
34 private final long startDelayInSeconds;
35 private final double slewRateUsersPerSecond;
38 this.numberOfUsers = builder.numberOfUsers.
value();
39 this.lifeTimeInSeconds = builder.lifeTimeInSeconds;
40 this.startDelayInSeconds = builder.startDelayInSeconds;
41 this.slewRateUsersPerSecond = builder.slewRateUsersPerSecond;
51 return new Builder(numberOfUsers);
56 private long lifeTimeInSeconds;
57 private long startDelayInSeconds;
58 private double slewRateUsersPerSecond;
67 Objects.requireNonNull(numberOfUsers);
69 this.numberOfUsers = numberOfUsers;
70 this.lifeTimeInSeconds = 60 * 60 * 48;
71 this.slewRateUsersPerSecond = numberOfUsers.
value();
86 if (lifeTimeInSeconds <= 0) {
87 throw new IllegalArgumentException(String.format(
"Life time must be > 0. Provided value is %s", lifeTimeInSeconds));
89 this.lifeTimeInSeconds = lifeTimeInSeconds;
98 if (startDelayInSeconds < 0) {
99 throw new IllegalArgumentException(String.format(
"Start delay must be >= 0. Provided value is %s", startDelayInSeconds));
101 this.startDelayInSeconds = startDelayInSeconds;
110 if (slewRateUsersPerSecond <= 0) {
111 throw new IllegalArgumentException(
112 String.format(
"Slew rate users per second must be > 0. Provided value is %s", slewRateUsersPerSecond));
114 this.slewRateUsersPerSecond = slewRateUsersPerSecond;
120 return numberOfUsers;
124 return lifeTimeInSeconds;
128 return startDelayInSeconds;
132 return slewRateUsersPerSecond;