Jagger
 All Classes Namespaces Files Functions Variables Groups Pages
JLoadProfileRps.java
Go to the documentation of this file.
1 package com.griddynamics.jagger.user.test.configurations.load;
2 
3 import com.griddynamics.jagger.user.test.configurations.load.aux.MaxLoadThreads;
4 import com.griddynamics.jagger.user.test.configurations.load.aux.RequestsPerSecond;
5 import com.griddynamics.jagger.user.test.configurations.load.aux.WarmUpTimeInSeconds;
6 
7 import java.util.Objects;
8 
14 public class JLoadProfileRps implements JLoadProfile {
15 
16  private final long requestsPerSecond;
17  private final long maxLoadThreads;
18  private final long warmUpTimeInSeconds;
19 
26  public JLoadProfileRps(RequestsPerSecond requestsPerSecond, MaxLoadThreads maxLoadThreads, WarmUpTimeInSeconds warmUpTimeInSeconds) {
27  Objects.nonNull(requestsPerSecond);
28  Objects.nonNull(maxLoadThreads);
29  Objects.nonNull(warmUpTimeInSeconds);
30 
31  this.requestsPerSecond = requestsPerSecond.value();
32  this.maxLoadThreads = maxLoadThreads.value();
33  this.warmUpTimeInSeconds = warmUpTimeInSeconds.value();
34  }
35 
42  public static JLoadProfileRps of(RequestsPerSecond requestsPerSecond, MaxLoadThreads maxLoadThreads, WarmUpTimeInSeconds warmUpTimeInSeconds) {
43  return new JLoadProfileRps(requestsPerSecond, maxLoadThreads, warmUpTimeInSeconds);
44  }
45 
46  public long getRequestsPerSecond() {
47  return requestsPerSecond;
48  }
49 
50  public long getMaxLoadThreads() {
51  return maxLoadThreads;
52  }
53 
54  public long getWarmUpTimeInSeconds() {
55  return warmUpTimeInSeconds;
56  }
57 }