Skip to content

Commit

Permalink
Include summary structures in JSON even if there's only one stream.
Browse files Browse the repository at this point in the history
This makes consuming the JSON easier and more consistent.

Resolves esnet#151.

Submitted by:	@i2aaron
  • Loading branch information
bmah888 committed Mar 18, 2014
1 parent 3fa8072 commit 974c88e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,7 @@ iperf_print_intermediate(struct iperf_test *test)
}

/* next build string with sum of all streams */
if (test->num_streams > 1) {
if (test->num_streams > 1 || test->json_output) {
sp = SLIST_FIRST(&test->streams); /* reset back to 1st stream */
irp = TAILQ_LAST(&sp->result->interval_results, irlisthead); /* use 1st stream for timing info */

Expand Down Expand Up @@ -2080,7 +2080,7 @@ iperf_print_results(struct iperf_test *test)
}
}

if (test->num_streams > 1) {
if (test->num_streams > 1 || test->json_output) {
unit_snprintf(ubuf, UNIT_LEN, (double) total_sent, 'A');
bandwidth = (double) total_sent / (double) end_time;
unit_snprintf(nbuf, UNIT_LEN, bandwidth, test->settings->unit_format);
Expand Down

0 comments on commit 974c88e

Please sign in to comment.