diff options
Diffstat (limited to 'modules/CIAO/performance-tests/Benchmark/RoundTripClient')
12 files changed, 865 insertions, 0 deletions
diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.cidl b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.cidl new file mode 100644 index 00000000000..febcbed08df --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.cidl @@ -0,0 +1,19 @@ +// $Id$ + +#ifndef ROUNDTRIPCLIENT_CIDL +#define ROUNDTRIPCLIENT_CIDL + +#include "RoundTripClient.idl" + +composition session RoundTripClient_Impl +{ + + home executor RoundTripClientHome_Exec + { + implements Benchmark::RoundTripClientHome; + manages RoundTripClient_Exec; + }; + +}; + +#endif /* ROUNDTRIPCLIENT_CIDL */ diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.idl b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.idl new file mode 100644 index 00000000000..3f891ce00d3 --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.idl @@ -0,0 +1,30 @@ +// $Id$ +//============================================================================= +/** + * @file RoundTripClient.idl + * + * Definition of the Component that uses the LatencyTest interface + * provided by RoundTrip component + */ +//============================================================================= + +#ifndef CIAO_ROUNDTRIPCLIENT_IDL +#define CIAO_ROUNDTRIPCLIENT_IDL + +#include <Components.idl> +#include "../Benchmark.idl" + +module Benchmark +{ + component RoundTripClient + { + uses LatencyTest latency; + provides Controller controller; + }; + + home RoundTripClientHome manages RoundTripClient + { + }; +}; + +#endif /* CIAO_ROUNDTRIPCLIENT_IDL*/ diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.mpc b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.mpc new file mode 100644 index 00000000000..6ccc38cc06b --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.mpc @@ -0,0 +1,109 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -l .. -p Benchmark -i -c RoundTripClient" + +project(RoundTripClient_stub): ciao_client_dnc { + avoids += ace_for_tao + after += Benchmark_stub + sharedname = RoundTripClient_stub + + libs += Benchmark_stub + + idlflags += -Wb,stub_export_macro=ROUNDTRIPCLIENT_STUB_Export + idlflags += -Wb,stub_export_include=RoundTripClient_stub_export.h + idlflags += -Wb,skel_export_macro=ROUNDTRIPCLIENT_SVNT_Export + idlflags += -Wb,skel_export_include=RoundTripClient_svnt_export.h + + dynamicflags = ROUNDTRIPCLIENT_STUB_BUILD_DLL + + IDL_Files { + RoundTripClient.idl + } + + Source_Files { + RoundTripClientC.cpp + } +} + +project(RoundTripClient_svnt) : ciao_servant_dnc { + avoids += ace_for_tao + after += Benchmark_svnt RoundTripClient_stub + sharedname = RoundTripClient_svnt + libs += RoundTripClient_stub Benchmark_stub Benchmark_svnt + libpaths += .. + + idlflags += -Wb,export_macro=ROUNDTRIPCLIENT_SVNT_Export + idlflags +=-Wb,export_include=RoundTripClient_svnt_export.h + + dynamicflags = ROUNDTRIPCLIENT_SVNT_BUILD_DLL + + CIDL_Files { + RoundTripClient.cidl + } + + IDL_Files { + RoundTripClientE.idl + } + + Source_Files { + RoundTripClientEC.cpp + RoundTripClientS.cpp + RoundTripClient_svnt.cpp + } +} + + +project(RoundTripClient_exec) : ciao_component_dnc { + avoids += ace_for_tao + after += RoundTripClient_svnt + + sharedname = RoundTripClient_exec + + libs += RoundTripClient_stub Benchmark_stub Benchmark_svnt RoundTripClient_svnt + + libpaths += .. + + idlflags += -Wb,export_macro=ROUNDTRIPCLIENT_EXEC_Export + idlflags += -Wb,export_include=RoundTripClient_exec_export.h + + dynamicflags = ROUNDTRIPCLIENT_EXEC_BUILD_DLL + + IDL_Files { + RoundTripClientEI.idl + } + + Source_Files { + RoundTripClientEIC.cpp + RoundTripClient_exec.cpp + } +} + + +project (*client) : ciao_client_dnc { + avoids += ace_for_tao + exename = client + after += RoundTripClient_stub + libs += RoundTripClient_stub Benchmark_stub + libpaths += .. + + IDL_Files { + } + + Source_Files { + client.cpp + } +} + + +//project (RoundTripClient_controller) : ciao_client_dnc { +// exename = controller +// after += RoundTripClient_stub +// libs += RoundTripClient_stub Benchmark_stub +// libpaths += .. +// +// IDL_Files { +// } +// +// Source_Files { +// controller.cpp +// } +//} diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClientEI.idl b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClientEI.idl new file mode 100644 index 00000000000..d9009c56e8a --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClientEI.idl @@ -0,0 +1,34 @@ +// $Id$ + +//============================================================================= +/** + * @file RoundTripClientEI.idl + * + * + * @author + */ +//============================================================================= + +#ifndef CIAO_ROUNDTRIPCLIENTEI_IDL +#define CIAO_ROUNDTRIPCLIENTEI_IDL + +#include "RoundTripClientE.idl" + +module Benchmark +{ + /** + * @interface RoundTripClient_Exec + * + * The actually Test executor need to support + * Components::SessionComponent interface. Therefore, we need to + * define the component executor interface explicitly here. + */ + local interface RoundTripClient_Exec : CCM_RoundTripClient, + Components::SessionComponent, + CCM_Controller //Monolithic + { + }; + +}; + +#endif /* CIAO_ROUNDTRIPCLIENTEI_IDL */ diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.cpp b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.cpp new file mode 100644 index 00000000000..ab8ede89b50 --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.cpp @@ -0,0 +1,183 @@ +// $Id$ + +#include "ace/Stats.h" +#include "ace/Sample_History.h" +#include "ace/High_Res_Timer.h" +#include "CIAO_common.h" +#include "ace/Env_Value_T.h" + +#include "RoundTripClient_exec.h" + +const int niterations = 100000; //Default no of iterations +//================================================================= + +MyImpl::RoundTripClient_exec_i::RoundTripClient_exec_i () +{ + +} + +MyImpl::RoundTripClient_exec_i::~RoundTripClient_exec_i () +{ +} + +// Operations from Components::SessionComponent +void +MyImpl::RoundTripClient_exec_i::set_session_context ( + Components::SessionContext_ptr ctx) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, + "MyImpl::RoundTripClient_exec_i::set_session_context\n")); + + //Since this is in collocated mode; The server-component will change the + //scheduling strategy to real-time scheduling + + this->context_ = + Benchmark::CCM_RoundTripClient_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + throw CORBA::INTERNAL (); + + // Urm, we actually discard exceptions thrown from this operation. +} + +//Start the collocated test here +void +MyImpl::RoundTripClient_exec_i::ciao_preactivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::RoundTripClient_exec_i::ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, "MyImpl::RoundTripClient_exec_i::ccm_activate\n")); +} + +void +MyImpl::RoundTripClient_exec_i::ciao_postactivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::RoundTripClient_exec_i::start () + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ///////////// Start test ///////////////////////////////////////// + + // Let's try to start tests from here... + Benchmark::LatencyTest_var lt = + context_->get_connection_latency (); + + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, + "MyImpl::RoundTripClient_exec::start obtain obj ref\n")); + + CORBA::Long test_data = 0L; + + //Warm up the system + int i = 0; + for (i=0; i < 100; i++) + lt->makeCall (test_data); + + ACE_DEBUG ((LM_DEBUG, "MyImpl::start: warmed up the system\n")); + + ACE_Sample_History history (niterations); + + ACE_hrtime_t test_start = ACE_OS::gethrtime (); + for (i = 0; i < niterations; ++i) + { + ACE_hrtime_t start = ACE_OS::gethrtime (); + + //Test value to be sent to the server + long test = 0; + + (void) lt->makeCall (test); + + 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")); + + ACE_Env_Value<int> envar ("CIAO_DUMP_SAMPLE_HISTORY", 0); + if (envar != 0) + { + 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 ()); + +} + +::Benchmark::CCM_Controller_ptr +MyImpl::RoundTripClient_exec_i::get_controller () + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return ::Benchmark::CCM_Controller::_duplicate (this); +} + + +void +MyImpl::RoundTripClient_exec_i::ccm_passivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, "MyImpl::RoundTripClient_exec_i::ccm_passivate\n")); +} + +void +MyImpl::RoundTripClient_exec_i::ccm_remove () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, "MyImpl::RoundTripClient_exec_i::ccm_remove\n")); +} + + +MyImpl::RoundTripClientHome_exec_i::RoundTripClientHome_exec_i () +{ +} + +MyImpl::RoundTripClientHome_exec_i::~RoundTripClientHome_exec_i () +{ +} + +::Components::EnterpriseComponent_ptr +MyImpl::RoundTripClientHome_exec_i::create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + return new MyImpl::RoundTripClient_exec_i; +} + + +extern "C" ROUNDTRIPCLIENT_EXEC_Export ::Components::HomeExecutorBase_ptr +createRoundTripClientHome_Impl (void) +{ + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, "Creating RoundTrip_client impl \n")); + return new MyImpl::RoundTripClientHome_exec_i (); +} diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.h b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.h new file mode 100644 index 00000000000..127684294f4 --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.h @@ -0,0 +1,110 @@ +// $Id$ + +//============================================================ +/** + * @file RoundTripClient_exec.h + * + * Header file for the Executor implementation. + * + * @author Diego <dsevilla@um.es> + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + */ +//============================================================ + +#ifndef BENCHMARK_ROUNDTRIPCLIENT_EXEC_H +#define BENCHMARK_ROUNDTRIPCLIENT_EXEC_H + +#include "RoundTripClientEIC.h" +#include "tao/LocalObject.h" + + +namespace MyImpl +{ + + /** + * @class RoundTripClient_exec_i + * + * RoundTripClient executor implementation class. + */ + + class ROUNDTRIPCLIENT_EXEC_Export RoundTripClient_exec_i : + public virtual Benchmark::RoundTripClient_Exec, + public virtual TAO_Local_RefCounted_Object + { + + public: + /// Default constructor. + RoundTripClient_exec_i (); + + /// Default destructor. + ~RoundTripClient_exec_i (); + + // Operations from Components::SessionComponent + virtual void set_session_context (Components::SessionContext_ptr ctx) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void ciao_preactivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void ciao_postactivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void ccm_passivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void ccm_remove () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual ::Benchmark::CCM_Controller_ptr + get_controller () + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void start () + ACE_THROW_SPEC ((CORBA::SystemException)); + + + protected: + /// Copmponent specific context + Benchmark::CCM_RoundTripClient_Context_var context_; + + }; + + /** + * @class RoundTripClientHome_exec_i + * + * RoundTripClient home executor implementation class. + */ + class ROUNDTRIPCLIENT_EXEC_Export RoundTripClientHome_exec_i : + public virtual Benchmark::CCM_RoundTripClientHome, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default ctor. + RoundTripClientHome_exec_i (); + + /// Default dtor. + ~RoundTripClientHome_exec_i (); + + // Implicit home operations. + + virtual ::Components::EnterpriseComponent_ptr + create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + }; + +} + +extern "C" ROUNDTRIPCLIENT_EXEC_Export ::Components::HomeExecutorBase_ptr +createRoundTripClientHome_Impl (void); + +#endif /* CIAO_ROUNDTRIPCLIENTGEN_EXEC_H */ diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec_export.h b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec_export.h new file mode 100644 index 00000000000..4a9827a8cbc --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl ROUNDTRIPCLIENT_EXEC +// ------------------------------ +#ifndef ROUNDTRIPCLIENT_EXEC_EXPORT_H +#define ROUNDTRIPCLIENT_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (ROUNDTRIPCLIENT_EXEC_HAS_DLL) +# define ROUNDTRIPCLIENT_EXEC_HAS_DLL 1 +#endif /* ! ROUNDTRIPCLIENT_EXEC_HAS_DLL */ + +#if defined (ROUNDTRIPCLIENT_EXEC_HAS_DLL) && (ROUNDTRIPCLIENT_EXEC_HAS_DLL == 1) +# if defined (ROUNDTRIPCLIENT_EXEC_BUILD_DLL) +# define ROUNDTRIPCLIENT_EXEC_Export ACE_Proper_Export_Flag +# define ROUNDTRIPCLIENT_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define ROUNDTRIPCLIENT_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* ROUNDTRIPCLIENT_EXEC_BUILD_DLL */ +# define ROUNDTRIPCLIENT_EXEC_Export ACE_Proper_Import_Flag +# define ROUNDTRIPCLIENT_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define ROUNDTRIPCLIENT_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* ROUNDTRIPCLIENT_EXEC_BUILD_DLL */ +#else /* ROUNDTRIPCLIENT_EXEC_HAS_DLL == 1 */ +# define ROUNDTRIPCLIENT_EXEC_Export +# define ROUNDTRIPCLIENT_EXEC_SINGLETON_DECLARATION(T) +# define ROUNDTRIPCLIENT_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* ROUNDTRIPCLIENT_EXEC_HAS_DLL == 1 */ + +// Set ROUNDTRIPCLIENT_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (ROUNDTRIPCLIENT_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define ROUNDTRIPCLIENT_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define ROUNDTRIPCLIENT_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !ROUNDTRIPCLIENT_EXEC_NTRACE */ + +#if (ROUNDTRIPCLIENT_EXEC_NTRACE == 1) +# define ROUNDTRIPCLIENT_EXEC_TRACE(X) +#else /* (ROUNDTRIPCLIENT_EXEC_NTRACE == 1) */ +# define ROUNDTRIPCLIENT_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (ROUNDTRIPCLIENT_EXEC_NTRACE == 1) */ + +#endif /* ROUNDTRIPCLIENT_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_stub_export.h b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_stub_export.h new file mode 100644 index 00000000000..1020507fdff --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_stub_export.h @@ -0,0 +1,49 @@ +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl ROUNDTRIPCLIENT_STUB +// ------------------------------ +#ifndef ROUNDTRIPCLIENT_STUB_EXPORT_H +#define ROUNDTRIPCLIENT_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (ROUNDTRIPCLIENT_STUB_HAS_DLL) +# define ROUNDTRIPCLIENT_STUB_HAS_DLL 1 +#endif /* ! ROUNDTRIPCLIENT_STUB_HAS_DLL */ + +#if defined (ROUNDTRIPCLIENT_STUB_HAS_DLL) && (ROUNDTRIPCLIENT_STUB_HAS_DLL == 1) +# if defined (ROUNDTRIPCLIENT_STUB_BUILD_DLL) +# define ROUNDTRIPCLIENT_STUB_Export ACE_Proper_Export_Flag +# define ROUNDTRIPCLIENT_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define ROUNDTRIPCLIENT_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* ROUNDTRIPCLIENT_STUB_BUILD_DLL */ +# define ROUNDTRIPCLIENT_STUB_Export ACE_Proper_Import_Flag +# define ROUNDTRIPCLIENT_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define ROUNDTRIPCLIENT_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* ROUNDTRIPCLIENT_STUB_BUILD_DLL */ +#else /* ROUNDTRIPCLIENT_STUB_HAS_DLL == 1 */ +# define ROUNDTRIPCLIENT_STUB_Export +# define ROUNDTRIPCLIENT_STUB_SINGLETON_DECLARATION(T) +# define ROUNDTRIPCLIENT_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* ROUNDTRIPCLIENT_STUB_HAS_DLL == 1 */ + +// Set ROUNDTRIPCLIENT_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (ROUNDTRIPCLIENT_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define ROUNDTRIPCLIENT_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define ROUNDTRIPCLIENT_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !ROUNDTRIPCLIENT_STUB_NTRACE */ + +#if (ROUNDTRIPCLIENT_STUB_NTRACE == 1) +# define ROUNDTRIPCLIENT_STUB_TRACE(X) +#else /* (ROUNDTRIPCLIENT_STUB_NTRACE == 1) */ +# define ROUNDTRIPCLIENT_STUB_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (ROUNDTRIPCLIENT_STUB_NTRACE == 1) */ + +#endif /* ROUNDTRIPCLIENT_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_svnt_export.h b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_svnt_export.h new file mode 100644 index 00000000000..a760c548604 --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_svnt_export.h @@ -0,0 +1,49 @@ +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl ROUNDTRIPCLIENT_SVNT +// ------------------------------ +#ifndef ROUNDTRIPCLIENT_SVNT_EXPORT_H +#define ROUNDTRIPCLIENT_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (ROUNDTRIPCLIENT_SVNT_HAS_DLL) +# define ROUNDTRIPCLIENT_SVNT_HAS_DLL 1 +#endif /* ! ROUNDTRIPCLIENT_SVNT_HAS_DLL */ + +#if defined (ROUNDTRIPCLIENT_SVNT_HAS_DLL) && (ROUNDTRIPCLIENT_SVNT_HAS_DLL == 1) +# if defined (ROUNDTRIPCLIENT_SVNT_BUILD_DLL) +# define ROUNDTRIPCLIENT_SVNT_Export ACE_Proper_Export_Flag +# define ROUNDTRIPCLIENT_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define ROUNDTRIPCLIENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* ROUNDTRIPCLIENT_SVNT_BUILD_DLL */ +# define ROUNDTRIPCLIENT_SVNT_Export ACE_Proper_Import_Flag +# define ROUNDTRIPCLIENT_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define ROUNDTRIPCLIENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* ROUNDTRIPCLIENT_SVNT_BUILD_DLL */ +#else /* ROUNDTRIPCLIENT_SVNT_HAS_DLL == 1 */ +# define ROUNDTRIPCLIENT_SVNT_Export +# define ROUNDTRIPCLIENT_SVNT_SINGLETON_DECLARATION(T) +# define ROUNDTRIPCLIENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* ROUNDTRIPCLIENT_SVNT_HAS_DLL == 1 */ + +// Set ROUNDTRIPCLIENT_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (ROUNDTRIPCLIENT_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define ROUNDTRIPCLIENT_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define ROUNDTRIPCLIENT_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !ROUNDTRIPCLIENT_SVNT_NTRACE */ + +#if (ROUNDTRIPCLIENT_SVNT_NTRACE == 1) +# define ROUNDTRIPCLIENT_SVNT_TRACE(X) +#else /* (ROUNDTRIPCLIENT_SVNT_NTRACE == 1) */ +# define ROUNDTRIPCLIENT_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (ROUNDTRIPCLIENT_SVNT_NTRACE == 1) */ + +#endif /* ROUNDTRIPCLIENT_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/client.cpp b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/client.cpp new file mode 100644 index 00000000000..23b58d9cece --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/client.cpp @@ -0,0 +1,51 @@ +// $Id$ + +//============================================================== +/** + * @file client.cpp + * + * This is a simple client test program that interact with the RoundTrip + * component implementation. The single threaded client issues + * two-way operations, the total latency (response time) is measured + * NOTE: this client implementation has been adapted from the + * $TAO_ROOT/performance-results/Latency/Single_Threaded/ + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + */ +//============================================================== +#include "RoundTripClientC.h" + +const char *ior = "file://test.ior"; + +int +main (int argc, char *argv[]) +{ + try + { + + // Initialize orb + CORBA::ORB_var orb = CORBA::ORB_init (argc, + argv, + ""); + + // Resolve HomeFinder interface + CORBA::Object_var obj + = orb->string_to_object (ior); + Benchmark::RoundTripClient_var test = + Benchmark::RoundTripClient::_narrow(obj.in()); + //Get the RoundTrip reference + Benchmark::Controller_var trigger = test->provide_controller (); + + //Send a trigger to start the test + trigger->start(); + + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception Handled:"); + return 1; + } + + + return 0; +} diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/run_test.pl b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/run_test.pl new file mode 100755 index 00000000000..e26d55c1a66 --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/run_test.pl @@ -0,0 +1,103 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +# +# @@ Run this script from ../descriptors/ instead. +# + +use lib "$ENV{'ACE_ROOT'}/bin"; +use PerlACE::Run_Test; + +$status = 0; +$daemon_ior = PerlACE::LocalFile ("daemon.ior"); +$am_ior = PerlACE::LocalFile ("am.ior"); + +$ACE_ROOT=$ENV{'ACE_ROOT'}; +$CIAO_ROOT=$ENV{'CIAO_ROOT'}; + +if ($CIAO_ROOT eq "") { + $CIAO_ROOT="$ACE_ROOT/TAO/CIAO"; +} + +unlink $daemon_ior; +unlink $am_ior; + + +# CIAO Daemon command line arguments +$daemon_args1 = "-ORBEndpoint iiop://localhost:10000 -o $daemon_ior -i CIAO_Installation_Data.ini -n $CIAO_ROOT/tools/ComponentServer/ComponentServer"; + +#CIAO Daemond Remote command line arguments +$daemon_args2 = "-ORBEndpoint iiop://localhost:12000 -o $daemon_ior -i CIAO_Installation_Data.ini -n $CIAO_ROOT/tools/ComponentServer/ComponentServer"; + +$assembly_manager_args = "-o $am_ior -c test.dat"; + +$ad_args = " -k file://$am_ior -a RoundTripClient.cad"; + +# CIAO daemon process definition +$DS = new PerlACE::Process ("$CIAO_ROOT/tools/Daemon/CIAO_Daemon", + "$daemon_args1"); + +## Starting up the CIAO daemon +$DS->Spawn (); +if (PerlACE::waitforfile_timed ($daemon_ior, 15) == -1) { + print STDERR "ERROR: Could not find daemon ior file <$daemon_ior>\n"; + $DS->Kill (); + exit 1; +} + +# CIAO daemon process definition +$DS2 = new PerlACE::Process ("$CIAO_ROOT/tools/Daemon/CIAO_Daemon", + "$daemon_args2"); + +## Starting up the CIAO daemon +$DS2->Spawn (); +if (PerlACE::waitforfile_timed ($daemon_ior, 15) == -1) { + print STDERR "ERROR: Could not find daemon ior file <$daemon_ior>\n"; + $DS->Kill (); + exit 1; +} + +$AM = new PerlACE::Process("$CIAO_ROOT/tools/Assembly_Deployer/Assembly_Manager", + $assembly_manager_args); +$AM->Spawn (); +if (PerlACE::waitforfile_timed ($am_ior, 15) == -1) { + print STDERR "ERROR: Could not find assembly ior file <$am_ior>\n"; + $AM->Kill (); + exit 1; +} + +$AD = new PerlACE::Process("$CIAO_ROOT/tools/Assembly_Deployer/Assembly_Deployer", + $ad_args); +$AD->Spawn (); + +sleep (5); + +#Start the client to send the trigger message +$CL = new PerlACE::Process ("../RoundTripClient/client", ""); +$CL->SpawnWaitKill(60); + +#$ctrl = $DS->WaitKill (5); +#$AM->WaitKill(5); +#$AD->WaitKill(5); + +$AM->Kill (); +$AD->Kill (); +$DS->Kill (); +$DS2->Kill(); + +#if ($ctrl != 0) { +# print STDERR "ERROR: CIAODaemon didn't shutdown gracefully $ctrl\n"; +# $DS->Kill (); +# exit 1; +#} + +$CL->Kill (); + +unlink $daemon_ior; +unlink $am_ior; + +exit $status; diff --git a/modules/CIAO/performance-tests/Benchmark/RoundTripClient/run_test_ior_cad.pl b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/run_test_ior_cad.pl new file mode 100755 index 00000000000..bb665cc499a --- /dev/null +++ b/modules/CIAO/performance-tests/Benchmark/RoundTripClient/run_test_ior_cad.pl @@ -0,0 +1,78 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +# +# @@ Run this script from ../descriptors/ instead. +# + +use lib "$ENV{'ACE_ROOT'}/bin"; +use PerlACE::Run_Test; + +$status = 0; +$daemon_ior = PerlACE::LocalFile ("daemon.ior"); +$am_ior = PerlACE::LocalFile ("am.ior"); + +$ACE_ROOT=$ENV{'ACE_ROOT'}; +$CIAO_ROOT=$ENV{'CIAO_ROOT'}; + +if ($CIAO_ROOT eq "") { + $CIAO_ROOT="$ACE_ROOT/TAO/CIAO"; +} + +unlink $daemon_ior; +unlink $am_ior; + + +# CIAO Daemon command line arguments +$daemon_args = "-c $CIAO_ROOT/performance-tests/Benchmark/RoundTrip/svc.conf -ORBEndpoint iiop://localhost:10000 -o $daemon_ior -i CIAO_Installation_Data.ini -n $CIAO_ROOT/tools/ComponentServer/ComponentServer"; + +$assembly_manager_args = "-o $am_ior -c test.dat"; + +$ad_args = " -k file://$am_ior -a Test-IOR.cad"; + +# CIAO daemon process definition +$DS = new PerlACE::Process ("$CIAO_ROOT/tools/Daemon/CIAO_Daemon", + "$daemon_args"); + +## Starting up the CIAO daemon +$DS->Spawn (); +if (PerlACE::waitforfile_timed ($daemon_ior, 15) == -1) { + print STDERR "ERROR: Could not find daemon ior file <$daemon_ior>\n"; + $DS->Kill (); + exit 1; +} + + +$AM = new PerlACE::Process("$CIAO_ROOT/tools/Assembly_Deployer/Assembly_Manager", + $assembly_manager_args); +$AM->Spawn (); +if (PerlACE::waitforfile_timed ($am_ior, 15) == -1) { + print STDERR "ERROR: Could not find assembly ior file <$am_ior>\n"; + $AM->Kill (); + exit 1; +} + +$AD = new PerlACE::Process("$CIAO_ROOT/tools/Assembly_Deployer/Assembly_Deployer", + $ad_args); +$AD->Spawn (); + +sleep (5); + +#Start the client to send the trigger message +$CL = new PerlACE::Process ("../RoundTripClient/client", ""); +$CL->SpawnWaitKill(60); + +$AM->Kill (); +$AD->Kill (); +$DS->Kill (); +#$CL->Kill (); + +#unlink $daemon_ior; +#unlink $am_ior; +unlink rtserver.ior; + +exit $status; |