Fields Summary |
---|
protected static final String | newline |
protected static final String | OPGet a textual summary of the benchmark results, average from all test runs. |
protected static final String | ROUND |
protected static final String | RUNCNT |
protected static final String | RECCNT |
protected static final String | RECSEC |
protected static final String | ELAPSED |
protected static final String | USEDMEM |
protected static final String | TOTMEM |
protected static final String[] | COLS |
Methods Summary |
---|
protected org.apache.lucene.benchmark.byTask.stats.Report | genPartialReport(int reported, java.util.LinkedHashMap partOfTasks, int totalSize)
String longetOp = longestOp(partOfTasks.values().iterator());
boolean first = true;
StringBuffer sb = new StringBuffer();
sb.append(tableTitle(longetOp));
sb.append(newline);
int lineNum = 0;
for (Iterator it = partOfTasks.values().iterator(); it.hasNext();) {
TaskStats stat = (TaskStats) it.next();
if (!first) {
sb.append(newline);
}
first = false;
String line = taskReportLine(longetOp,stat);
lineNum++;
if (partOfTasks.size()>2 && lineNum%2==0) {
line = line.replaceAll(" "," - ");
}
sb.append(line);
}
String reptxt = (reported==0 ? "No Matching Entries Were Found!" : sb.toString());
return new Report(reptxt,partOfTasks.size(),reported,totalSize);
|
protected java.lang.String | longestOp(java.util.Iterator taskStats)find the longest op name out of completed tasks.
String longest = OP;
while (taskStats.hasNext()) {
TaskStats stat = (TaskStats) taskStats.next();
if (stat.getElapsed()>=0) { // consider only tasks that ended
String name = stat.getTask().getName();
if (name.length() > longest.length()) {
longest = name;
}
}
}
return longest;
|
protected boolean | shouldNeverLogAtStart()
return true;
|
protected boolean | shouldNotRecordStats()
return true;
|
protected java.lang.String | tableTitle(java.lang.String longestOp)Compute a title line for a report table
StringBuffer sb = new StringBuffer();
sb.append(Format.format(OP,longestOp));
sb.append(ROUND);
sb.append(getRunData().getConfig().getColsNamesForValsByRound());
for (int i = 0; i < COLS.length; i++) {
sb.append(COLS[i]);
}
return sb.toString();
|
protected java.lang.String | taskReportLine(java.lang.String longestOp, org.apache.lucene.benchmark.byTask.stats.TaskStats stat)Compute a report line for the given task stat.
PerfTask task = stat.getTask();
StringBuffer sb = new StringBuffer();
sb.append(Format.format(task.getName(), longestOp));
String round = (stat.getRound()>=0 ? ""+stat.getRound() : "-");
sb.append(Format.formatPaddLeft(round, ROUND));
sb.append(getRunData().getConfig().getColsValuesForValsByRound(stat.getRound()));
sb.append(Format.format(stat.getNumRuns(), RUNCNT));
sb.append(Format.format(stat.getCount() / stat.getNumRuns(), RECCNT));
long elapsed = (stat.getElapsed()>0 ? stat.getElapsed() : 1); // assume at least 1ms
sb.append(Format.format(1,(float) (stat.getCount() * 1000.0 / elapsed), RECSEC));
sb.append(Format.format(2, (float) stat.getElapsed() / 1000, ELAPSED));
sb.append(Format.format(0, (float) stat.getMaxUsedMem() / stat.getNumRuns(), USEDMEM));
sb.append(Format.format(0, (float) stat.getMaxTotMem() / stat.getNumRuns(), TOTMEM));
return sb.toString();
|