Search in sources :

Example 21 with ClientStats

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

the class SyncBenchmark 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. 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.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. Affinity stats
    System.out.print("\n" + HORIZONTAL_RULE);
    System.out.println(" Client Affinity Statistics");
    System.out.print(HORIZONTAL_RULE + "\n");
    Map<Integer, ClientAffinityStats> affinityStats = fullStatsContext.fetch().getAffinityStats();
    for (Entry<Integer, ClientAffinityStats> e : affinityStats.entrySet()) {
        System.out.println(e.getValue());
    }
    // 4. Write stats to file if requested
    client.writeSummaryCSV(stats, config.statsfile);
}
Also used : ClientStats(org.voltdb.client.ClientStats) ClientAffinityStats(org.voltdb.client.ClientAffinityStats)

Example 22 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 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 23 with ClientStats

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

the class AsyncBenchmark 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 + " Voting Results\n" + HORIZONTAL_RULE + "\nA total of %d votes were received...\n" + " - %,9d Accepted\n" + " - %,9d Rejected (Invalid Contestant)\n" + " - %,9d Rejected (Maximum Vote Count Reached)\n" + " - %,9d Failed (Transaction Error)\n\n";
    System.out.printf(display, stats.getInvocationsCompleted(), acceptedVotes.get(), badContestantVotes.get(), badVoteCountVotes.get(), failedVotes.get());
    // 2. Voting results
    VoltTable result = client.callProcedure("Results").getResults()[0];
    System.out.println("Contestant Name\t\tVotes Received");
    while (result.advanceRow()) {
        System.out.printf("%s\t\t%,14d\n", result.getString(0), result.getLong(2));
    }
    System.out.printf("\nThe Winner is: %s\n\n", result.fetchRow(0).getString(0));
    // 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());
    System.out.printf("Average latency:               %,9.2f ms\n", stats.getAverageLatency());
    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.print("\n" + HORIZONTAL_RULE);
    System.out.println(" System Server Statistics");
    System.out.println(HORIZONTAL_RULE);
    if (config.autotune) {
        System.out.printf("Targeted Internal Avg Latency: %,9d ms\n", config.latencytarget);
    }
    System.out.printf("Reported Internal Avg Latency: %,9.2f ms\n", stats.getAverageInternalLatency());
    // 4. Write stats to file if requested
    client.writeSummaryCSV(stats, config.statsfile);
}
Also used : ClientStats(org.voltdb.client.ClientStats) VoltTable(org.voltdb.VoltTable)

Example 24 with ClientStats

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

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

Example 25 with ClientStats

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

the class ExportBenchmark method printResults.

/**
     * Prints the results of the voting simulation and statistics
     * about performance.
     * @param duration   How long the test by count ran
     * @param count      How many objects the test by duration inserted
     * @throws Exception if anything unexpected happens.
     */
public synchronized void printResults(long duration) {
    ClientStats stats = fullStatsContext.fetch().getStats();
    ArrayList<StatClass> indexStats = new ArrayList<StatClass>();
    for (StatClass index : serverStats) {
        if (index.m_partition.equals(0)) {
            Double transactions = new Double(index.m_transactions);
            Double decode = new Double(index.m_decode);
            for (StatClass indexPrime : serverStats) {
                // If indexPrime is not partition 0 check for window overlap
                if (!indexPrime.m_partition.equals(0)) {
                    Double ratio = calcRatio(index, indexPrime);
                    transactions += ratio * indexPrime.m_transactions;
                    decode += ratio * indexPrime.m_transactions;
                }
            }
            indexStats.add(new StatClass(index.m_partition, transactions.longValue(), decode.longValue(), index.m_startTime, index.m_endTime));
        }
    }
    Double tpsSum = new Double(0);
    Double decodeSum = new Double(0);
    for (StatClass index : indexStats) {
        tpsSum += (new Double(index.m_transactions * 1000) / (index.m_endTime - index.m_startTime));
        decodeSum += (new Double(index.m_decode) / index.m_transactions);
    }
    tpsSum = (tpsSum / indexStats.size());
    decodeSum = (decodeSum / indexStats.size());
    // 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.printf("Average throughput:            %,9d txns/sec\n", tpsSum.longValue());
    System.out.printf("Average decode time:           %,9.2f ns\n", decodeSum);
    Double decodePerc = (new Double(decodeTime) / (((serverEndTS - serverStartTS) * (partCount + 1)) * 1000000)) * 100;
    System.out.printf("Percent decode row time:       %,9.2f %%\n", decodePerc);
    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());
    // Write stats to file if requested
    try {
        if ((config.statsfile != null) && (config.statsfile.length() != 0)) {
            FileWriter fw = new FileWriter(config.statsfile);
            fw.append(String.format("%d,%d,%d,%d,%d,%d,%d,0,0,0,0,0,0\n", stats.getStartTimestamp(), duration, successfulInserts.get(), serverEndTS - serverStartTS, decodeTime, decodeSum.longValue(), tpsSum.longValue()));
            fw.close();
        }
    } catch (IOException e) {
        System.err.println("Error writing stats file");
        e.printStackTrace();
    }
}
Also used : ClientStats(org.voltdb.client.ClientStats) FileWriter(java.io.FileWriter) ArrayList(java.util.ArrayList) IOException(java.io.IOException)

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