private int samples = 3;
private int period = 1000*5;
private TxPageFileFactory hawtPageFileFactory;
public void benchmark(int actorCount, BenchmarkAction<A> action) throws Exception {
TxPageFileFactory pff = getHawtPageFileFactory();
pff.getFile().delete();
pff.open();
try {
if( setup!=null ) {
setup.run(pff);
}
TxPageFile pf = pff.getTxPageFile();
Benchmarker benchmark = new Benchmarker();
benchmark.setSamples(samples);
benchmark.setPeriod(period);
benchmark.setName(action.getName());
ArrayList<A> actors = createActors(pf, actorCount, action);
benchmark.benchmark(actors, createMetrics(action));
} finally {
try {
if( tearDown!=null ) {
tearDown.run(pff);
}
} finally {
pff.close();
}
}
}