// Systemspeziefischen Zeilenumbruch holen
String lineSeparator = RegainToolkit.getLineSeparator();
// Statistik ausgeben
StringBuffer buffer = new StringBuffer(mName + ":");
NumberFormat integerFormat = NumberFormat.getInstance();
integerFormat.setMaximumFractionDigits(0);
if (abortedMeasureCount > 0) {
buffer.append(lineSeparator);
appendLabel(buffer, "Aborted " + mUnit, minLabelLength);
buffer.append(integerFormat.format(abortedMeasureCount) + " " + mUnit + " (");
// Ausgeben, wieviel % der Messungen fehl schlugen
int total = abortedMeasureCount + measureCount;
double errorPercent = (double) abortedMeasureCount / (double) total;
buffer.append(RegainToolkit.toPercentString(errorPercent));
buffer.append(")");
}
if (measureCount > 0) {
buffer.append(lineSeparator);
appendLabel(buffer, "Completed " + mUnit, minLabelLength);
buffer.append(integerFormat.format(measureCount) + " " + mUnit + lineSeparator);
appendLabel(buffer, "Total time", minLabelLength);
buffer.append(RegainToolkit.toTimeString(totalTime) + lineSeparator);
appendLabel(buffer, "Total data", minLabelLength);
buffer.append(RegainToolkit.bytesToString(totalBytes) + lineSeparator);
appendLabel(buffer, "Average time", minLabelLength);
buffer.append(RegainToolkit.toTimeString(averageTime) + lineSeparator);
appendLabel(buffer, "Average data", minLabelLength);
buffer.append(RegainToolkit.bytesToString(averageBytes) + lineSeparator);
appendLabel(buffer, "Data rate", minLabelLength);
buffer.append(RegainToolkit.bytesToString(dataRatePerSec) + "/sec" + lineSeparator);
appendLabel(buffer, "Output", minLabelLength);
if (countsPerMinute > 10) {
// No decimals when the count is high
buffer.append(integerFormat.format(countsPerMinute) + " " + mUnit + "/min");
} else {
NumberFormat floatingFormat = NumberFormat.getInstance();
floatingFormat.setMinimumFractionDigits(2);
floatingFormat.setMaximumFractionDigits(2);
buffer.append(floatingFormat.format(countsPerMinute) + " " + mUnit + "/min");
}
}
return buffer.toString();
}