}
protected void addToChart(ComparisonChart chart, String subCategory, String operation, StatisticType statisticType, Map<Report, List<Aggregation>> reportAggregationMap) {
for (Map.Entry<Report, List<Aggregation>> entry : reportAggregationMap.entrySet()) {
for (Aggregation aggregation : entry.getValue()) {
OperationStats operationStats = aggregation.totalStats.getOperationsStats().get(operation);
if (operationStats == null) continue;
String categoryName = entry.getKey().getConfiguration().name;
if (subCategory != null)
categoryName = String.format("%s, %s", categoryName, subCategory);
double subCategoryNumeric;
String subCategoryValue;
if (maxIterations > 1) {
subCategoryNumeric = aggregation.iteration.id;
subCategoryValue = aggregation.iteration.getValue() != null ? aggregation.iteration.getValue() : String.valueOf(aggregation.iteration.id);
} else {
subCategoryNumeric = entry.getKey().getCluster().getSize();
subCategoryValue = String.format("Size %.0f", subCategoryNumeric);
}
switch (statisticType) {
case MEAN_AND_DEV: {
MeanAndDev meanAndDev = operationStats.getRepresentation(MeanAndDev.class);
if (meanAndDev == null) continue;
chart.addValue(toMillis(meanAndDev.mean), toMillis(meanAndDev.dev), categoryName, subCategoryNumeric, subCategoryValue);
break;
}
case ACTUAL_THROUGHPUT: {
Throughput throughput = operationStats.getRepresentation(Throughput.class,
aggregation.totalThreads, aggregation.totalStats.getEnd() - aggregation.totalStats.getBegin());
if (throughput == null) continue;
chart.addValue(toMillis(throughput.actual), 0, categoryName, subCategoryNumeric, subCategoryValue);
}
}