summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsergio <sergio@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-15 23:55:02 +0000
committersergio <sergio@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-15 23:55:02 +0000
commit97eee6e20e5150b957b41d930752203e2bd2fc8e (patch)
tree82fb0fa0140dbfded4d26043767ce5027ade385b
parent3b7462cc18dfabbeb4bcbd05834bb5d7412ff116 (diff)
downloadATCD-97eee6e20e5150b957b41d930752203e2bd2fc8e.tar.gz
*** empty log message ***
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp2
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp48
-rw-r--r--TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp2
-rw-r--r--TAO/tests/Cubit/TAO/MT_Cubit/client.cpp48
4 files changed, 94 insertions, 6 deletions
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
index 6d4586be46c..a35de233c2b 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
@@ -810,7 +810,7 @@ Client::run_tests (Cubit_ptr cb,
#if defined (ACE_LACKS_FLOATING_POINT)
double calls_per_second = (call_count * ACE_ONE_SECOND_IN_USECS) / latency;
#endif /* ACE_LACKS_FLOATING_POINT */
-
+printf("@@@@ Latency = %f\n", latency);
latency /= call_count; // calc average latency
if (latency > 0)
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
index 1587dacd8c3..df7a54c5a5c 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
@@ -41,12 +41,17 @@ initialize (void)
int
do_priority_inversion_test (Task_State &ts)
{
- u_int i;
+ u_int i, j;
// stores the total number of context switches incurred by the
// program while making CORBA requests
u_int context_switch = 0;
-
+ double util_task_duration = 0.0;
+ double total_latency = 0.0;
+ double total_latency_low = 0.0;
+ double total_latency_high = 0.0;
+ double total_util_task_duration = 0.0;
+
// Create the clients.
Client high_priority_client (&ts);
Client low_priority_client (&ts);
@@ -56,6 +61,24 @@ do_priority_inversion_test (Task_State &ts)
Util_Thread util_thread (&ts, &thr_mgr);
+ ACE_High_Res_Timer timer_;
+ // Elapsed time will be in microseconds.
+ ACE_Time_Value delta_t;
+ // Store the time in secs.
+ timer_.start ();
+
+ ACE::is_prime (CUBIT_ARBIT_NUMBER,
+ 2,
+ CUBIT_ARBIT_NUMBER / 2);
+
+ timer_.stop ();
+ timer_.elapsed_time (delta_t);
+
+ util_task_duration = delta_t.sec () + (double)delta_t.usec () / ACE_ONE_SECOND_IN_USECS;
+
+ printf ("Utilization Computation time is %f secs\n", util_task_duration);
+
+
// The minimum priority thread is the utilization thread.
ACE_Sched_Priority priority =
ACE_Sched_Params::priority_min (ACE_SCHED_FIFO,
@@ -212,6 +235,27 @@ do_priority_inversion_test (Task_State &ts)
// This will wait for the utilization thread to finish.
thr_mgr.wait ();
+ // This loop visits each client. start_count_ is the number of clients.
+ for (j = 1; j < ts.start_count_; j ++)
+ for (i = 0; i < ts.loop_count_; i ++)
+ total_latency_low += ts.global_jitter_array_[j][i];
+
+ for (i = 0; i < ts.loop_count_; i ++)
+ total_latency_high += ts.global_jitter_array_[0][i];
+
+ total_latency = total_latency_low +
+ total_latency_high +
+ total_util_task_duration;
+
+ total_util_task_duration = util_task_duration * util_thread.get_number_of_computations ();
+
+ printf ("\t%% Low Priority CPU utilization: %f %%\n"
+ "\t%% High Priority CPU utilization: %f %%\n"
+ "\t%% IDLE time: %f %%\n",
+ (total_latency_low/total_latency)*100,
+ (total_latency_high/total_latency)*100,
+ (total_util_task_duration/total_latency)*100 );
+
#if defined (ACE_LACKS_FLOATING_POINT)
ACE_DEBUG ((LM_DEBUG,
"(%t) utilization task performed %u computations\n",
diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
index 6d4586be46c..a35de233c2b 100644
--- a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
+++ b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
@@ -810,7 +810,7 @@ Client::run_tests (Cubit_ptr cb,
#if defined (ACE_LACKS_FLOATING_POINT)
double calls_per_second = (call_count * ACE_ONE_SECOND_IN_USECS) / latency;
#endif /* ACE_LACKS_FLOATING_POINT */
-
+printf("@@@@ Latency = %f\n", latency);
latency /= call_count; // calc average latency
if (latency > 0)
diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
index 1587dacd8c3..df7a54c5a5c 100644
--- a/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
+++ b/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp
@@ -41,12 +41,17 @@ initialize (void)
int
do_priority_inversion_test (Task_State &ts)
{
- u_int i;
+ u_int i, j;
// stores the total number of context switches incurred by the
// program while making CORBA requests
u_int context_switch = 0;
-
+ double util_task_duration = 0.0;
+ double total_latency = 0.0;
+ double total_latency_low = 0.0;
+ double total_latency_high = 0.0;
+ double total_util_task_duration = 0.0;
+
// Create the clients.
Client high_priority_client (&ts);
Client low_priority_client (&ts);
@@ -56,6 +61,24 @@ do_priority_inversion_test (Task_State &ts)
Util_Thread util_thread (&ts, &thr_mgr);
+ ACE_High_Res_Timer timer_;
+ // Elapsed time will be in microseconds.
+ ACE_Time_Value delta_t;
+ // Store the time in secs.
+ timer_.start ();
+
+ ACE::is_prime (CUBIT_ARBIT_NUMBER,
+ 2,
+ CUBIT_ARBIT_NUMBER / 2);
+
+ timer_.stop ();
+ timer_.elapsed_time (delta_t);
+
+ util_task_duration = delta_t.sec () + (double)delta_t.usec () / ACE_ONE_SECOND_IN_USECS;
+
+ printf ("Utilization Computation time is %f secs\n", util_task_duration);
+
+
// The minimum priority thread is the utilization thread.
ACE_Sched_Priority priority =
ACE_Sched_Params::priority_min (ACE_SCHED_FIFO,
@@ -212,6 +235,27 @@ do_priority_inversion_test (Task_State &ts)
// This will wait for the utilization thread to finish.
thr_mgr.wait ();
+ // This loop visits each client. start_count_ is the number of clients.
+ for (j = 1; j < ts.start_count_; j ++)
+ for (i = 0; i < ts.loop_count_; i ++)
+ total_latency_low += ts.global_jitter_array_[j][i];
+
+ for (i = 0; i < ts.loop_count_; i ++)
+ total_latency_high += ts.global_jitter_array_[0][i];
+
+ total_latency = total_latency_low +
+ total_latency_high +
+ total_util_task_duration;
+
+ total_util_task_duration = util_task_duration * util_thread.get_number_of_computations ();
+
+ printf ("\t%% Low Priority CPU utilization: %f %%\n"
+ "\t%% High Priority CPU utilization: %f %%\n"
+ "\t%% IDLE time: %f %%\n",
+ (total_latency_low/total_latency)*100,
+ (total_latency_high/total_latency)*100,
+ (total_util_task_duration/total_latency)*100 );
+
#if defined (ACE_LACKS_FLOATING_POINT)
ACE_DEBUG ((LM_DEBUG,
"(%t) utilization task performed %u computations\n",