From d9abba305ce7937b30b4ef7dda86d10c04499305 Mon Sep 17 00:00:00 2001 From: nobody Date: Mon, 21 Apr 2003 17:04:40 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'unlabeled-1.2.40'. --- .../Single_Threaded_Latency/Roundtrip.cpp | 26 ---- .../Single_Threaded_Latency/Roundtrip.h | 46 ------ .../Single_Threaded_Latency/client.cpp | 164 --------------------- .../Single_Threaded_Latency/server.cpp | 136 ----------------- 4 files changed, 372 deletions(-) delete mode 100644 TAO/performance-tests/Single_Threaded_Latency/Roundtrip.cpp delete mode 100644 TAO/performance-tests/Single_Threaded_Latency/Roundtrip.h delete mode 100644 TAO/performance-tests/Single_Threaded_Latency/client.cpp delete mode 100644 TAO/performance-tests/Single_Threaded_Latency/server.cpp (limited to 'TAO/performance-tests/Single_Threaded_Latency') diff --git a/TAO/performance-tests/Single_Threaded_Latency/Roundtrip.cpp b/TAO/performance-tests/Single_Threaded_Latency/Roundtrip.cpp deleted file mode 100644 index 72f83576b44..00000000000 --- a/TAO/performance-tests/Single_Threaded_Latency/Roundtrip.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// -// $Id$ -// -#include "Roundtrip.h" - -ACE_RCSID(Single_Threaded_Latency, Roundtrip, "$Id$") - -Roundtrip::Roundtrip (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -Test::Timestamp -Roundtrip::test_method (Test::Timestamp send_time - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return send_time; -} - -void -Roundtrip::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/performance-tests/Single_Threaded_Latency/Roundtrip.h b/TAO/performance-tests/Single_Threaded_Latency/Roundtrip.h deleted file mode 100644 index efef33dd7e6..00000000000 --- a/TAO/performance-tests/Single_Threaded_Latency/Roundtrip.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// $Id$ -// - -#ifndef ROUNDTRIP_H -#define ROUNDTRIP_H -#include "ace/pre.h" - -#include "TestS.h" - -#if defined (_MSC_VER) -# if (_MSC_VER >= 1200) -# pragma warning(push) -# endif /* _MSC_VER >= 1200 */ -# pragma warning (disable:4250) -#endif /* _MSC_VER */ - -/// Implement the Test::Roundtrip interface -class Roundtrip - : public virtual POA_Test::Roundtrip - , public virtual PortableServer::RefCountServantBase -{ -public: - /// Constructor - Roundtrip (CORBA::ORB_ptr orb); - - // = The skeleton methods - virtual Test::Timestamp test_method (Test::Timestamp send_time - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - /// Use an ORB reference to conver strings to objects and shutdown - /// the application. - CORBA::ORB_var orb_; -}; - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma warning(pop) -#endif /* _MSC_VER */ - -#include "ace/post.h" -#endif /* ROUNDTRIP_H */ diff --git a/TAO/performance-tests/Single_Threaded_Latency/client.cpp b/TAO/performance-tests/Single_Threaded_Latency/client.cpp deleted file mode 100644 index 2d841b9909d..00000000000 --- a/TAO/performance-tests/Single_Threaded_Latency/client.cpp +++ /dev/null @@ -1,164 +0,0 @@ -// $Id$ - -#include "TestC.h" -#include "ace/Get_Opt.h" -#include "ace/High_Res_Timer.h" -#include "ace/Sched_Params.h" -#include "ace/Stats.h" -#include "ace/Sample_History.h" - -#include "tao/Strategies/advanced_resource.h" - -ACE_RCSID(Single_Threaded_Latency, client, "$Id$") - -const char *ior = "file://test.ior"; -int niterations = 100; -int do_dump_history = 0; -int do_shutdown = 1; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "hxk:i:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'h': - do_dump_history = 1; - break; - - case 'x': - do_shutdown = 0; - break; - - case 'k': - ior = get_opts.opt_arg (); - break; - - case 'i': - niterations = ACE_OS::atoi (get_opts.opt_arg ()); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k " - "-i " - "-x (disable shutdown) " - "-h (dump history) " - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - int priority = - (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) - + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2; - // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. - - if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO, - priority, - ACE_SCOPE_PROCESS)) != 0) - { - if (ACE_OS::last_error () == EPERM) - { - ACE_DEBUG ((LM_DEBUG, - "client (%P|%t): user is not superuser, " - "test runs in time-shared class\n")); - } - else - ACE_ERROR ((LM_ERROR, - "client (%P|%t): sched_params failed\n")); - } - - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test::Roundtrip_var roundtrip = - Test::Roundtrip::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (roundtrip.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Nil Test::Roundtrip reference <%s>\n", - ior), - 1); - } - - for (int j = 0; j < 100; ++j) - { - ACE_hrtime_t start = 0; - (void) roundtrip->test_method (start ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - - 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) roundtrip->test_method (start 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 ()); - - if (do_shutdown) - { - roundtrip->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/performance-tests/Single_Threaded_Latency/server.cpp b/TAO/performance-tests/Single_Threaded_Latency/server.cpp deleted file mode 100644 index e96f0ff595a..00000000000 --- a/TAO/performance-tests/Single_Threaded_Latency/server.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// $Id$ - -#include "Roundtrip.h" -#include "ace/Get_Opt.h" -#include "ace/Sched_Params.h" - -#include "tao/Strategies/advanced_resource.h" - -ACE_RCSID(Single_Threaded_Latency, server, "$Id$") - -const char *ior_output_file = "test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o " - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - int priority = - (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) - + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2; - priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, - priority); - // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. - - if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO, - priority, - ACE_SCOPE_PROCESS)) != 0) - { - if (ACE_OS::last_error () == EPERM) - { - ACE_DEBUG ((LM_DEBUG, - "server (%P|%t): user is not superuser, " - "test runs in time-shared class\n")); - } - else - ACE_ERROR ((LM_ERROR, - "server (%P|%t): sched_params failed\n")); - } - - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - Roundtrip *roundtrip_impl; - ACE_NEW_RETURN (roundtrip_impl, - Roundtrip (orb.in ()), - 1); - PortableServer::ServantBase_var owner_transfer(roundtrip_impl); - - Test::Roundtrip_var roundtrip = - roundtrip_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (roundtrip.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // If the ior_output_file exists, output the ior to it - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} -- cgit v1.2.1