summaryrefslogtreecommitdiff
path: root/ace/Basic_Stats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/Basic_Stats.cpp')
-rw-r--r--ace/Basic_Stats.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/ace/Basic_Stats.cpp b/ace/Basic_Stats.cpp
index f81b29bfcaa..e727d1c8224 100644
--- a/ace/Basic_Stats.cpp
+++ b/ace/Basic_Stats.cpp
@@ -46,7 +46,35 @@ ACE_Basic_Stats::accumulate (const ACE_Basic_Stats &rhs)
}
void
-ACE_Basic_Stats::dump_results (const ACE_TCHAR *msg,
+ACE_Basic_Stats::dump_results (const char *msg,
+ ACE_UINT32 sf) const
+{
+#ifndef ACE_NLOGGING
+ if (this->samples_count () == 0u)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("%s : no data collected\n"), msg));
+ return;
+ }
+
+ ACE_UINT64 avg = this->sum_ / this->samples_count_;
+
+ ACE_UINT64 l_min = this->min_ / sf;
+ ACE_UINT64 l_max = this->max_ / sf;
+ ACE_UINT64 l_avg = avg / sf;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("%s latency : %Q[%d]/%Q/%Q[%d] (min/avg/max)\n"),
+ msg,
+ l_min, this->min_at_,
+ l_avg,
+ l_max, this->max_at_));
+
+#endif /* ACE_NLOGGING */
+}
+
+void
+ACE_Basic_Stats::dump_results (const wchar_t *msg,
ACE_UINT32 sf) const
{
#ifndef ACE_NLOGGING