1
1

fixed bug in server side thoughput calculation

Этот коммит содержится в:
Brian Tierney 2009-11-20 22:20:10 +00:00
родитель 6146bde494
Коммит fda84f3feb
5 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -16,7 +16,7 @@ profile: iperf
$(CC) -pg -o iperf-profile $(OBJS)
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
./t_timer

Просмотреть файл

@ -258,9 +258,9 @@ Display(struct iperf_test * test)
while (n != NULL)
{
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
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;
}
@ -459,11 +459,12 @@ iperf_stats_callback(struct iperf_test * test)
gettimeofday(&sp->result->end_time, NULL);
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);
if (test->tcp_info)
get_tcpinfo(test, &temp);
//printf(" iperf_stats_callback: adding to interval list: \n");
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 */
//display_interval_list(rp, test->tcp_info);

Просмотреть файл

@ -88,7 +88,7 @@ Server specific:\n\
#ifdef NOT_YET_SUPPORTED /* still working on these */
-S, --tos N set IP 'Type of Service' bit \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\
#endif
@ -188,10 +188,10 @@ const char report_bw_header[] =
"[ ID] Interval Transfer Bandwidth\n";
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[] =
"[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[] =
"[ ID] Interval Transfer Bandwidth Jitter Lost/Total \

Просмотреть файл

@ -24,8 +24,7 @@ timeval_to_double(struct timeval * tv)
double
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

Просмотреть файл

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