summaryrefslogtreecommitdiff
path: root/performance-tests
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-10-27 22:36:12 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-10-27 22:36:12 +0000
commit47ee19dbedf1a2da5d093a1fcddd2c4ee0f1c8a6 (patch)
tree2b76ce3e3dd87fba4c4c9d931462aef30063e0bb /performance-tests
parent502ef273302e801b519917887856a47163c223d0 (diff)
downloadATCD-47ee19dbedf1a2da5d093a1fcddd2c4ee0f1c8a6.tar.gz
ChangeLogTag:Fri Oct 27 15:02:56 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'performance-tests')
-rw-r--r--performance-tests/TCP/Makefile12
-rw-r--r--performance-tests/TCP/tcp_test.cpp30
2 files changed, 32 insertions, 10 deletions
diff --git a/performance-tests/TCP/Makefile b/performance-tests/TCP/Makefile
index 5dc8f1bb317..3f8f3ccfec3 100644
--- a/performance-tests/TCP/Makefile
+++ b/performance-tests/TCP/Makefile
@@ -40,7 +40,7 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-.obj/tcp_test.o .obj/tcp_test.so .shobj/tcp_test.o .shobj/tcp_test.so: tcp_test.cpp \
+.obj/tcp_test.o .obj/tcp_test.o .obj/tcp_test.o .obj/tcp_test.o: tcp_test.cpp \
$(ACE_ROOT)/ace/Reactor.h \
$(ACE_ROOT)/ace/pre.h \
$(ACE_ROOT)/ace/Handle_Set.h \
@@ -170,8 +170,6 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
$(ACE_ROOT)/ace/Get_Opt.i \
$(ACE_ROOT)/ace/High_Res_Timer.h \
$(ACE_ROOT)/ace/High_Res_Timer.i \
- $(ACE_ROOT)/ace/Stats.h \
- $(ACE_ROOT)/ace/Stats.i \
$(ACE_ROOT)/ace/Thread_Manager.h \
$(ACE_ROOT)/ace/Singleton.h \
$(ACE_ROOT)/ace/Singleton.i \
@@ -183,6 +181,12 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
$(ACE_ROOT)/ace/Managed_Object.cpp \
$(ACE_ROOT)/ace/Thread_Manager.i \
$(ACE_ROOT)/ace/Sched_Params.h \
- $(ACE_ROOT)/ace/Sched_Params.i
+ $(ACE_ROOT)/ace/Sched_Params.i \
+ $(ACE_ROOT)/ace/Stats.h \
+ $(ACE_ROOT)/ace/Basic_Stats.h \
+ $(ACE_ROOT)/ace/Basic_Stats.inl \
+ $(ACE_ROOT)/ace/Stats.i \
+ $(ACE_ROOT)/ace/Sample_History.h \
+ $(ACE_ROOT)/ace/Sample_History.inl
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/performance-tests/TCP/tcp_test.cpp b/performance-tests/TCP/tcp_test.cpp
index 03c1bb012f0..589f6a6adba 100644
--- a/performance-tests/TCP/tcp_test.cpp
+++ b/performance-tests/TCP/tcp_test.cpp
@@ -27,9 +27,10 @@
#include "ace/ACE.h"
#include "ace/Get_Opt.h"
#include "ace/High_Res_Timer.h"
-#include "ace/Stats.h"
#include "ace/Thread_Manager.h"
#include "ace/Sched_Params.h"
+#include "ace/Stats.h"
+#include "ace/Sample_History.h"
// FUZZ: disable check_for_math_include
#include <math.h>
@@ -50,6 +51,7 @@ static char rbuf[MAXPKTSZ];
static int usdelay = DEFINTERVAL;
static int bufsz = DEFPKTSZ;
static int VERBOSE = 0;
+static int dump_history = 0;
static int svr_thrno = DEFAULT_THRNO;
static int server = 0;
static int client = 0;
@@ -71,6 +73,7 @@ usage (void)
ACE_ERROR ((LM_ERROR,
"tcp_test\n"
" [-v] (Verbose)\n"
+ " [-h] (dump all the samples)\n"
" [-m message size]\n"
" [-i iterations]\n"
" [-I usdelay]\n"
@@ -210,7 +213,7 @@ Client::run (void)
ACE_ERROR_RETURN ((LM_ERROR, "(%P) %p\n", "get_response"), -1);
}
- ACE_Throughput_Stats throughput;
+ ACE_Sample_History history (nsamples);
ACE_hrtime_t test_start = ACE_OS::gethrtime ();
for (int i = 0; i != nsamples; ++i)
@@ -231,8 +234,7 @@ Client::run (void)
ACE_hrtime_t end = ACE_OS::gethrtime ();
- throughput.sample (end - test_start,
- end - start);
+ history.sample (end - start);
if (VERBOSE && i % 500 == 0)
{
@@ -240,10 +242,22 @@ Client::run (void)
"Send %d / %d events\n", i, nsamples));
}
}
+ ACE_hrtime_t test_end = ACE_OS::gethrtime ();
ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
- throughput.dump_results ("Client", gsf);
+ if (dump_history)
+ {
+ history.dump_samples ("HISTORY", gsf);
+ }
+
+ ACE_Basic_Stats latency;
+ history.collect_basic_stats (latency);
+ latency.dump_results ("Client", gsf);
+ ACE_Throughput_Stats::dump_throughput ("Client", gsf,
+ test_end - test_start,
+ latency.samples_count ());
+
return 0;
}
@@ -506,7 +520,7 @@ main (int argc, char *argv[])
}
- ACE_Get_Opt getopt (argc, argv, "xwf:vb:I:p:sci:m:at:");
+ ACE_Get_Opt getopt (argc, argv, "hxwf:vb:I:p:sci:m:at:");
while ((c = getopt ()) != -1)
{
@@ -516,6 +530,10 @@ main (int argc, char *argv[])
VERBOSE = 1;
break;
+ case 'h':
+ dump_history = 1;
+ break;
+
case 'm':
bufsz = ACE_OS::atoi (getopt.optarg);