Search in sources :

Example 46 with ClientStats

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

the class AsyncExportClient method printStatistics.

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

Example 47 with ClientStats

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

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

Example 48 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 49 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 50 with ClientStats

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

the class AdBrokerBenchmark method printStatistics.

/**
     * Print stats for the last displayinterval seconds to the console.
     */
public synchronized void printStatistics() {
    ClientStats stats = m_periodicStatsContext.fetchAndResetBaseline().getStats();
    long time = Math.round((stats.getEndTimestamp() - m_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());
    if (m_config.latencyreport) {
        System.out.printf(", Avg/95%% Latency %.2f/%.2fms", stats.getAverageLatency(), stats.kPercentileLatencyAsDouble(0.95));
    }
    System.out.printf("\n");
    VoltTable[] tables = null;
    try {
        tables = m_client.callProcedure("GetStats", m_config.displayinterval).getResults();
    } catch (IOException | ProcCallException e) {
        e.printStackTrace();
        System.exit(1);
    }
    VoltTable hits = tables[0];
    hits.advanceRow();
    assert (hits.getLong(0) == 0);
    long unmetRequests = hits.getLong(1);
    hits.advanceRow();
    assert (hits.getLong(0) == 1);
    long metRequests = hits.getLong(1);
    long totalRequests = unmetRequests + metRequests;
    double percentMet = (((double) metRequests) / totalRequests) * 100.0;
    System.out.printf("Total number of ad requests: %d, %3.2f%% resulted in an ad being served\n", totalRequests, percentMet);
    VoltTable recentAdvertisers = tables[1];
    System.out.println("\nTop 5 advertisers of the last " + m_config.displayinterval + " seconds, " + "by sorted on the sum of dollar amounts of bids won:");
    System.out.println("Advertiser                                   Revenue   Count");
    System.out.println("----------                                   -------   -----");
    while (recentAdvertisers.advanceRow()) {
        System.out.printf("%-40s  %9.2f    %d\n", recentAdvertisers.getString(0), recentAdvertisers.getDouble(1), recentAdvertisers.getLong(2));
    }
    System.out.println();
}
Also used : ClientStats(org.voltdb.client.ClientStats) IOException(java.io.IOException) VoltTable(org.voltdb.VoltTable) ProcCallException(org.voltdb.client.ProcCallException)

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