aboutsummaryrefslogtreecommitdiff
path: root/externals/ace/Throughput_Stats.h
diff options
context:
space:
mode:
authorXanadu <none@none>2010-07-20 02:49:28 +0200
committerXanadu <none@none>2010-07-20 02:49:28 +0200
commit79622802f397258ee0f34327ba3ae6977ca3e7ff (patch)
tree1868946c234ab9ee256a6b7766a15713eae94235 /externals/ace/Throughput_Stats.h
parent7dd2dc91816ab8b3bc3b99a1b1c99c7ea314d5a8 (diff)
parentf906976837502fa5aa81b982b901d1509f5aa0c4 (diff)
Merge. Revision history for source files should be all back now.
--HG-- branch : trunk rename : sql/CMakeLists.txt => sql/tools/CMakeLists.txt rename : src/server/game/Pools/PoolHandler.cpp => src/server/game/Pools/PoolMgr.cpp rename : src/server/game/Pools/PoolHandler.h => src/server/game/Pools/PoolMgr.h rename : src/server/game/PrecompiledHeaders/NixCorePCH.cpp => src/server/game/PrecompiledHeaders/gamePCH.cpp rename : src/server/game/PrecompiledHeaders/NixCorePCH.h => src/server/game/PrecompiledHeaders/gamePCH.h
Diffstat (limited to 'externals/ace/Throughput_Stats.h')
-rw-r--r--externals/ace/Throughput_Stats.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/externals/ace/Throughput_Stats.h b/externals/ace/Throughput_Stats.h
new file mode 100644
index 00000000000..c306c856c5e
--- /dev/null
+++ b/externals/ace/Throughput_Stats.h
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+//==========================================================================
+/**
+ * @file Throughput_Stats.h
+ *
+ * $Id: Throughput_Stats.h 80826 2008-03-04 14:51:23Z wotte $
+ *
+ * @author David L. Levine
+ */
+//==========================================================================
+
+
+#ifndef ACE_THROUGHPUT_STATS_H
+#define ACE_THROUGHPUT_STATS_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/ACE_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Basic_Stats.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// A simple class to make throughput and latency analysis.
+/**
+ *
+ * Keep the relevant information to perform throughput and latency
+ * analysis, including:
+ * -# Minimum, Average and Maximum latency
+ * -# Jitter for the latency
+ * -# Linear regression for throughput
+ * -# Accumulate results from several samples to obtain aggregated
+ * results, across several threads or experiments.
+ *
+ * @todo The idea behind this class was to use linear regression to
+ * determine if the throughput was linear or exhibited jitter.
+ * Unfortunately it never worked quite right, so only average
+ * throughput is computed.
+ */
+class ACE_Export ACE_Throughput_Stats : public ACE_Basic_Stats
+{
+public:
+ /// Constructor
+ ACE_Throughput_Stats (void);
+
+ /// Store one sample
+ void sample (ACE_UINT64 throughput, ACE_UINT64 latency);
+
+ /// Update the values to reflect the stats in @a throughput
+ void accumulate (const ACE_Throughput_Stats &throughput);
+
+ /// Print down the stats
+ void dump_results (const ACE_TCHAR* msg, ACE_UINT32 scale_factor);
+
+ /// Dump the average throughput stats.
+ static void dump_throughput (const ACE_TCHAR *msg,
+ ACE_UINT32 scale_factor,
+ ACE_UINT64 elapsed_time,
+ ACE_UINT32 samples_count);
+private:
+ /// The last throughput measurement.
+ ACE_UINT64 throughput_last_;
+
+#if 0
+ /// These are the fields that we should keep to perform linear
+ /// regression
+ //@{
+ ///@}
+ ACE_UINT64 throughput_sum_x_;
+ ACE_UINT64 throughput_sum_x2_;
+ ACE_UINT64 throughput_sum_y_;
+ ACE_UINT64 throughput_sum_y2_;
+ ACE_UINT64 throughput_sum_xy_;
+#endif /* 0 */
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* ! ACE_THROUGHPUT_STATS_H */