// Path: junitperf-core/src/main/java/com/github/noconnor/junitperf/datetime/DatetimeUtils.java
// @UtilityClass
// public class DatetimeUtils {
// 
//   @Setter
//   private static String override;
// 
//   public static String now() {
//     if (nonNull(override)) {
//       return override;
//     }
//     return LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
//   }
// 
//   public static String format(int durationMs) {
//     long seconds = durationMs / 1000;
//     long minutes = seconds / 60;
//     long hours = minutes / 60;
//     long days = hours / 24;
//     if (days > 0){
//       return days + "d:" + hours % 24 + "h:" + minutes % 60 + "m:" + seconds % 60 + "s";
//     } else if (hours > 0){
//       return hours % 24 + "h:" + minutes % 60 + "m:" + seconds % 60 + "s";
//     } else if (minutes > 0){
//       return minutes % 60 + "m:" + seconds % 60 + "s";
//     } if (seconds > 0){
//       return (seconds % 60) + "s";
//     } else {
//       return durationMs + "ms";
//     }
//   }
// }
// 
// Path: junitperf-core/src/main/java/com/github/noconnor/junitperf/statistics/StatisticsCalculator.java
// public interface StatisticsCalculator {
// 
//   void addLatencyMeasurement(long executionTimeNs);
// 
//   void incrementErrorCount();
// 
//   void incrementEvaluationCount();
// 
//   long getErrorCount();
// 
//   long getEvaluationCount();
// 
//   float getLatencyPercentile(int percentile, TimeUnit unit);
// 
//   float getMaxLatency(TimeUnit unit);
// 
//   float getMinLatency(TimeUnit unit);
// 
//   float getMeanLatency(TimeUnit unit);
// 
//   float getErrorPercentage();
// 
//   void reset();
// 
// }


import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Maps.newTreeMap;
import static java.util.Collections.emptyMap;
import static java.util.Objects.nonNull;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.stream.IntStream.range;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import com.github.noconnor.junitperf.JUnitPerfTest;
import com.github.noconnor.junitperf.JUnitPerfTestRequirement;
import com.github.noconnor.junitperf.datetime.DatetimeUtils;
import com.github.noconnor.junitperf.statistics.StatisticsCalculator;
import com.google.common.primitives.Floats;
import com.google.common.primitives.Ints;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.tuple.ImmutablePair;

  @Getter
  private int configuredThreads;
  @Getter
  private int configuredDuration;
  @Getter
  private int configuredWarmUp;
  @Getter
  private int configuredRateLimit;
  @Getter
  private int configuredRampUpPeriodMs;
  @Getter
  private long startTimeNs;
  @Getter
  private boolean isAsyncEvaluation;

  @Getter
  private Map<Integer, Float> requiredPercentiles = emptyMap();
  @Getter
  private int requiredThroughput = 0;
  @Getter
  private float requiredAllowedErrorsRate = 0;
  @Getter
  private float requiredMinLatency = -1;
  @Getter
  private float requiredMaxLatency = -1;
  @Getter
  private float requiredMeanLatency = -1;

  @Setter
// Path: junitperf-core/src/main/java/com/github/noconnor/junitperf/datetime/DatetimeUtils.java
// @UtilityClass
// public class DatetimeUtils {
// 
//   @Setter
//   private static String override;
// 
//   public static String now() {
//     if (nonNull(override)) {
//       return override;
//     }
//     return LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
//   }
// 
//   public static String format(int durationMs) {
//     long seconds = durationMs / 1000;
//     long minutes = seconds / 60;
//     long hours = minutes / 60;
//     long days = hours / 24;
//     if (days > 0){
//       return days + "d:" + hours % 24 + "h:" + minutes % 60 + "m:" + seconds % 60 + "s";
//     } else if (hours > 0){
//       return hours % 24 + "h:" + minutes % 60 + "m:" + seconds % 60 + "s";
//     } else if (minutes > 0){
//       return minutes % 60 + "m:" + seconds % 60 + "s";
//     } if (seconds > 0){
//       return (seconds % 60) + "s";
//     } else {
//       return durationMs + "ms";
//     }
//   }
// }
// 
// Path: junitperf-core/src/main/java/com/github/noconnor/junitperf/statistics/StatisticsCalculator.java
// public interface StatisticsCalculator {
// 
//   void addLatencyMeasurement(long executionTimeNs);
// 
//   void incrementErrorCount();
// 
//   void incrementEvaluationCount();
// 
//   long getErrorCount();
// 
//   long getEvaluationCount();
// 
//   float getLatencyPercentile(int percentile, TimeUnit unit);
// 
//   float getMaxLatency(TimeUnit unit);
// 
//   float getMinLatency(TimeUnit unit);
// 
//   float getMeanLatency(TimeUnit unit);
// 
//   float getErrorPercentage();
// 
//   void reset();
// 
// }


// Path: junitperf-core/src/main/java/com/github/noconnor/junitperf/data/EvaluationContext.java
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Maps.newTreeMap;
import static java.util.Collections.emptyMap;
import static java.util.Objects.nonNull;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.stream.IntStream.range;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import com.github.noconnor.junitperf.JUnitPerfTest;
import com.github.noconnor.junitperf.JUnitPerfTestRequirement;
import com.github.noconnor.junitperf.datetime.DatetimeUtils;
import com.github.noconnor.junitperf.statistics.StatisticsCalculator;
import com.google.common.primitives.Floats;
import com.google.common.primitives.Ints;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.tuple.ImmutablePair;


  @Getter
  private int configuredThreads;
  @Getter
  private int configuredDuration;
  @Getter
  private int configuredWarmUp;
  @Getter
  private int configuredRateLimit;
  @Getter
  private int configuredRampUpPeriodMs;
  @Getter
  private long startTimeNs;
  @Getter
  private boolean isAsyncEvaluation;

  @Getter
  private Map<Integer, Float> requiredPercentiles = emptyMap();
  @Getter
  private int requiredThroughput = 0;
  @Getter
  private float requiredAllowedErrorsRate = 0;
  @Getter
  private float requiredMinLatency = -1;
  @Getter
  private float requiredMaxLatency = -1;
  @Getter
  private float requiredMeanLatency = -1;

  @Setter
  private StatisticsCalculator statistics;