diff options
Diffstat (limited to 'TAO/performance-tests/Callback')
-rw-r--r-- | TAO/performance-tests/Callback/Callback_i.cpp | 7 | ||||
-rw-r--r-- | TAO/performance-tests/Callback/Callback_i.h | 1 | ||||
-rw-r--r-- | TAO/performance-tests/Callback/Server_i.cpp | 3 | ||||
-rw-r--r-- | TAO/performance-tests/Callback/Server_i.h | 1 | ||||
-rw-r--r-- | TAO/performance-tests/Callback/callback.idl | 9 | ||||
-rw-r--r-- | TAO/performance-tests/Callback/client.cpp | 21 |
6 files changed, 35 insertions, 7 deletions
diff --git a/TAO/performance-tests/Callback/Callback_i.cpp b/TAO/performance-tests/Callback/Callback_i.cpp index 4fb59c1d299..0b632dd0ac2 100644 --- a/TAO/performance-tests/Callback/Callback_i.cpp +++ b/TAO/performance-tests/Callback/Callback_i.cpp @@ -17,6 +17,7 @@ Callback_i::done (void) void Callback_i::response (Test::TimeStamp time_stamp, + const Test::Payload &, CORBA::Environment &) ACE_THROW_SPEC (()) { @@ -24,6 +25,12 @@ Callback_i::response (Test::TimeStamp time_stamp, ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); if (this->remaining_samples_ == 0) return; + + if (this->remaining_samples_ % 1000 == 0) + { + ACE_DEBUG ((LM_DEBUG, "Only %d messages to go\n", + this->remaining_samples_)); + } this->remaining_samples_--; this->history_.sample (now - time_stamp); } diff --git a/TAO/performance-tests/Callback/Callback_i.h b/TAO/performance-tests/Callback/Callback_i.h index e66d1969d98..5561ada4901 100644 --- a/TAO/performance-tests/Callback/Callback_i.h +++ b/TAO/performance-tests/Callback/Callback_i.h @@ -22,6 +22,7 @@ public: /// Implement the CORBA methods //@{ void response (Test::TimeStamp, + const Test::Payload &, CORBA::Environment &) ACE_THROW_SPEC (()); //@} diff --git a/TAO/performance-tests/Callback/Server_i.cpp b/TAO/performance-tests/Callback/Server_i.cpp index 4288955318b..8821be546eb 100644 --- a/TAO/performance-tests/Callback/Server_i.cpp +++ b/TAO/performance-tests/Callback/Server_i.cpp @@ -18,12 +18,13 @@ Server_i::set_callback (Test::Callback_ptr callback, void Server_i::request (Test::TimeStamp time_stamp, + const Test::Payload &payload, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { if (!CORBA::is_nil (this->callback_.in ())) { - this->callback_->response (time_stamp, ACE_TRY_ENV); + this->callback_->response (time_stamp, payload, ACE_TRY_ENV); } } diff --git a/TAO/performance-tests/Callback/Server_i.h b/TAO/performance-tests/Callback/Server_i.h index 87cd2126d2f..fca9406d808 100644 --- a/TAO/performance-tests/Callback/Server_i.h +++ b/TAO/performance-tests/Callback/Server_i.h @@ -22,6 +22,7 @@ public: ACE_THROW_SPEC (()); void request (Test::TimeStamp, + const Test::Payload &, CORBA::Environment &) ACE_THROW_SPEC ((CORBA::SystemException)); diff --git a/TAO/performance-tests/Callback/callback.idl b/TAO/performance-tests/Callback/callback.idl index 7f3a14d4393..7ac2851dc01 100644 --- a/TAO/performance-tests/Callback/callback.idl +++ b/TAO/performance-tests/Callback/callback.idl @@ -9,9 +9,13 @@ module Test { /// we stick the native high resolution timer value there. typedef unsigned long long TimeStamp; + /// Simulated + typedef sequence<octet> Payload; + /// Define the callback interface interface Callback { - oneway void response (in TimeStamp time_stamp); + oneway void response (in TimeStamp time_stamp, + in Payload message_payload); }; /// Define the server interface @@ -22,7 +26,8 @@ module Test { /// Send a request, the Callback::response method is invoked with /// the @param time_stamp value - oneway void request (in TimeStamp time_stamp); + oneway void request (in TimeStamp time_stamp, + in Payload message_payload); /// Shutdown the server, just to make cleanup simpler. oneway void shutdown (); diff --git a/TAO/performance-tests/Callback/client.cpp b/TAO/performance-tests/Callback/client.cpp index 05f06814964..7fa2f0bbf5c 100644 --- a/TAO/performance-tests/Callback/client.cpp +++ b/TAO/performance-tests/Callback/client.cpp @@ -149,20 +149,25 @@ main (int argc, char *argv []) Task task (server.in (), iterations); task.activate (); + ACE_hrtime_t start = ACE_OS::gethrtime (); while (!callback_i.done () || !task.done ()) { ACE_Time_Value tv (1, 0); orb->run (tv, ACE_TRY_ENV); ACE_TRY_CHECK; } + ACE_hrtime_t end = ACE_OS::gethrtime (); ACE_Thread_Manager::instance ()->wait (); // Calibrate the high resolution timer *before* starting the // test. + ACE_DEBUG ((LM_DEBUG, "Calibrating high res timer ....")); ACE_High_Res_Timer::calibrate (); ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor (); + ACE_DEBUG ((LM_DEBUG, "Done (%d)\n", gsf)); + ACE_Sample_History &history = callback_i.sample_history (); if (do_dump_history) @@ -174,12 +179,19 @@ main (int argc, char *argv []) history.collect_basic_stats (stats); stats.dump_results ("Latency", gsf); + ACE_hrtime_t elapsed_microseconds = (end - start) / gsf; + double elapsed_seconds = + ACE_CU64_TO_CU32(elapsed_microseconds) / 1000000.0; + double throughput = + double(iterations) / elapsed_seconds; + + ACE_DEBUG ((LM_DEBUG, "Throughtput: %f\n", throughput)); + server->shutdown (ACE_TRY_ENV); ACE_TRY_CHECK; - PortableServer::ObjectId_var id; - - id = root_poa->servant_to_id (&callback_i, ACE_TRY_ENV); + PortableServer::ObjectId_var id = + root_poa->servant_to_id (&callback_i, ACE_TRY_ENV); ACE_TRY_CHECK; root_poa->deactivate_object (id.in (), ACE_TRY_ENV); ACE_TRY_CHECK; @@ -251,12 +263,13 @@ Task::done (void) int Task::svc (void) { + Test::Payload payload(1024); payload.length(1024); ACE_TRY_NEW_ENV { for (;;) { Test::TimeStamp creation = ACE_OS::gethrtime (); - this->server_->request (creation, ACE_TRY_ENV); + this->server_->request (creation, payload, ACE_TRY_ENV); ACE_TRY_CHECK; // ACE_Time_Value tv (0, 5000); |