1 #include "Roundtrip_Handler.h"
2 #include "ace/OS_NS_time.h"
4 Roundtrip_Handler::Roundtrip_Handler (int expected_callbacks
)
5 : pending_callbacks_ (expected_callbacks
)
10 Roundtrip_Handler::pending_callbacks () const
12 return this->pending_callbacks_
;
16 Roundtrip_Handler::dump_results (
17 ACE_High_Res_Timer::global_scale_factor_type gsf
)
19 this->latency_stats_
.dump_results (ACE_TEXT("AMI Latency"), gsf
);
22 // = The skeleton methods for test octet load
25 Roundtrip_Handler::test_octet_method (Test::Timestamp send_time
)
27 --this->pending_callbacks_
;
29 ACE_hrtime_t now
= ACE_OS::gethrtime ();
30 this->latency_stats_
.sample (now
- send_time
);
34 Roundtrip_Handler::test_octet_method_excep (::Messaging::ExceptionHolder
*holder
)
38 --this->pending_callbacks_
;
39 holder
->raise_exception ();
41 catch (const CORBA::Exception
& ex
)
43 ex
._tao_print_exception ("test_octet_method:");
47 // = The skeleton methods for test char load
50 Roundtrip_Handler::test_char_method (Test::Timestamp send_time
)
52 --this->pending_callbacks_
;
54 ACE_hrtime_t now
= ACE_OS::gethrtime ();
55 this->latency_stats_
.sample (now
- send_time
);
59 Roundtrip_Handler::test_char_method_excep (::Messaging::ExceptionHolder
*holder
)
63 --this->pending_callbacks_
;
64 holder
->raise_exception ();
66 catch (const CORBA::Exception
& ex
)
68 ex
._tao_print_exception ("test_char_method:");
72 // = The skeleton methods for test long load
75 Roundtrip_Handler::test_long_method (Test::Timestamp send_time
)
77 --this->pending_callbacks_
;
79 ACE_hrtime_t now
= ACE_OS::gethrtime ();
80 this->latency_stats_
.sample (now
- send_time
);
84 Roundtrip_Handler::test_long_method_excep (::Messaging::ExceptionHolder
*holder
)
88 --this->pending_callbacks_
;
89 holder
->raise_exception ();
91 catch (const CORBA::Exception
& ex
)
93 ex
._tao_print_exception ("test_long_method:");
97 // = The skeleton methods for test short load
100 Roundtrip_Handler::test_short_method (Test::Timestamp send_time
)
102 --this->pending_callbacks_
;
104 ACE_hrtime_t now
= ACE_OS::gethrtime ();
105 this->latency_stats_
.sample (now
- send_time
);
109 Roundtrip_Handler::test_short_method_excep (::Messaging::ExceptionHolder
*holder
)
113 --this->pending_callbacks_
;
114 holder
->raise_exception ();
116 catch (const CORBA::Exception
& ex
)
118 ex
._tao_print_exception ("test_short_method:");
122 // = The skeleton methods for test double load
125 Roundtrip_Handler::test_double_method (Test::Timestamp send_time
)
127 --this->pending_callbacks_
;
129 ACE_hrtime_t now
= ACE_OS::gethrtime ();
130 this->latency_stats_
.sample (now
- send_time
);
134 Roundtrip_Handler::test_double_method_excep (::Messaging::ExceptionHolder
*holder
)
138 --this->pending_callbacks_
;
139 holder
->raise_exception ();
141 catch (const CORBA::Exception
& ex
)
143 ex
._tao_print_exception ("test_double_method:");
147 // = The skeleton methods for test longlong load
150 Roundtrip_Handler::test_longlong_method (Test::Timestamp send_time
)
152 --this->pending_callbacks_
;
154 ACE_hrtime_t now
= ACE_OS::gethrtime ();
155 this->latency_stats_
.sample (now
- send_time
);
159 Roundtrip_Handler::test_longlong_method_excep (::Messaging::ExceptionHolder
*holder
)
163 --this->pending_callbacks_
;
164 holder
->raise_exception ();
166 catch (const CORBA::Exception
& ex
)
168 ex
._tao_print_exception ("test_longlong_method:");
176 Roundtrip_Handler::shutdown ()
181 Roundtrip_Handler::shutdown_excep (::Messaging::ExceptionHolder
*holder
)
185 holder
->raise_exception ();
187 catch (const CORBA::Exception
& ex
)
189 ex
._tao_print_exception ("shutdown:");