diff options
author | john_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-11-17 22:34:16 +0000 |
---|---|---|
committer | john_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-11-17 22:34:16 +0000 |
commit | de97c7b4481f0925cbbafa10f582f09255e72999 (patch) | |
tree | aba011f43c2f74492cb78a29ae9e9a922699ed2a | |
parent | 4c1cdd6f6541287cd8bc7aaf09bcbc2677a01374 (diff) | |
download | ATCD-de97c7b4481f0925cbbafa10f582f09255e72999.tar.gz |
Dave's wchar fixes
-rw-r--r-- | ace/Stats.cpp | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/ace/Stats.cpp b/ace/Stats.cpp index 486eae5c360..bd371c95169 100644 --- a/ace/Stats.cpp +++ b/ace/Stats.cpp @@ -585,7 +585,18 @@ void ACE_Throughput_Stats::dump_results (const wchar_t* msg, ACE_UINT32 sf) { - // TODO + if (this->samples_count () == 0u) + { + ACE_DEBUG ((LM_DEBUG, + ACE_LIB_TEXT ("%s : no data collected\n"), msg)); + return; + } + + this->ACE_Basic_Stats::dump_results (msg, sf); + + ACE_Throughput_Stats::dump_throughput (msg, sf, + this->throughput_last_, + this->samples_count ()); } void @@ -625,7 +636,29 @@ ACE_Throughput_Stats::dump_throughput (const wchar_t *msg, ACE_UINT64 elapsed_time, ACE_UINT32 samples_count) { - // TODO +#ifndef ACE_NLOGGING + double seconds = +# if defined ACE_LACKS_LONGLONG_T + elapsed_time / sf; +#elif defined (ACE_LACKS_UNSIGNEDLONGLONG_T) + static_cast<double> (ACE_UINT64_DBLCAST_ADAPTER ( + ACE_U_LongLong(elapsed_time / sf))); +# else /* ! ACE_LACKS_LONGLONG_T */ + static_cast<double> (ACE_UINT64_DBLCAST_ADAPTER (elapsed_time / sf)); +# endif /* ! ACE_LACKS_LONGLONG_T */ + seconds /= ACE_HR_SCALE_CONVERSION; + + const double t_avg = samples_count / seconds; + + ACE_DEBUG ((LM_DEBUG, + ACE_LIB_TEXT ("%s throughput: %.2f (events/second)\n"), + msg, t_avg)); +#else + ACE_UNUSED_ARG (msg); + ACE_UNUSED_ARG (sf); + ACE_UNUSED_ARG (elapsed_time); + ACE_UNUSED_ARG (samples_count); +#endif /* ACE_NLOGGING */ } // **************************************************************** |