
org.nohope.test.stress.result.StressScenarioResult Maven / Gradle / Ivy
The newest version!
package org.nohope.test.stress.result;
import org.nohope.test.stress.InvocationException;
import org.nohope.test.stress.result.metrics.StressMetrics;
import org.nohope.test.stress.util.Measurement;
import org.nohope.test.stress.util.Memory;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
/**
* @author Ketoth Xupack
* @since 2015-04-29 15:05
*/
public class StressScenarioResult {
@SuppressWarnings({"AssignmentToCollectionOrArrayFieldFromParameter", "ReturnOfCollectionOrArrayField"})
public static class ActionStats {
private final Map> timesPerThread;
private final Map> errorStats;
private final String actionName;
public ActionStats(final Map> timesPerThread,
final Map> errorStats,
final String actionName) {
this.timesPerThread = timesPerThread;
this.errorStats = errorStats;
this.actionName = actionName;
}
public Map> getTimesPerThread() {
return timesPerThread;
}
public Map> getErrorStats() {
return errorStats;
}
public String getActionName() {
return actionName;
}
}
private final Collection accumulators = new ArrayList<>();
private final Collection metrics = new ArrayList<>();
private final long startNanos;
private final long endNanos;
private final int threadsNumber;
private final int cycleCount;
private final Memory memoryStart;
private final Memory memoryEnd;
public StressScenarioResult(final int threadsNumber,
final int cycleCount,
final long startNanos,
final long endNanos,
final Collection accumulators,
final Collection metrics,
final Memory memoryStart,
final Memory memoryEnd) {
this.startNanos = startNanos;
this.endNanos = endNanos;
this.threadsNumber = threadsNumber;
this.cycleCount = cycleCount;
this.accumulators.addAll(accumulators);
this.metrics.addAll(metrics);
this.memoryStart = memoryStart;
this.memoryEnd = memoryEnd;
}
public T interpret(final Interpreter interpreter) {
return interpreter.interpret(this);
}
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy