summaryrefslogtreecommitdiff
path: root/ace/Stats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/Stats.cpp')
-rw-r--r--ace/Stats.cpp37
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 */
}
// ****************************************************************