}
}
@Test
public void testSizeCalculation() {
TestOptions opts = new PerformanceEvaluation.TestOptions();
opts = PerformanceEvaluation.calculateRowsAndSize(opts);
int rows = opts.getPerClientRunRows();
// Default row count
final int defaultPerClientRunRows = 1024 * 1024;
assertEquals(defaultPerClientRunRows, rows);
// If size is 2G, then twice the row count.
opts.setSize(2.0f);
opts = PerformanceEvaluation.calculateRowsAndSize(opts);
assertEquals(defaultPerClientRunRows * 2, opts.getPerClientRunRows());
// If two clients, then they get half the rows each.
opts.setNumClientThreads(2);
opts = PerformanceEvaluation.calculateRowsAndSize(opts);
assertEquals(defaultPerClientRunRows, opts.getPerClientRunRows());
// What if valueSize is 'random'? Then half of the valueSize so twice the rows.
opts.valueRandom = true;
opts = PerformanceEvaluation.calculateRowsAndSize(opts);
assertEquals(defaultPerClientRunRows * 2, opts.getPerClientRunRows());
}