Search in sources :

Example 11 with ClientStats

use of org.voltdb.client.ClientStats in project voltdb by VoltDB.

the class RandomDataInserter method printReport.

void printReport() {
    // Get the client stats since the last time this method was called.
    ClientStats stats = periodicStatsContext.fetchAndResetBaseline().getStats();
    System.out.printf("  Insert Statistics:\n" + "    Throughput %d/s, Aborts/Failures %d/%d, Avg/95%% Latency %.2f/%dms\n", stats.getTxnThroughput(), stats.getInvocationAborts(), stats.getInvocationErrors(), stats.getAverageLatency(), stats.kPercentileLatency(0.95));
}
Also used : ClientStats(org.voltdb.client.ClientStats)

Example 12 with ClientStats

use of org.voltdb.client.ClientStats in project voltdb by VoltDB.

the class AggregationBenchmark method runBenchmark.

/**
     * Core benchmark code.
     * Connect. Initialize. Run the loop. Cleanup. Print Results.
     *
     * @throws Exception if anything unexpected happens.
     */
public void runBenchmark() throws Exception {
    // connect to one or more servers, loop until success
    connect(config.servers);
    if (config.restore > 0) {
        System.out.println("\nLoading data from snapshot...");
        restoreDatabase();
    }
    FileWriter fw = null;
    if ((config.statsfile != null) && (config.statsfile.length() != 0)) {
        fw = new FileWriter(config.statsfile);
    }
    System.out.print(HORIZONTAL_RULE);
    System.out.println("\nRunning Benchmark");
    System.out.println(HORIZONTAL_RULE);
    // Benchmark start time
    long queryStartTS, queryElapse;
    int counter = config.invocations;
    String procName = "Q" + config.proc;
    List<Long> m = new ArrayList<Long>();
    System.out.println(String.format("Running procedure %s for the %d times...", procName, counter));
    queryStartTS = System.nanoTime();
    VoltTable vt = null;
    for (int i = 1; i <= counter; i++) {
        vt = client.callProcedure(procName).getResults()[0];
        if (vt.getRowCount() <= 0) {
            System.err.println("ERROR Query %d empty result set");
            System.exit(-1);
        }
    }
    double avg = (double) (System.nanoTime() - queryStartTS) / counter;
    System.out.printf("\n\n(Returned %d rows in average %f us)\n", vt.getRowCount(), avg);
    // block until all outstanding txns return
    client.drain();
    //retrieve stats
    ClientStats stats = fullStatsContext.fetch().getStats();
    // write stats to file
    //client.writeSummaryCSV(stats, config.statsfile);
    fw.append(String.format("%s,%d,-1,0,0,0,0,%f,0,0,0,0,0,0\n", "Q" + String.format("%02d", config.proc), stats.getStartTimestamp(), avg / 1000.0));
    // close down the client connections
    client.close();
    if (fw != null)
        fw.close();
}
Also used : ClientStats(org.voltdb.client.ClientStats) FileWriter(java.io.FileWriter) ArrayList(java.util.ArrayList) AtomicLong(java.util.concurrent.atomic.AtomicLong) VoltTable(org.voltdb.VoltTable)

Example 13 with ClientStats

use of org.voltdb.client.ClientStats in project voltdb by VoltDB.

the class Benchmark 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();
    // 1. Voting Board statistics, Voting results and performance statistics
    String display = "\n" + HORIZONTAL_RULE + " Results\n" + HORIZONTAL_RULE + "\nAstounding success\n";
    System.out.printf(display);
    // 3. 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());
    if (this.config.latencyreport) {
        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.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());
    }
    // 4. Write stats to file if requested
    client.writeSummaryCSV(stats, config.statsfile);
}
Also used : ClientStats(org.voltdb.client.ClientStats)

Example 14 with ClientStats

use of org.voltdb.client.ClientStats in project voltdb by VoltDB.

the class JDBCBenchmark method printStatistics.

/**
     * Prints a one line update on performance that can be printed
     * periodically during a benchmark.
     */
public static 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));
}
Also used : ClientStats(org.voltdb.client.ClientStats)

Example 15 with ClientStats

use of org.voltdb.client.ClientStats in project voltdb by VoltDB.

the class HTTPBenchmark 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();
    // Print an ISO8601 timestamp (of the same kind Python logging uses) to help
    // log merger correlate correctly
    System.out.print(LOG_DF.format(new Date(stats.getEndTimestamp())));
    System.out.printf(" Throughput %d/s, ", stats.getTxnThroughput());
    System.out.printf("Aborts/Failures %d/%d, ", stats.getInvocationAborts(), stats.getInvocationErrors());
    System.out.printf("Avg/99.999%% Latency %.2f/%.2fms\n", stats.getAverageLatency(), stats.kPercentileLatencyAsDouble(0.99999));
    logMetric(stats);
}
Also used : ClientStats(org.voltdb.client.ClientStats) Date(java.util.Date)

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