* about performance.
*
* @throws Exception if anything unexpected happens.
*/
public synchronized void printResults() throws Exception {
ClientStats stats = fullStatsContext.fetch().getStats();
// 1. Get/Put performance results
String display = "\n" +
HORIZONTAL_RULE +
" KV Store Results\n" +
HORIZONTAL_RULE +
"\nA total of %,d operations were posted...\n" +
" - GETs: %,9d Operations (%,d Misses and %,d Failures)\n" +
" %,9d MB in compressed store data\n" +
" %,9d MB in uncompressed application data\n" +
" Network Throughput: %6.3f Gbps*\n" +
" - PUTs: %,9d Operations (%,d Failures)\n" +
" %,9d MB in compressed store data\n" +
" %,9d MB in uncompressed application data\n" +
" Network Throughput: %6.3f Gbps*\n" +
" - Total Network Throughput: %6.3f Gbps*\n\n" +
"* Figure includes key & value traffic but not database protocol overhead.\n\n";
double oneGigabit = (1024 * 1024 * 1024) / 8;
long oneMB = (1024 * 1024);
double getThroughput = networkGetData.get() + (successfulGets.get() * config.keysize);
getThroughput /= (oneGigabit * config.duration);
long totalPuts = successfulPuts.get() + failedPuts.get();
double putThroughput = networkGetData.get() + (totalPuts * config.keysize);
putThroughput /= (oneGigabit * config.duration);
System.out.printf(display,
stats.getInvocationsCompleted(),
successfulGets.get(), missedGets.get(), failedGets.get(),
networkGetData.get() / oneMB,
rawGetData.get() / oneMB,
getThroughput,
successfulPuts.get(), failedPuts.get(),
networkPutData.get() / oneMB,
rawPutData.get() / oneMB,
putThroughput,
getThroughput + putThroughput);
// 2. Performance statistics
System.out.print(HORIZONTAL_RULE);
System.out.println(" Client Workload Statistics");
System.out.println(HORIZONTAL_RULE);
System.out.printf("Average throughput: %,9d txns/sec\n", stats.getTxnThroughput());
System.out.printf("Average latency: %,9.2f ms\n", stats.getAverageLatency());
System.out.printf("10th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.1));
System.out.printf("25th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.25));
System.out.printf("50th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.5));
System.out.printf("75th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.75));
System.out.printf("90th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.9));
System.out.printf("95th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.95));
System.out.printf("99th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.99));
System.out.printf("99.5th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.995));
System.out.printf("99.9th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.999));
System.out.printf("99.999th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.99999));
System.out.print("\n" + HORIZONTAL_RULE);
System.out.println(" System Server Statistics");
System.out.println(HORIZONTAL_RULE);
System.out.printf("Reported Internal Avg Latency: %,9.2f ms\n", stats.getAverageInternalLatency());
System.out.print("\n" + HORIZONTAL_RULE);
System.out.println(" Latency Histogram");
System.out.println(HORIZONTAL_RULE);
System.out.println(stats.latencyHistoReport());
// 3. Write stats to file if requested
client.writeSummaryCSV(stats, config.statsfile);
}