/** * Prints a one line update on performance that can be printed periodically during a benchmark. */ public synchronized void printStatistics() { ClientStats stats = periodicStatsContext.fetchAndResetBaseline().getStats(); long time = Math.round((stats.getEndTimestamp() - benchmarkStartTS) / 1000.0); System.out.printf("%02d:%02d:%02d ", time / 3600, (time / 60) % 60, time % 60); System.out.printf("Throughput %d/s, ", stats.getTxnThroughput()); System.out.printf( "Aborts/Failures %d/%d, ", stats.getInvocationAborts(), stats.getInvocationErrors()); // cast to stats.getAverageLatency from long to double System.out.printf( "Avg/95%% Latency %.2f/%dms\n", (double) stats.getAverageLatency(), stats.kPercentileLatency(0.95)); }
/** * Prints a one line update on performance that can be printed periodically during a benchmark. */ private static synchronized void printStatistics( ClientStatsContext context, boolean resetBaseline) { if (resetBaseline) { context = context.fetchAndResetBaseline(); } else { context = context.fetch(); } ClientStats stats = context.getStatsByProc().get(config.procedure); if (stats == null) return; long time = Math.round((stats.getEndTimestamp() - benchmarkStartTS) / 1000.0); System.out.printf("%02d:%02d:%02d ", time / 3600, (time / 60) % 60, time % 60); System.out.printf("Throughput %d/s, ", stats.getTxnThroughput()); System.out.printf( "Aborts/Failures %d/%d, ", stats.getInvocationAborts(), stats.getInvocationErrors()); System.out.printf( "Avg/95%% Latency %.2f/%.2fms\n", stats.getAverageLatency(), stats.kPercentileLatencyAsDouble(0.95)); }
/** * Prints a one line update on performance that can be printed periodically during a benchmark. */ public synchronized void printStatistics() { try { ClientStats stats = periodicStatsContext.fetchAndResetBaseline().getStats(); System.out.printf("%s ", dateformat(getTime())); System.out.printf("Throughput %d/s, ", stats.getTxnThroughput()); System.out.printf( "Aborts/Failures %d/%d, ", stats.getInvocationAborts(), stats.getInvocationErrors()); System.out.printf( "Avg/95%% Latency %.2f/%dms\n", stats.getAverageLatency(), stats.kPercentileLatency(0.95)); if (totalConnections.get() == -1 && stats.getTxnThroughput() == 0) { if (!config.recover) { String errMsg = "Lost all connections. Exit..."; exitOnError(errMsg); } } } catch (Exception e) { String msg = "In printStatistics. We got an exception: '" + e.getMessage() + "'!!"; prt(msg); } }