diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-05-21 14:13:00 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-05-21 14:13:00 +0000 |
commit | 2b0965127ee819d634993719eaaa2944b469c9a4 (patch) | |
tree | bac7e686e67826a69ea8713edc54a2c8479c76f1 | |
parent | 15fddd170ee6bf668f57d8dd5528b625f95a7de4 (diff) | |
download | ATCD-2b0965127ee819d634993719eaaa2944b469c9a4.tar.gz |
added used of ACE_Stats
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp | 26 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp | 26 |
2 files changed, 40 insertions, 12 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 85770719955..289727ec94b 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp @@ -1,6 +1,7 @@ // $Id$ #include "Task_Client.h" +#include "ace/Stats.h" Task_State::Task_State (int argc, char **argv) : key_ ("Cubit"), @@ -183,9 +184,9 @@ Client::get_high_priority_latency (void) double Client::get_low_priority_latency (void) { - if (ts_->thread_count_ == 1) + if (ts_->thread_count_ == 1) return 0; - + double l = 0; for (u_int i = 1; i < ts_->thread_count_; i++) @@ -210,26 +211,33 @@ Client::get_high_priority_jitter (void) // Compute the standard deviation (i.e. jitter) from the values // stored in the global_jitter_array_. - // we first compute the sum of the squares of the differences + ACE_Stats stats; + + // We first compute the sum of the squares of the differences // each latency has from the average for (u_int i = 0; i < ts_->loop_count_ / ts_->granularity_; i ++) { double difference = ts_->global_jitter_array_ [0][i] - average; jitter += difference * difference; + stats.sample ((ACE_UINT32) (ts_->global_jitter_array_ [0][i] * 1000 + 0.5)); } // Return the square root of the sum of the differences computed // above, i.e. jitter. + + ACE_OS::fprintf (stderr, "high priority jitter:\n"); + stats.print_summary (3, 1000, stderr); + return sqrt (jitter / (number_of_samples - 1)); } double Client::get_low_priority_jitter (void) { - if (ts_->thread_count_ == 1) + if (ts_->thread_count_ == 1) return 0; - + double jitter = 0.0; double average = get_low_priority_latency (); double number_of_samples = (ts_->thread_count_ - 1) * (ts_->loop_count_ / ts_->granularity_); @@ -237,6 +245,8 @@ Client::get_low_priority_jitter (void) // Compute the standard deviation (i.e. jitter) from the values // stored in the global_jitter_array_. + ACE_Stats stats; + // We first compute the sum of the squares of the differences each // latency has from the average. for (u_int j = 1; j < ts_->thread_count_; j ++) @@ -245,8 +255,12 @@ Client::get_low_priority_jitter (void) double difference = ts_->global_jitter_array_[j][i] - average; jitter += difference * difference; + stats.sample ((ACE_UINT32) (ts_->global_jitter_array_ [j][i] * 1000 + 0.5)); } + ACE_OS::fprintf (stderr, "low priority jitter:\n"); + stats.print_summary (3, 1000, stderr); + // Return the square root of the sum of the differences computed // above, i.e. jitter. return sqrt (jitter / (number_of_samples - 1)); @@ -593,7 +607,7 @@ Client::run_tests (Cubit_ptr cb, quantify_stop_recording_data(); quantify_clear_data (); #endif /* USE_QUANTIFY */ - + // Make the calls in a loop. ACE_High_Res_Timer * timer_ = 0; diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp index 85770719955..289727ec94b 100644 --- a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp +++ b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp @@ -1,6 +1,7 @@ // $Id$ #include "Task_Client.h" +#include "ace/Stats.h" Task_State::Task_State (int argc, char **argv) : key_ ("Cubit"), @@ -183,9 +184,9 @@ Client::get_high_priority_latency (void) double Client::get_low_priority_latency (void) { - if (ts_->thread_count_ == 1) + if (ts_->thread_count_ == 1) return 0; - + double l = 0; for (u_int i = 1; i < ts_->thread_count_; i++) @@ -210,26 +211,33 @@ Client::get_high_priority_jitter (void) // Compute the standard deviation (i.e. jitter) from the values // stored in the global_jitter_array_. - // we first compute the sum of the squares of the differences + ACE_Stats stats; + + // We first compute the sum of the squares of the differences // each latency has from the average for (u_int i = 0; i < ts_->loop_count_ / ts_->granularity_; i ++) { double difference = ts_->global_jitter_array_ [0][i] - average; jitter += difference * difference; + stats.sample ((ACE_UINT32) (ts_->global_jitter_array_ [0][i] * 1000 + 0.5)); } // Return the square root of the sum of the differences computed // above, i.e. jitter. + + ACE_OS::fprintf (stderr, "high priority jitter:\n"); + stats.print_summary (3, 1000, stderr); + return sqrt (jitter / (number_of_samples - 1)); } double Client::get_low_priority_jitter (void) { - if (ts_->thread_count_ == 1) + if (ts_->thread_count_ == 1) return 0; - + double jitter = 0.0; double average = get_low_priority_latency (); double number_of_samples = (ts_->thread_count_ - 1) * (ts_->loop_count_ / ts_->granularity_); @@ -237,6 +245,8 @@ Client::get_low_priority_jitter (void) // Compute the standard deviation (i.e. jitter) from the values // stored in the global_jitter_array_. + ACE_Stats stats; + // We first compute the sum of the squares of the differences each // latency has from the average. for (u_int j = 1; j < ts_->thread_count_; j ++) @@ -245,8 +255,12 @@ Client::get_low_priority_jitter (void) double difference = ts_->global_jitter_array_[j][i] - average; jitter += difference * difference; + stats.sample ((ACE_UINT32) (ts_->global_jitter_array_ [j][i] * 1000 + 0.5)); } + ACE_OS::fprintf (stderr, "low priority jitter:\n"); + stats.print_summary (3, 1000, stderr); + // Return the square root of the sum of the differences computed // above, i.e. jitter. return sqrt (jitter / (number_of_samples - 1)); @@ -593,7 +607,7 @@ Client::run_tests (Cubit_ptr cb, quantify_stop_recording_data(); quantify_clear_data (); #endif /* USE_QUANTIFY */ - + // Make the calls in a loop. ACE_High_Res_Timer * timer_ = 0; |