Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r1141 committed - fixed problem with C2S test

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r1141 committed - fixed problem with C2S test


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r1141 committed - fixed problem with C2S test
  • Date: Thu, 06 Nov 2014 09:43:05 +0000

Revision: 1141
Author:

Date: Thu Nov 6 09:42:49 2014 UTC
Log: fixed problem with C2S test
https://code.google.com/p/ndt/source/detail?r=1141

Modified:
/branches/MultiplePorts/src/test_c2s_clt.c
/branches/MultiplePorts/src/test_c2s_srv.c
/branches/MultiplePorts/src/test_s2c_clt.c
/branches/MultiplePorts/src/test_s2c_srv.c
/branches/MultiplePorts/src/usage.c
/branches/MultiplePorts/src/web100clt.c

=======================================
--- /branches/MultiplePorts/src/test_c2s_clt.c Wed Nov 5 13:15:12 2014 UTC
+++ /branches/MultiplePorts/src/test_c2s_clt.c Thu Nov 6 09:42:49 2014 UTC
@@ -71,7 +71,6 @@
int i, k; // temporary iterator
C2SWriteWorkerArgs writeWorkerArgs[7]; // write workers parameters
pthread_t writeWorkerIds[7]; // write workers ids
- int outSocket; // socket descriptor for the outgoing connection
double t, stop_time; // test-time indicators
double testDuration = 10; // default test duration
char* strtokptr; // pointer used by the strtok method
@@ -270,11 +269,28 @@
if (json_check_msg(buff) == 0) {
jsonMsgValue = json_read_map_value(buff, DEFAULT_KEY);
c2sspd = atoi(jsonMsgValue);
+#ifdef EXTTESTS_ENABLED
+ if (throughputsnaps != NULL) {
+ char* strtokptr = strtok(jsonMsgValue, " ");
+ while ((strtokptr = strtok(NULL, " ")) != NULL) {
+ if (lastThroughputSnapshot != NULL) {
+ lastThroughputSnapshot->next = (struct throughputSnapshot*) malloc(sizeof(struct throughputSnapshot));
+ lastThroughputSnapshot = lastThroughputSnapshot->next;
+ }
+ else {
+ uThroughputSnapshots = lastThroughputSnapshot = (struct throughputSnapshot*) malloc(sizeof(struct throughputSnapshot));
+ }
+ lastThroughputSnapshot->next = NULL;
+ lastThroughputSnapshot->time = atof(strtokptr);
+ strtokptr = strtok(NULL, " ");
+ lastThroughputSnapshot->throughput = atof(strtokptr);
+ }
+ }
+#endif
free(jsonMsgValue);
}
else {
c2sspd = atoi(buff);
- }
#ifdef EXTTESTS_ENABLED
if (throughputsnaps != NULL) {
char* strtokptr = strtok(buff, " ");
@@ -293,6 +309,7 @@
}
}
#endif
+ }

// Print results in the most convenient units (kbps or Mbps)
if (c2sspd < KILO)
=======================================
--- /branches/MultiplePorts/src/test_c2s_srv.c Wed Nov 5 13:15:12 2014 UTC
+++ /branches/MultiplePorts/src/test_c2s_srv.c Thu Nov 6 09:42:49 2014 UTC
@@ -247,7 +247,7 @@
// log protocol validation indicating client accept
procstatusenum = PROCESS_STARTED;
proctypeenum = CONNECT_TYPE;
- protolog_procstatus(testOptions->child0, testids, proctypeenum, procstatusenum, recvsfd[i]);
+ protolog_procstatus(testOptions->child0, testids, proctypeenum, procstatusenum, recvsfd[0]);
break;
}
// socket interrupted, wait some more
@@ -275,13 +275,13 @@
}

// Get address associated with the throughput test. Used for packet tracing
- log_println(6, "child %d - c2s ready for test with fd=%d", testOptions->child0, recvsfd[i]);
+ log_println(6, "child %d - c2s ready for test with fd=%d", testOptions->child0, recvsfd[0]);

