// ---------------------------------------------------------------------------------------------------------------------------------------------------
// Use the AppHelper utility class to retrieve command line application parameters
// Define parameters and pull from command line
AppHelper apph = new AppHelper(AsyncBenchmark.class.getCanonicalName())
.add("displayinterval", "display_interval_in_seconds", "Interval for performance feedback, in seconds.", 10)
.add("duration", "run_duration_in_seconds", "Benchmark duration, in seconds.", 120)
.add("servers", "comma_separated_server_list", "List of VoltDB servers to connect to.", "localhost")
.add("port", "port_number", "Client port to connect to on cluster nodes.", 21212)
.add("poolsize", "pool_size", "Size of the record pool to operate on - larger sizes will cause a higher insert/update-delete rate.", 100000)
.add("procedure", "procedure_name", "Procedure to call.", "JiggleExportSinglePartition")
.add("ratelimit", "rate_limit", "Rate limit to start from (number of transactions per second).", 100000)
.add("autotune", "auto_tune", "Flag indicating whether the benchmark should self-tune the transaction rate for a target execution latency (true|false).", "true")
.add("latencytarget", "latency_target", "Execution latency to target to tune transaction rate (in milliseconds).", 10)
.add("catalogswap", "Swap catalogs from the client", "true")
.setArguments(args)
;
config = new ConnectionConfig(apph);
// Retrieve parameters
final boolean catalogSwap = apph.booleanValue("catalogswap");
final String csv = apph.stringValue("statsfile");
TxnIdWriter writer = new TxnIdWriter("dude", "clientlog");
// Validate parameters
apph.validate("duration", (config.duration > 0))
.validate("poolsize", (config.poolSize > 0))
.validate("ratelimit", (config.rateLimit > 0))
.validate("latencytarget", (config.latencyTarget > 0))
;
// Display actual parameters, for reference
apph.printActualUsage();
// ---------------------------------------------------------------------------------------------------------------------------------------------------
// Get a client connection - we retry for a while in case the server hasn't started yet
createClient();