Search in sources :

Example 26 with ClientStats

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();
        }
    }
}
Also used : ClientStats(org.voltdb.client.ClientStats) FileWriter(java.io.FileWriter) PrintWriter(java.io.PrintWriter)

Example 27 with ClientStats

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));
}
Also used : ClientStats(org.voltdb.client.ClientStats)

Example 28 with ClientStats

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("");
}
Also used : ClientStats(org.voltdb.client.ClientStats)

Example 29 with ClientStats

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;
        }
    }
}
Also used : ClientStats(org.voltdb.client.ClientStats) VoltTable(org.voltdb.VoltTable)

Example 30 with ClientStats

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));
}
Also used : ClientStats(org.voltdb.client.ClientStats) VoltTable(org.voltdb.VoltTable)

Aggregations

ClientStats (org.voltdb.client.ClientStats)65 VoltTable (org.voltdb.VoltTable)8 FileWriter (java.io.FileWriter)4 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 Date (java.util.Date)4 CallableStatement (java.sql.CallableStatement)3 ClientStatsContext (org.voltdb.client.ClientStatsContext)3 IVoltDBConnection (org.voltdb.jdbc.IVoltDBConnection)3 PreparedStatement (java.sql.PreparedStatement)2 Timer (java.util.Timer)2 TimerTask (java.util.TimerTask)2 ClientAffinityStats (org.voltdb.client.ClientAffinityStats)2 NoConnectionsException (org.voltdb.client.NoConnectionsException)2 BoneCPConfig (com.jolbox.bonecp.BoneCPConfig)1 BoneCPDataSource (com.jolbox.bonecp.BoneCPDataSource)1 ComboPooledDataSource (com.mchange.v2.c3p0.ComboPooledDataSource)1 HikariConfig (com.zaxxer.hikari.HikariConfig)1 HikariDataSource (com.zaxxer.hikari.HikariDataSource)1 File (java.io.File)1