Re-jiggered the "Interval Transfer Bandwidth" header so it only

appears at the start and end of the results, and added a separator
line when there are both multiple streams and multiple intervals.
This commit is contained in:
jef 2012-10-29 22:30:31 -07:00
parent 7b43a90638
commit 99502d9409
3 changed files with 14 additions and 1 deletions

View File

@ -1443,8 +1443,17 @@ print_interval_results(struct iperf_test * test, struct iperf_stream * sp)
printf("print_interval_results Error: interval_results = NULL \n");
return;
}
/* First stream? */
if (sp == SLIST_FIRST(&test->streams)) {
printf(report_bw_header);
/* It it's the first interval, print the header;
** else if there's more than one stream, print the separator;
** else nothing.
*/
if (sp->result->start_time.tv_sec == ir->interval_start_time.tv_sec &&
sp->result->start_time.tv_usec == ir->interval_start_time.tv_usec)
printf(report_bw_header);
else if (test->num_streams > 1)
printf(report_bw_separator);
}
unit_snprintf(ubuf, UNIT_LEN, (double) (ir->bytes_transferred), 'A');

View File

@ -186,6 +186,9 @@ const char report_read_length_times[] =
const char report_bw_header[] =
"[ ID] Interval Transfer Bandwidth\n";
const char report_bw_separator[] =
"- - - - - - - - - - - - - - - - - - - - - - - - -\n";
const char report_bw_format[] =
"[%3d] %4.2f-%4.2f sec %ss %ss/sec\n";

View File

@ -34,6 +34,7 @@ extern char test_start_bytes[];
extern char report_read_lengths[] ;
extern char report_read_length_times[] ;
extern char report_bw_header[] ;
extern char report_bw_separator[] ;
extern char report_bw_format[] ;
extern char report_sum_bw_format[] ;
extern char report_bw_jitter_loss_header[] ;