use of org.voltdb.client.ClientStats in project voltdb by VoltDB.
the class ScanBenchmark method printResults.
/**
* Prints the results of the voting simulation and statistics
* about performance.
*
* @throws Exception if anything unexpected happens.
*/
public synchronized void printResults() throws Exception {
ClientStats stats = fullStatsContext.fetch().getStats();
// 3. Performance statistics
System.out.print(HORIZONTAL_RULE);
System.out.println(" Client Workload Statistics");
System.out.println(HORIZONTAL_RULE);
double averageTimePerScan = (benchmarkEndTS - benchmarkStartTS) / (double) config.runs;
double tuplesPerSecond = (config.rows / averageTimePerScan) * 1000.0;
System.out.printf("Each of %d %s scans of %d tuples took %.2fms for a throughput of %.2f tuples/second.\n", config.runs, config.test, config.rows, averageTimePerScan, tuplesPerSecond);
PrintWriter outputStream = null;
if (config.statsfile != "") {
try {
outputStream = new PrintWriter(new FileWriter(config.statsfile));
// for stats: duration in milliseconds, # iterations (# rows in this case)
outputStream.printf("0,%f,%d,0,0,0,0,0,0,0,0,0,0\n", averageTimePerScan, config.rows);
} catch (Exception e) {
System.err.println("ERROR unable to write stats file");
System.err.println(e);
System.exit(1);
} finally {
outputStream.close();
}
}
}
use of org.voltdb.client.ClientStats in project voltdb by VoltDB.
the class OneShotBenchmark method printStatistics.
/**
* 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());
System.out.printf("Avg/95%% Latency %.2f/%.2fms\n", stats.getAverageLatency(), stats.kPercentileLatencyAsDouble(0.95));
stats = mpPeriodicStatsContext.fetchAndResetBaseline().getStats();
System.out.printf("%02d:%02d:%02d ", time / 3600, (time / 60) % 60, time % 60);
System.out.printf("MP 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));
}
use of org.voltdb.client.ClientStats in project voltdb by VoltDB.
the class MaterializedViewBenchmark method printStatistics.
/**
* 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("Txns Completed %d ", stats.getInvocationsCompleted());
System.out.printf("Avg/95%% Latency %.2f/%.2fms\n", stats.getAverageLatency(), stats.kPercentileLatencyAsDouble(0.95));
System.out.println("");
}
use of org.voltdb.client.ClientStats in project voltdb by VoltDB.
the class MaterializedViewBenchmark method printResults.
/**
* Prints the results and statistics about performance.
*
* @param procedure The name of the stored procedure that was tested.
* @throws Exception if anything unexpected happens.
*/
public synchronized void printResults(String procedure) throws Exception {
ClientStats stats = fullStatsContext.fetchAndResetBaseline().getStats();
double execTimeInMicroSec = 0.0;
// 1. Results and performance statistics
System.out.print(HORIZONTAL_RULE);
System.out.println(" Results");
System.out.println(HORIZONTAL_RULE);
System.out.printf("Average throughput: %,9d txns/sec\n", stats.getTxnThroughput());
VoltTable procStats = client.callProcedure("@Statistics", "procedureprofile", 0).getResults()[0];
while (procStats.advanceRow()) {
String procName = procStats.getString("PROCEDURE");
if (procName.equals(procedure)) {
execTimeInMicroSec = (procStats.getLong("AVG") / 1000.0);
System.out.printf("Average execution time: %,9f usec\n", execTimeInMicroSec);
break;
}
}
}
use of org.voltdb.client.ClientStats in project voltdb by VoltDB.
the class MaterializedViewBenchmark method printResults.
/**
* Prints the results and statistics about performance.
*
* @param procedure The name of the stored procedure that was tested. fw File writer object to write stats to.
* suffix Label for the row in the csv file.
* @throws Exception if anything unexpected happens.
*/
public synchronized void printResults(String procedure, FileWriter fw, String suffix) throws Exception {
ClientStats stats = fullStatsContext.fetchAndResetBaseline().getStats();
double execTimeInMicroSec = 0.0;
// 1. Results and performance statistics
System.out.print(HORIZONTAL_RULE);
System.out.println(" Results");
System.out.println(HORIZONTAL_RULE);
System.out.printf("Average throughput: %,9d txns/sec\n", stats.getTxnThroughput());
VoltTable procStats = client.callProcedure("@Statistics", "procedureprofile", 0).getResults()[0];
while (procStats.advanceRow()) {
String procName = procStats.getString("PROCEDURE");
if (procName.equals(procedure)) {
execTimeInMicroSec = (procStats.getLong("AVG") / 1000.0);
System.out.printf("Average execution time: %,9f usec\n", execTimeInMicroSec);
break;
}
}
// 3. Write stats to file if requested
fw.append(String.format("%s,%d,-1,%d,0,0,0,%.2f,0,0,0,0,0,0\n", suffix, stats.getStartTimestamp(), stats.getTxnThroughput(), execTimeInMicroSec));
}
Aggregations