diff options
Diffstat (limited to 'ACE/TAO/performance-tests/Sequence_Latency/AMI/Roundtrip_Handler.cpp')
-rw-r--r-- | ACE/TAO/performance-tests/Sequence_Latency/AMI/Roundtrip_Handler.cpp | 195 |
1 files changed, 195 insertions, 0 deletions
diff --git a/ACE/TAO/performance-tests/Sequence_Latency/AMI/Roundtrip_Handler.cpp b/ACE/TAO/performance-tests/Sequence_Latency/AMI/Roundtrip_Handler.cpp new file mode 100644 index 00000000000..51d7babe99e --- /dev/null +++ b/ACE/TAO/performance-tests/Sequence_Latency/AMI/Roundtrip_Handler.cpp @@ -0,0 +1,195 @@ +// +// $Id$ +// +#include "Roundtrip_Handler.h" +#include "ace/OS_NS_time.h" + +ACE_RCSID(AMI_Latency, Roundtrip, "$Id$") + +Roundtrip_Handler::Roundtrip_Handler (int expected_callbacks) + : pending_callbacks_ (expected_callbacks) +{ +} + +int +Roundtrip_Handler::pending_callbacks (void) const +{ + return this->pending_callbacks_; +} + +void +Roundtrip_Handler::dump_results (ACE_UINT32 gsf) +{ + this->latency_stats_.dump_results (ACE_TEXT("AMI Latency"), gsf); +} + +// = The skeleton methods for test octet load + +void +Roundtrip_Handler::test_octet_method (Test::Timestamp send_time) +{ + --this->pending_callbacks_; + + ACE_hrtime_t now = ACE_OS::gethrtime (); + this->latency_stats_.sample (now - send_time); +} + +void +Roundtrip_Handler::test_octet_method_excep (::Messaging::ExceptionHolder *holder) +{ + try + { + --this->pending_callbacks_; + holder->raise_exception (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("test_octet_method:"); + } +} + +// = The skeleton methods for test char load + +void +Roundtrip_Handler::test_char_method (Test::Timestamp send_time) +{ + --this->pending_callbacks_; + + ACE_hrtime_t now = ACE_OS::gethrtime (); + this->latency_stats_.sample (now - send_time); +} + +void +Roundtrip_Handler::test_char_method_excep (::Messaging::ExceptionHolder *holder) +{ + try + { + --this->pending_callbacks_; + holder->raise_exception (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("test_char_method:"); + } +} + +// = The skeleton methods for test long load + +void +Roundtrip_Handler::test_long_method (Test::Timestamp send_time) +{ + --this->pending_callbacks_; + + ACE_hrtime_t now = ACE_OS::gethrtime (); + this->latency_stats_.sample (now - send_time); +} + +void +Roundtrip_Handler::test_long_method_excep (::Messaging::ExceptionHolder *holder) +{ + try + { + --this->pending_callbacks_; + holder->raise_exception (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("test_long_method:"); + } +} + +// = The skeleton methods for test short load + +void +Roundtrip_Handler::test_short_method (Test::Timestamp send_time) +{ + --this->pending_callbacks_; + + ACE_hrtime_t now = ACE_OS::gethrtime (); + this->latency_stats_.sample (now - send_time); +} + +void +Roundtrip_Handler::test_short_method_excep (::Messaging::ExceptionHolder *holder) +{ + try + { + --this->pending_callbacks_; + holder->raise_exception (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("test_short_method:"); + } +} + +// = The skeleton methods for test double load + +void +Roundtrip_Handler::test_double_method (Test::Timestamp send_time) +{ + --this->pending_callbacks_; + + ACE_hrtime_t now = ACE_OS::gethrtime (); + this->latency_stats_.sample (now - send_time); +} + +void +Roundtrip_Handler::test_double_method_excep (::Messaging::ExceptionHolder *holder) +{ + try + { + --this->pending_callbacks_; + holder->raise_exception (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("test_double_method:"); + } +} + +// = The skeleton methods for test longlong load + +void +Roundtrip_Handler::test_longlong_method (Test::Timestamp send_time) +{ + --this->pending_callbacks_; + + ACE_hrtime_t now = ACE_OS::gethrtime (); + this->latency_stats_.sample (now - send_time); +} + +void +Roundtrip_Handler::test_longlong_method_excep (::Messaging::ExceptionHolder *holder) +{ + try + { + --this->pending_callbacks_; + holder->raise_exception (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("test_longlong_method:"); + } +} + + +// = Other methods + +void +Roundtrip_Handler::shutdown (void) +{ +} + +void +Roundtrip_Handler::shutdown_excep (::Messaging::ExceptionHolder *holder) +{ + try + { + holder->raise_exception (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("shutdown:"); + } +} |