fixed bug in server side thoughput calculation

This commit is contained in:
Brian Tierney 2009-11-20 22:20:10 +00:00
parent 6146bde494
commit fda84f3feb
5 changed files with 10 additions and 10 deletions

View File

@ -16,7 +16,7 @@ profile: iperf
$(CC) -pg -o iperf-profile $(OBJS) $(CC) -pg -o iperf-profile $(OBJS)
dist: dist:
tar cvfz iperf3.0-alpha.tar.gz *.c *.h *.txt Makefile AUTHORS tar cvfz iperf3.0a2.tar.gz *.c *.h *.txt Makefile AUTHORS
test: t_timer t_units t_uuid test: t_timer t_units t_uuid
./t_timer ./t_timer

View File

@ -258,9 +258,9 @@ Display(struct iperf_test * test)
while (n != NULL) while (n != NULL)
{ {
if (test->role == 'c') if (test->role == 'c')
printf("position-%d\tsp=%d\tsocket=%d\tMbytes sent=%u\n", count++, (int) n, n->socket, (uint) (n->result->bytes_sent / MB)); printf("position-%d\tsp=%d\tsocket=%d\tMbytes sent=%u\n", count++, (int) n, n->socket, (uint) (n->result->bytes_sent / (float)MB));
else else
printf("position-%d\tsp=%d\tsocket=%d\tMbytes received=%u\n", count++, (int) n, n->socket, (uint) (n->result->bytes_received / MB)); printf("position-%d\tsp=%d\tsocket=%d\tMbytes received=%u\n", count++, (int) n, n->socket, (uint) (n->result->bytes_received / (float)MB));
n = n->next; n = n->next;
} }
@ -459,11 +459,12 @@ iperf_stats_callback(struct iperf_test * test)
gettimeofday(&sp->result->end_time, NULL); gettimeofday(&sp->result->end_time, NULL);
memcpy(&temp.interval_end_time, &sp->result->end_time, sizeof(struct timeval)); memcpy(&temp.interval_end_time, &sp->result->end_time, sizeof(struct timeval));
temp.interval_duration = timeval_diff(&temp.interval_start_time, &temp.interval_end_time); temp.interval_duration = timeval_diff(&temp.interval_start_time, &temp.interval_end_time);
//temp.interval_duration = timeval_diff(&temp.interval_start_time, &temp.interval_end_time);
if (test->tcp_info) if (test->tcp_info)
get_tcpinfo(test, &temp); get_tcpinfo(test, &temp);
//printf(" iperf_stats_callback: adding to interval list: \n"); //printf(" iperf_stats_callback: adding to interval list: \n");
add_to_interval_list(rp, &temp); add_to_interval_list(rp, &temp);
rp->bytes_sent_this_interval = rp->bytes_sent_this_interval = 0; rp->bytes_sent_this_interval = rp->bytes_received_this_interval = 0;
/* for debugging */ /* for debugging */
//display_interval_list(rp, test->tcp_info); //display_interval_list(rp, test->tcp_info);

View File

@ -88,7 +88,7 @@ Server specific:\n\
#ifdef NOT_YET_SUPPORTED /* still working on these */ #ifdef NOT_YET_SUPPORTED /* still working on these */
-S, --tos N set IP 'Type of Service' bit \n\ -S, --tos N set IP 'Type of Service' bit \n\
-Z, --linux-congestion <algo> set TCP congestion control algorithm (Linux only)\n\ -Z, --linux-congestion <algo> set TCP congestion control algorithm (Linux only)\n\
-D, --daemon run the server as a daemon\n" -D, --daemon run the server as a daemon\n\n
-6, --IPv6Version Set the domain to IPv6\n\ -6, --IPv6Version Set the domain to IPv6\n\
#endif #endif
@ -188,10 +188,10 @@ const char report_bw_header[] =
"[ ID] Interval Transfer Bandwidth\n"; "[ ID] Interval Transfer Bandwidth\n";
const char report_bw_format[] = const char report_bw_format[] =
"[%3d] %4.1f-%4.1f sec %ss %ss/sec\n"; "[%3d] %4.2f-%4.2f sec %ss %ss/sec\n";
const char report_sum_bw_format[] = const char report_sum_bw_format[] =
"[SUM] %4.1f-%4.1f sec %ss %ss/sec\n"; "[SUM] %4.2f-%4.2f sec %ss %ss/sec\n";
const char report_bw_jitter_loss_header[] = const char report_bw_jitter_loss_header[] =
"[ ID] Interval Transfer Bandwidth Jitter Lost/Total \ "[ ID] Interval Transfer Bandwidth Jitter Lost/Total \

View File

@ -24,8 +24,7 @@ timeval_to_double(struct timeval * tv)
double double
timeval_diff(struct timeval * tv0, struct timeval * tv1) timeval_diff(struct timeval * tv0, struct timeval * tv1)
{ {
//return timeval_to_double(tv1) - timeval_to_double(tv0); return ((tv1->tv_sec - tv0->tv_sec) + (abs(tv1->tv_usec - tv0->tv_usec) / 1000000.0));
return (tv1->tv_sec - tv0->tv_sec) + abs(tv1->tv_usec - tv0->tv_usec) / 1000000.0;
} }
int int

View File

@ -1,2 +1,2 @@
#define IPERF_VERSION "3.0-ALPHA" #define IPERF_VERSION "3.0-ALPHA"
#define IPERF_VERSION_DATE "10 Nov 2009" #define IPERF_VERSION_DATE "18 Nov 2009"