[netperf-dev] netperf2 commit notice r187 - trunk/src
raj at netperf.org
raj at netperf.org
Mon Jan 28 08:49:04 PST 2008
Author: raj
Date: 2008-01-28 08:49:04 -0800 (Mon, 28 Jan 2008)
New Revision: 187
Modified:
trunk/src/netsh.c
trunk/src/nettest_omni.c
Log:
demo mode for omni
Modified: trunk/src/netsh.c
===================================================================
--- trunk/src/netsh.c 2008-01-27 01:45:57 UTC (rev 186)
+++ trunk/src/netsh.c 2008-01-28 16:49:04 UTC (rev 187)
@@ -1044,33 +1044,36 @@
/* what is our default value for the output units? if the test
name contains "RR" or "rr" or "Rr" or "rR" then the default is
- 'x' for transactions. otherwise it is 'm' for megabits
- (10^6) */
+ 'x' for transactions. otherwise it is 'm' for megabits (10^6)
+ however... if this is an "omni" test then we want to defer
+ this decision to scan_omni_args */
- if ('?' == libfmt) {
- /* we use a series of strstr's here because not everyone has
- strcasestr and I don't feel like up or downshifting text */
- if ((strstr(test_name,"RR")) ||
- (strstr(test_name,"rr")) ||
- (strstr(test_name,"Rr")) ||
- (strstr(test_name,"rR"))) {
- libfmt = 'x';
+ if (strcasecmp(test_name,"omni")) {
+ if ('?' == libfmt) {
+ /* we use a series of strstr's here because not everyone has
+ strcasestr and I don't feel like up or downshifting text */
+ if ((strstr(test_name,"RR")) ||
+ (strstr(test_name,"rr")) ||
+ (strstr(test_name,"Rr")) ||
+ (strstr(test_name,"rR"))) {
+ libfmt = 'x';
+ }
+ else {
+ libfmt = 'm';
+ }
}
- else {
- libfmt = 'm';
+ else if ('x' == libfmt) {
+ /* now, a format of 'x' makes no sense for anything other than
+ an RR test. if someone has been silly enough to try to set
+ that, we will reset it silently to default - namely 'm' */
+ if ((strstr(test_name,"RR") == NULL) &&
+ (strstr(test_name,"rr") == NULL) &&
+ (strstr(test_name,"Rr") == NULL) &&
+ (strstr(test_name,"rR") == NULL)) {
+ libfmt = 'm';
+ }
}
}
- else if ('x' == libfmt) {
- /* now, a format of 'x' makes no sense for anything other than
- an RR test. if someone has been silly enough to try to set
- that, we will reset it silently to default - namely 'm' */
- if ((strstr(test_name,"RR") == NULL) &&
- (strstr(test_name,"rr") == NULL) &&
- (strstr(test_name,"Rr") == NULL) &&
- (strstr(test_name,"rR") == NULL)) {
- libfmt = 'm';
- }
- }
}
Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c 2008-01-27 01:45:57 UTC (rev 186)
+++ trunk/src/nettest_omni.c 2008-01-28 16:49:04 UTC (rev 187)
@@ -2463,12 +2463,7 @@
/* the response from the remote should contain all the relevant
socket and other parameters we need to know for this test.
so, we can shove them back into the relevant variables here
- and be on our way. it would seem that this is as good a
- place as any to put the "while" loop for confidence intervals
- and have a send_request at the bottom that just tells the
- remote to do again, and have them sit waiting for that
- message, or control connection shutdown after each iteration.
- raj 2008-01-18 */
+ and be on our way. */
recv_response();
@@ -2504,10 +2499,10 @@
}
+#ifdef WANT_DEMO
/* at some point we will have to be more clever about this, but
for now we won't */
-#ifdef WANT_DEMO
DEMO_RR_SETUP(100);
#endif
@@ -2964,9 +2959,23 @@
/* to we need to pull something from omni_results here? */
bytes_xferd = bytes_sent + bytes_received;
- thruput = calc_thruput(bytes_xferd);
remote_bytes_xferd = omni_result->bytes_received +
omni_result->bytes_sent;
+
+ /* if the output format is 'x' we know the test was
+ request/response. if the libfmt is something else, it could be
+ xmit, recv or bidirectional. if we were the receiver then we
+ can use our byte totals even if it is
+ UDP/unreliable. otherwise, we use the remote totals - they
+ should be the same if the protocol is reliable, and if it is
+ unreliable then we want what was actually received */
+ if ('x' == libfmt)
+ /* it was a request/response test */
+ thruput = calc_thruput(trans_completed);
+ else if (NETPERF_RECV_ONLY(direction))
+ thruput = calc_thruput(bytes_xferd);
+ else
+ thruput = calc_thruput(remote_bytes_xferd);
/* ok, time to possibly calculate cpu util and/or service demand */
if (local_cpu_usage) {
@@ -3930,6 +3939,25 @@
#endif
#endif
+ /* ok, time to sanity check the output units */
+ if ('?' == libfmt) {
+ /* if this is a RR test then set it to 'x' for transactions */
+ if (NETPERF_IS_RR(direction)) {
+ libfmt = 'x';
+ }
+ else {
+ libfmt = 'm';
+ }
+ }
+ else if ('x' == libfmt) {
+ /* now, a format of 'x' makes no sense for anything other than
+ an RR test. if someone has been silly enough to try to set
+ that, we will reset it silently to default - namely 'm' */
+ if (!NETPERF_IS_RR(direction)) {
+ libfmt = 'm';
+ }
+ }
+
/* so, if there is to be no control connection, we want to have some
different settings for a few things */
More information about the netperf-dev
mailing list