bench/lib/bench/distr_runner.rb in rhoconnect-4.0.0 vs bench/lib/bench/distr_runner.rb in rhoconnect-4.0.1

- old
+ new

@@ -6,11 +6,11 @@ def initialize(clientgroup) @clients_group = clientgroup end - def run(server, sync_key, payload, concurrency, niterations, result_filename=nil, sim_time = 0) + def run(server, sync_key, payload, concurrency, niterations, result_filename=nil, sim_time = 0, bench_adapter_name = "RhoInternalBenchmarkAdapter") # 1) Extract server name server ||= 'default' if server != 'default' Bench.base_url = server end @@ -18,11 +18,11 @@ # 2) Simulate the payload Bench.datasize = payload.to_i expected_data = Bench.get_test_data(Bench.datasize) Bench.concurrency = concurrency.to_i Bench.iterations = niterations.to_i - + Bench.adapter_name = bench_adapter_name # 3) extract result filename Bench.result_filename = result_filename # 4) Set up the server begin @@ -31,19 +31,19 @@ Bench.get_test_server Bench.reset_app Bench.user_name = "benchuser" Bench.password = "password" Bench.set_server_state("test_db_storage:application:#{Bench.user_name}",expected_data) - Bench.reset_refresh_time('RhoInternalBenchmarkAdapter', 0) - Bench.set_simulate_time('RhoInternalBenchmarkAdapter', sim_time) + Bench.reset_refresh_time(Bench.adapter_name, 0) + Bench.set_simulate_time(Bench.adapter_name, sim_time) #6) set the sync key @start_time = Time.now + 10.0 Bench.set_server_state(sync_key, @start_time.to_f.to_s) puts "Sync Key #{sync_key} is set to #{@start_time} - waiting for clients now!!!" #7) Start-up all clients - command="cd /opt/rhoconnect/bin; ruby run_client_benchmark #{server} #{sync_key} #{niterations} 1 #{Bench.datasize} 1>/dev/null" + command="cd /opt/rhoconnect/bin; ruby run_client_benchmark #{server} #{sync_key} #{niterations} 1 #{Bench.datasize} #{Bench.adapter_name} 1>/dev/null" ec2_clients = clients_group.client_instances[0,concurrency] Bench::AWSUtils.run_stack_ssh_command(ec2_clients, command) #8) Wait until the command is done and save all data to the disk sleep(1) \ No newline at end of file