/*
* Check if the annotation is present on the class. If so, generate a chart
* for all methods of this class.
*/
final BenchmarkHistoryChart ann = clazz.getAnnotation(BenchmarkHistoryChart.class);
if (ann != null)
{
HistoryChartGenerator gen = new HistoryChartGenerator(
GeneratorUtils.getFilePrefix(clazz, ann.filePrefix(), c.getChartsDir()),
clazz.getName(),
ann.labelWith(),
c);
gen.updateMaxRuns(ann.maxRuns());
updateMinMax(clazz.getAnnotation(AxisRange.class), gen);
gen.generate();
}
/*
* Now check per-method annotations. Partition by file prefix first.
*/
HashMap<String, List<Method>> byPrefix = new HashMap<String, List<Method>>();
for (Method m : methods)
{
BenchmarkHistoryChart methodAnn = m.getAnnotation(BenchmarkHistoryChart.class);
String prefix = GeneratorUtils.getFilePrefix(clazz, methodAnn.filePrefix(), c.getChartsDir());
if (!byPrefix.containsKey(prefix))
{
byPrefix.put(prefix, new ArrayList<Method>());
}
byPrefix.get(prefix).add(m);