3 //==========================================================================
5 * @file Throughput_Stats.h
7 * @author David L. Levine
9 //==========================================================================
12 #ifndef ACE_THROUGHPUT_STATS_H
13 #define ACE_THROUGHPUT_STATS_H
15 #include /**/ "ace/pre.h"
17 #include /**/ "ace/ACE_export.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "ace/Basic_Stats.h"
25 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 /// A simple class to make throughput and latency analysis.
30 * Keep the relevant information to perform throughput and latency
31 * analysis, including:
32 * -# Minimum, Average and Maximum latency
33 * -# Jitter for the latency
34 * -# Linear regression for throughput
35 * -# Accumulate results from several samples to obtain aggregated
36 * results, across several threads or experiments.
38 * @todo The idea behind this class was to use linear regression to
39 * determine if the throughput was linear or exhibited jitter.
40 * Unfortunately it never worked quite right, so only average
41 * throughput is computed.
43 class ACE_Export ACE_Throughput_Stats
: public ACE_Basic_Stats
47 ACE_Throughput_Stats (void);
50 void sample (ACE_UINT64 throughput
, ACE_UINT64 latency
);
52 /// Update the values to reflect the stats in @a throughput
53 void accumulate (const ACE_Throughput_Stats
&throughput
);
55 /// Print down the stats
56 void dump_results (const ACE_TCHAR
* msg
, scale_factor_type scale_factor
);
58 /// Dump the average throughput stats.
59 static void dump_throughput (const ACE_TCHAR
*msg
,
60 scale_factor_type scale_factor
,
61 ACE_UINT64 elapsed_time
,
62 ACE_UINT32 samples_count
);
64 /// The last throughput measurement.
65 ACE_UINT64 throughput_last_
;
68 ACE_END_VERSIONED_NAMESPACE_DECL
70 #include /**/ "ace/post.h"
72 #endif /* ! ACE_THROUGHPUT_STATS_H */