// commenting out below to move to init_pkttrace function
- I2Addr src_addr = I2AddrByLocalSockFD(get_errhandle(), recvsfd[i], 0);
+ I2Addr src_addr = I2AddrByLocalSockFD(get_errhandle(), recvsfd[0], 0);

// Get tcp_stat connection. Used to collect tcp_stat variable statistics
- conn = tcp_stat_connection_from_socket(agent, recvsfd[i]);
+ conn = tcp_stat_connection_from_socket(agent, recvsfd[0]);

// set up packet tracing. Collected data is used for bottleneck link
// calculations
@@ -300,7 +300,7 @@
log_println(2, "C2S test calling init_pkttrace() with pd=%p",
&cli_addr[0]);
init_pkttrace(src_addr, (struct sockaddr *) &cli_addr[0], clilen,
- mon_pipe, device, &pair, "c2s", options->compress);
+ mon_pipe, device, &pair, "c2s", options->uduration / 1000.0);
log_println(1, "c2s is exiting gracefully");
/* Close the pipe */
close(mon_pipe[0]);
@@ -445,7 +445,7 @@
// get receiver side Web100 stats and write them to the log file. close
// sockets
if (record_reverse == 1)
- tcp_stat_get_data_recv(recvsfd[i], agent, conn, count_vars);
+ tcp_stat_get_data_recv(recvsfd[0], agent, conn, count_vars);


for (i = 0; i < threadsNum; i++) {
=======================================
--- /branches/MultiplePorts/src/test_s2c_clt.c Wed Nov 5 10:25:27 2014 UTC
+++ /branches/MultiplePorts/src/test_s2c_clt.c Thu Nov 6 09:42:49 2014 UTC
@@ -192,6 +192,7 @@

// Set socket timeout to testDuration seconds
bytes = 0;
+ testStartTime = secs();
t = testStartTime + testDuration + 5;
#ifdef EXTTESTS_ENABLED
throughputSnapshotTime = testStartTime + (snapsoffset / 1000.0);
=======================================
--- /branches/MultiplePorts/src/test_s2c_srv.c Wed Nov 5 10:25:27 2014 UTC
+++ /branches/MultiplePorts/src/test_s2c_srv.c Thu Nov 6 09:42:49 2014 UTC
@@ -381,7 +381,7 @@
/* End of test code */

// create directory to write web100 snaplog trace
- create_client_logdir((struct sockaddr *) &cli_addr, clilen,
+ create_client_logdir((struct sockaddr *) &cli_addr[0], clilen,
options->s2c_logname, sizeof(options->s2c_logname),
snaplogsuffix, sizeof(snaplogsuffix));

=======================================
--- /branches/MultiplePorts/src/usage.c Wed Nov 5 10:25:27 2014 UTC
+++ /branches/MultiplePorts/src/usage.c Thu Nov 6 09:42:49 2014 UTC
@@ -69,7 +69,7 @@
printf(" -L, --log_dir DIR - specify the base directory for snaplog and tcpdump files\n");
printf(" (default %s/serverdata)\n", BASEDIR);
printf(" -S, --logfacility #F - specify syslog facility name\n");
- printf(" Note: this doesn't enable 'syslog'\n\n");
+ printf(" Note: this doesn't enable 'syslog'\n");
printf(" --savewebvalues - enable web values writing to a separate file\n\n");
#ifdef EXPERIMENTAL_ENABLED
printf(" Experimental code:\n\n");
=======================================
--- /branches/MultiplePorts/src/web100clt.c Wed Nov 5 10:25:27 2014 UTC
+++ /branches/MultiplePorts/src/web100clt.c Thu Nov 6 09:42:49 2014 UTC
@@ -973,7 +973,7 @@
}
break;
default:
- log_println(0, "Unknown test ID");
+ log_println(0, "Unknown test ID: %d", testId);
exit(5);
}
ptr = strtok_r(NULL, " ", &strtokbuf);


  • [ndt-dev] [ndt] r1141 committed - fixed problem with C2S test, ndt, 11/06/2014

Archive powered by MHonArc 2.6.16.

Top of Page