diff options
Diffstat (limited to 'TAO/CIAO/tests/RTCCM/Priority_Test/Controllers/Controller_exec.cpp')
-rw-r--r-- | TAO/CIAO/tests/RTCCM/Priority_Test/Controllers/Controller_exec.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/TAO/CIAO/tests/RTCCM/Priority_Test/Controllers/Controller_exec.cpp b/TAO/CIAO/tests/RTCCM/Priority_Test/Controllers/Controller_exec.cpp index 7a4012c6797..4cb0929155e 100644 --- a/TAO/CIAO/tests/RTCCM/Priority_Test/Controllers/Controller_exec.cpp +++ b/TAO/CIAO/tests/RTCCM/Priority_Test/Controllers/Controller_exec.cpp @@ -2,6 +2,9 @@ #include "Controller_exec.h" #include "CIAO_common.h" +#include "ace/High_Res_Timer.h" +#include "ace/Stats.h" +#include "ace/Sample_History.h" /// Default constructor. MyImpl::Controller_exec_i::Controller_exec_i () @@ -21,6 +24,45 @@ MyImpl::Controller_exec_i::perform_test (ACE_ENV_SINGLE_ARG_DECL) // This simply performs some measurements and print out the result. ACE_DEBUG ((LM_DEBUG, "PERFORM TEST\n")); + + Priority_Test::Common_Ops_var device = + this->context_->get_connection_worker (ACE_ENV_SINGLE_ARG_PARAMETER); + + const int niterations = 200; + const CORBA::Long work = 80; + ACE_Sample_History history (niterations); + + ACE_hrtime_t test_start = ACE_OS::gethrtime (); + for (int i = 0; i < niterations; ++i) + { + ACE_hrtime_t start = ACE_OS::gethrtime (); + + (void) device->do_work (work, 0 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_hrtime_t now = ACE_OS::gethrtime (); + history.sample (now - start); + } + ACE_hrtime_t test_end = ACE_OS::gethrtime (); + + ACE_DEBUG ((LM_DEBUG, "test finished\n")); + + ACE_DEBUG ((LM_DEBUG, "High resolution timer calibration....")); + ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor (); + ACE_DEBUG ((LM_DEBUG, "done\n")); + +// if (do_dump_history) +// { +// history.dump_samples ("HISTORY", gsf); +// } + + ACE_Basic_Stats stats; + history.collect_basic_stats (stats); + stats.dump_results ("Total", gsf); + + ACE_Throughput_Stats::dump_throughput ("Total", gsf, + test_end - test_start, + stats.samples_count ()); } // Operations from Components::SessionComponent |