[netperf-dev] netperf2 commit notice r184 - trunk/src
raj at netperf.org
raj at netperf.org
Fri Jan 25 17:13:03 PST 2008
Author: raj
Date: 2008-01-25 17:13:02 -0800 (Fri, 25 Jan 2008)
New Revision: 184
Modified:
trunk/src/nettest_omni.c
Log:
initial enable of WANT_HISTOGRAM in omni
Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c 2008-01-26 00:04:10 UTC (rev 183)
+++ trunk/src/nettest_omni.c 2008-01-26 01:13:02 UTC (rev 184)
@@ -113,6 +113,24 @@
#include "hist.h"
#endif /* WANT_HISTOGRAM */
+#ifdef WANT_HISTOGRAM
+#ifdef HAVE_GETHRTIME
+static hrtime_t time_one;
+static hrtime_t time_two;
+#elif HAVE_GET_HRT
+#include "hrt.h"
+static hrt_t time_one;
+static hrt_t time_two;
+#elif defined(WIN32)
+static LARGE_INTEGER time_one;
+static LARGE_INTEGER time_two;
+#else
+static struct timeval time_one;
+static struct timeval time_two;
+#endif /* HAVE_GETHRTIME */
+static HIST time_hist;
+#endif /* WANT_HISTOGRAM */
+
#define NETPERF_WAITALL 0x1
#define NETPERF_XMIT 0x2
#define NETPERF_RECV 0x4
@@ -148,6 +166,7 @@
int bytes_to_recv;
int bytes_per_recv;
int null_message_ok = 0;
+int csv = 0;
uint64_t trans_completed;
uint64_t units_remaining;
uint64_t bytes_sent;
@@ -1755,6 +1774,11 @@
if (debug > 2)
dump_netperf_output_source(where);
+ if (csv)
+ print_omni_csv();
+ else
+ print_omni_human();
+
}
/* for the next few routines (connect, accept, send, recv,
disconnect/close) we will use a return of -1 to mean times up, -2
@@ -2828,20 +2852,30 @@
&remote_service_demand);
print_omni();
- print_omni_human();
- print_omni_csv();
- fprintf(where,
- "Confidence was %g after %d iterations\n",
- confidence,
- --confidence_iteration);
- fflush(where);
-
/* likely as not we are going to do something slightly different here */
if (verbosity > 1) {
#ifdef WANT_HISTOGRAM
- fprintf(where,"\nHistogram of request/response times\n");
+ fprintf(where,"\nHistogram of ");
+ if (NETPERF_RECV_ONLY(direction))
+ fprintf(where,"recv");
+ if (NETPERF_XMIT_ONLY(direction))
+ fprintf(where,"send");
+ if (NETPERF_IS_RR(direction)) {
+ if (connection_test) {
+ if (NETPERF_CC(direction)) {
+ fprintf(where,"connect/close");
+ }
+ else {
+ fprintf(where,"connect/request/response/close");
+ }
+ }
+ else {
+ fprintf(where,"request/response");
+ }
+ }
+ fprintf(where," times\n");
fflush(where);
HIST_report(time_hist);
#endif /* WANT_HISTOGRAM */
@@ -3437,7 +3471,7 @@
{
-#define OMNI_ARGS "b:cCd:DnNhH:L:m:M:p:P:r:s:S:t:T:Vw:W:46"
+#define OMNI_ARGS "b:cCd:DnNhH:L:m:M:oOp:P:r:s:S:t:T:Vw:W:46"
extern char *optarg; /* pointer to option string */
@@ -3594,6 +3628,12 @@
/* set the remote socket type */
remote_connected = 1;
break;
+ case 'o':
+ csv = 1;
+ break;
+ case 'O':
+ csv = 0;
+ break;
case 'p':
/* set the min and max port numbers for the TCP_CRR and TCP_TRR */
/* tests. */
More information about the netperf-dev
mailing list