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.cpp38
1 files changed, 30 insertions, 8 deletions
diff --git a/ace/Basic_Stats.cpp b/ace/Basic_Stats.cpp
index f81b29bfcaa..ed0be542095 100644
--- a/ace/Basic_Stats.cpp
+++ b/ace/Basic_Stats.cpp
@@ -7,11 +7,7 @@
#include "ace/Basic_Stats.inl"
#endif /* __ACE_INLINE__ */
-ACE_RCSID(ace,
- Basic_Stats,
- "$Id$")
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ACE_RCSID(ace, Basic_Stats, "$Id$")
void
ACE_Basic_Stats::accumulate (const ACE_Basic_Stats &rhs)
@@ -32,7 +28,7 @@ ACE_Basic_Stats::accumulate (const ACE_Basic_Stats &rhs)
if (this->min_ > rhs.min_)
{
this->min_ = rhs.min_;
- this->min_at_ = rhs.min_at_;
+ this->min_at_ = rhs.min_at_;
}
if (this->max_ < rhs.max_)
{
@@ -46,7 +42,7 @@ 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
@@ -73,4 +69,30 @@ ACE_Basic_Stats::dump_results (const ACE_TCHAR *msg,
#endif /* ACE_NLOGGING */
}
-ACE_END_VERSIONED_NAMESPACE_DECL
+void
+ACE_Basic_Stats::dump_results (const wchar_t *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 */
+}