diff options
Diffstat (limited to 'TAO/performance-tests/Latency/ami-latency-client.cpp')
-rw-r--r-- | TAO/performance-tests/Latency/ami-latency-client.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/TAO/performance-tests/Latency/ami-latency-client.cpp b/TAO/performance-tests/Latency/ami-latency-client.cpp index b98c7fba9c9..5f4ebdc57ba 100644 --- a/TAO/performance-tests/Latency/ami-latency-client.cpp +++ b/TAO/performance-tests/Latency/ami-latency-client.cpp @@ -13,6 +13,8 @@ const char *ior = "file://test.ior"; int nthreads = 1; int niterations = 5; +int sleep_flag = 1; + ACE_hrtime_t latency_base; ACE_hrtime_t throughput_base; @@ -22,10 +24,13 @@ ACE_Throughput_Stats throughput_stats; ACE_Time_Value sleep_time (0, 10000); +int done = 0; + + int parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "k:n:i:"); + ACE_Get_Opt get_opts (argc, argv, "k:n:i:s"); int c; while ((c = get_opts ()) != -1) @@ -40,6 +45,9 @@ parse_args (int argc, char *argv[]) case 'i': niterations = ACE_OS::atoi (get_opts.optarg); break; + case 's': + sleep_flag = 1; + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, @@ -63,13 +71,15 @@ public: void test_method (CORBA::Environment&) { - if (TAO_debug_level >= 0) + if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%P | %t) : Callback method called\n")); ACE_hrtime_t now = ACE_OS::gethrtime (); throughput_stats.sample (now - throughput_base, now - latency_base); + + done = 1; }; ~Handler (void) {}; @@ -287,13 +297,19 @@ Client::svc (void) server_->sendc_test_method (this->reply_handler_, ACE_TRY_ENV); - // Spend 10 msecs running the ORB. - this->orb_->run (sleep_time); - + if (sleep_flag) + // Spend 10 msecs running the ORB. + this->orb_->run (sleep_time); + else + while (!done) + this->orb_->perform_work (); + ACE_TRY_CHECK; if (TAO_debug_level > 0 && i % 100 == 0) ACE_DEBUG ((LM_DEBUG, "(%P|%t) iteration = %d\n", i)); + + done = 0; } } ACE_CATCHANY |