use of com.hazelcast.simulator.test.annotations.AfterRun in project hazelcast-simulator by hazelcast.
the class TimeStepModel method loadAfterRunMethods.
private void loadAfterRunMethods() {
List<Method> methods = new AnnotatedMethodRetriever(testClass, AfterRun.class).findAll();
validateModifiers(methods);
validateBeforeAndAfterRunArguments(AfterRun.class.getSimpleName(), methods);
for (Method method : methods) {
AfterRun afterRun = method.getAnnotation(AfterRun.class);
String executionGroupName = afterRun.executionGroup();
ensureExecutionGroupIsIdentifier(method, executionGroupName);
ExecutionGroup executionGroup = executionGroups.get(executionGroupName);
if (executionGroup == null) {
if (executionGroupName.equals("")) {
throw new IllegalTestException("@AfterRun " + method + " is part of default executionGroup," + " but no timeStep methods for that executionGroup exist ");
} else {
throw new IllegalTestException("@AfterRun " + method + " is part of executionGroup [" + executionGroupName + "], but no timeStep methods for that executionGroup exist ");
}
}
executionGroup.afterRunMethods.add(method);
}
}
use of com.hazelcast.simulator.test.annotations.AfterRun in project hazelcast-simulator by hazelcast.
the class CardinalityEstimatorTest method afterRun.
@AfterRun
public void afterRun(ThreadState state) {
// for each worker-thread we store the number of items it has produced for each estimator.
for (int k = 0; k < estimatorCount; k++) {
CardinalityEstimator estimator = estimators[k];
// the number of unique items produced is equal to the iteration. If items 0,10,20 are produced,
// then iteration is 3.
long iteration = state.iterations[k];
expectedCountMap.executeOnKey(estimator.getName(), new IncEntryProcessor(iteration));
}
}
Aggregations