}
public void printEndBenchmark(Context context, long timeNanos,
OutputStream stream) throws IOException {
PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(stream)));
Joiner joiner = Joiner.on(",");
long seconds = NANOSECONDS.toSeconds(timeNanos);
double nsPerRow = Math.floor(timeNanos / (double) rowMeter.count());
double msecPerRow = NANOSECONDS.toMillis((long) nsPerRow);
double rawMBPerNs = hiveStats.getRawSizeInMB() / timeNanos;
double rawMBPerSec = SECONDS.toNanos((long) rawMBPerNs);
double totalMBPerNs = hiveStats.getTotalSizeInMB() / timeNanos;
double totalMBPerSec = BYTE.toMB(SECONDS.toNanos((long) totalMBPerNs));
writer.println(joiner.join(rowMeter.count(), rawMBMeter.count(),
seconds, context.opts.threads, msecPerRow, rawMBPerSec, totalMBPerSec));
writer.flush();
}