Jagger
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
RequestsPerSecond.java
Go to the documentation of this file.
1 package com.griddynamics.jagger.user.test.configurations.load.auxiliary;
2 
7 public final class RequestsPerSecond {
8  private final long requestsPerSecond;
9 
10  RequestsPerSecond(long requestsPerSecond) {
11  if (requestsPerSecond <= 0) {
12  throw new IllegalArgumentException(
13  String.format("Requests per second must be > 0. Provided value is %s", requestsPerSecond));
14  }
15  this.requestsPerSecond = requestsPerSecond;
16  }
17 
18  public long value() {
19  return requestsPerSecond;
20  }
21 
22  public static RequestsPerSecond of(long requestsPerSecond) {
23  return new RequestsPerSecond(requestsPerSecond);
24  }
25 }