summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-09-05 22:56:43 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-09-05 22:56:43 +0000
commitc8a01afef7c52cc793e10ff2e89878e2434f3ec1 (patch)
tree3c97d683efe031111541d1aa236b6f3235fb5850
parent1f4947bfd3d30663c2231574e5244c535f0fcbc5 (diff)
downloadATCD-c8a01afef7c52cc793e10ff2e89878e2434f3ec1.tar.gz
Minor changes
-rw-r--r--TAO/performance-tests/RTCorba/Thread_Pool/client.cpp38
-rw-r--r--TAO/performance-tests/RTCorba/Thread_Pool/server.cpp17
-rw-r--r--TAO/performance-tests/RTCorba/Thread_Pool/test.idl2
3 files changed, 25 insertions, 32 deletions
diff --git a/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp b/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp
index b1cde896bcb..87370ef41a7 100644
--- a/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp
+++ b/TAO/performance-tests/RTCorba/Thread_Pool/client.cpp
@@ -15,21 +15,20 @@
ACE_RCSID(Thread_Pool, client, "$Id$")
static const char *ior = "file://ior";
-static size_t iterations_for_slowest_paced_worker = 1;
static int shutdown_server = 0;
static int do_dump_history = 0;
static ACE_UINT32 gsf = 0;
static const char *rates_file = "rates";
-static size_t continuous_workers = 2;
+static size_t continuous_workers = 0;
static int done = 0;
-static default_time_for_test = 10;
-static work_in_milli_seconds = 10;
+static time_for_test = 10;
+static work = 10;
static size_t max_throughput_timeout = 5;
int
parse_args (int argc, char *argv[])
{
- ACE_Get_Opt get_opts (argc, argv, "hxk:i:r:c:w:");
+ ACE_Get_Opt get_opts (argc, argv, "hxk:r:c:w:t:");
int c;
while ((c = get_opts ()) != -1)
@@ -47,11 +46,6 @@ parse_args (int argc, char *argv[])
ior = get_opts.optarg;
break;
- case 'i':
- iterations_for_slowest_paced_worker =
- ACE_OS::atoi (get_opts.optarg);
- break;
-
case 'r':
rates_file = get_opts.optarg;
break;
@@ -61,7 +55,11 @@ parse_args (int argc, char *argv[])
break;
case 'w':
- work_in_milli_seconds = ACE_OS::atoi (get_opts.optarg);
+ work = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 't':
+ time_for_test = ACE_OS::atoi (get_opts.optarg);
break;
case '?':
@@ -114,7 +112,7 @@ get_rates (const char *file_name,
if (string == 0)
{
ACE_DEBUG ((LM_DEBUG,
- "\nNo rates set!\n\n"));
+ "\nNo rates set!\n"));
return 0;
}
@@ -160,7 +158,7 @@ get_rates (const char *file_name,
}
ACE_DEBUG ((LM_DEBUG,
- "\n\n"));
+ "\n"));
return 0;
}
@@ -273,7 +271,7 @@ Paced_Worker::svc (void)
ACE_hrtime_t start = ACE_OS::gethrtime ();
- this->test_->method (work_in_milli_seconds,
+ this->test_->method (work,
ACE_TRY_ENV);
ACE_TRY_CHECK;
@@ -386,7 +384,7 @@ Continuous_Worker::svc (void)
{
ACE_hrtime_t start = ACE_OS::gethrtime ();
- this->test_->method (work_in_milli_seconds,
+ this->test_->method (work,
ACE_TRY_ENV);
ACE_TRY_CHECK;
@@ -454,7 +452,7 @@ max_throughput (test_ptr test,
if (now > end)
break;
- test->method (work_in_milli_seconds,
+ test->method (work,
ACE_TRY_ENV);
ACE_TRY_CHECK;
@@ -546,14 +544,6 @@ main (int argc, char *argv[])
if (result != 0)
return result;
- size_t time_for_test =
- default_time_for_test;
-
- if (lowest_rate != 0)
- time_for_test =
- iterations_for_slowest_paced_worker /
- lowest_rate;
-
CORBA::Short priority_range =
RTCORBA::maxPriority - RTCORBA::minPriority;
diff --git a/TAO/performance-tests/RTCorba/Thread_Pool/server.cpp b/TAO/performance-tests/RTCorba/Thread_Pool/server.cpp
index aabaa0d925a..f641fa33c6b 100644
--- a/TAO/performance-tests/RTCorba/Thread_Pool/server.cpp
+++ b/TAO/performance-tests/RTCorba/Thread_Pool/server.cpp
@@ -17,7 +17,7 @@ public:
test_i (CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa);
- void method (CORBA::ULong work_in_milli_seconds,
+ void method (CORBA::ULong work,
CORBA::Environment &)
ACE_THROW_SPEC ((CORBA::SystemException));
@@ -39,18 +39,21 @@ test_i::test_i (CORBA::ORB_ptr orb,
}
void
-test_i::method (CORBA::ULong work_in_milli_seconds,
+test_i::method (CORBA::ULong work,
CORBA::Environment &)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- ACE_Time_Value sleep_time;
- sleep_time.msec (work_in_milli_seconds);
- ACE_OS::sleep (sleep_time);
+ const u_long prime_number = 9619;
+
+ for (; work != 0; work--)
+ ACE::is_prime (prime_number,
+ 2,
+ prime_number / 2);
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
- "test_i::method: %d milli second of work\n",
- work_in_milli_seconds));
+ "test_i::method: %hd units of work\n",
+ work));
}
PortableServer::POA_ptr
diff --git a/TAO/performance-tests/RTCorba/Thread_Pool/test.idl b/TAO/performance-tests/RTCorba/Thread_Pool/test.idl
index 6025cd82cdf..12e8f884808 100644
--- a/TAO/performance-tests/RTCorba/Thread_Pool/test.idl
+++ b/TAO/performance-tests/RTCorba/Thread_Pool/test.idl
@@ -4,7 +4,7 @@
interface test
{
- void method (in unsigned long work_in_milli_seconds);
+ void method (in unsigned long work);
void shutdown ();
};