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;
13 private final long numberOfUsers;
14 private final long lifeTimeInSeconds;
15 private final long startDelayInSeconds;
16 private final long slewRateUsersPerSecond;
19 this.numberOfUsers = builder.numberOfUsers.
value();
20 this.lifeTimeInSeconds = builder.lifeTimeInSeconds;
21 this.startDelayInSeconds = builder.startDelayInSeconds;
22 this.slewRateUsersPerSecond = builder.slewRateUsersPerSecond;
32 return new Builder(numberOfUsers);
37 private long lifeTimeInSeconds;
38 private long startDelayInSeconds;
39 private long slewRateUsersPerSecond;
48 Objects.requireNonNull(numberOfUsers);
50 this.numberOfUsers = numberOfUsers;
51 this.lifeTimeInSeconds = 60 * 60 * 48;
52 this.slewRateUsersPerSecond = numberOfUsers.
value();
67 if (lifeTimeInSeconds <= 0) {
68 throw new IllegalArgumentException(String.format(
"Life time must be > 0. Provided value is %s", lifeTimeInSeconds));
70 this.lifeTimeInSeconds = lifeTimeInSeconds;
79 if (startDelayInSeconds < 0) {
80 throw new IllegalArgumentException(String.format(
"Start delay must be >= 0. Provided value is %s", startDelayInSeconds));
82 this.startDelayInSeconds = startDelayInSeconds;
91 if (slewRateUsersPerSecond <= 0) {
92 throw new IllegalArgumentException(
93 String.format(
"Slew rate users per second must be > 0. Provided value is %s", slewRateUsersPerSecond));
95 this.slewRateUsersPerSecond = slewRateUsersPerSecond;
101 return numberOfUsers;
105 return lifeTimeInSeconds;
109 return startDelayInSeconds;
113 return slewRateUsersPerSecond;