1 #include "Client_Task.h"
2 #include "ace/OS_NS_time.h"
4 Client_Task::Client_Task (Test::Roundtrip_ptr roundtrip
,
6 : roundtrip_ (Test::Roundtrip::_duplicate (roundtrip
))
7 , niterations_ (niterations
)
16 this->validate_connection ();
18 for (int i
= 0; i
!= this->niterations_
; ++i
)
20 ACE_hrtime_t start
= ACE_OS::gethrtime ();
22 (void) this->roundtrip_
->test_method (start
);
24 ACE_hrtime_t now
= ACE_OS::gethrtime ();
25 this->latency_
.sample (now
- start
);
28 catch (const CORBA::Exception
&)
36 Client_Task::accumulate_and_dump (
37 ACE_Basic_Stats
&totals
,
39 ACE_High_Res_Timer::global_scale_factor_type gsf
)
41 totals
.accumulate (this->latency_
);
42 this->latency_
.dump_results (msg
, gsf
);
46 Client_Task::validate_connection ()
48 CORBA::ULongLong dummy
= 0;
49 for (int i
= 0; i
!= 100; ++i
)
53 (void) this->roundtrip_
->test_method (dummy
);
55 catch (const CORBA::Exception
&){}