use of org.apache.lucene.benchmark.byTask.stats.TaskStats in project lucene-solr by apache.
the class RepSumByPrefTask method reportSumByPrefix.
protected Report reportSumByPrefix(List<TaskStats> taskStats) {
// aggregate by task name
int reported = 0;
LinkedHashMap<String, TaskStats> p2 = new LinkedHashMap<>();
for (final TaskStats stat1 : taskStats) {
if (stat1.getElapsed() >= 0 && stat1.getTask().getName().startsWith(prefix)) {
// only ended tasks with proper name
reported++;
String name = stat1.getTask().getName();
TaskStats stat2 = p2.get(name);
if (stat2 == null) {
try {
stat2 = stat1.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
p2.put(name, stat2);
} else {
stat2.add(stat1);
}
}
}
// now generate report from secondary list p2
return genPartialReport(reported, p2, taskStats.size());
}
Aggregations