I am trying to benchmark the test executions of a parameterized junit test class. Below is the sample code
@BenchmarkOptions(benchmarkRounds = 5, warmupRounds = 2)
@BenchmarkMethodChart(filePrefix = "benchmarkTest-benchmarks")
@RunWith(Parameterized.class)
public class BenchmarkTest extends AbstractBenchmark {
private String fileName;
private Logger logger = LoggerFactory.getLogger(BenchmarkTest.class);
public BenchmarkTest(String fileName) {
this.fileName = fileName;
}
@Parameterized.Parameters
public static Collection<Object[]> data() {
Object[][] data = new Object[][] { { "F1" }, { "F2" }, { "F3" } };
return Arrays.asList(data);
}
@Test
public void testNothing() {
long startTime = System.currentTimeMillis();
while (System.currentTimeMillis() - startTime < 500) {
//do nothing
}
}
}
The bar chart in "benchmarkTest-benchmarks.html" has the same test method name for all the different executions of various parameter values. Better would be to have "testNothing[0]", "testNothing[1]" and "testNothing[2]" where the indexes map to array indexes. My console shows this but the bar chart doesn't.
Any configuration options which I may be missing?
Thanks !