Skip to content

Fix for issue #952 - different json object names for bidir reverse ch…#1200

Merged
bmah888 merged 1 commit intoesnet:masterfrom
davidBar-On:issue-952-bidir-json-output
Nov 8, 2021
Merged

Fix for issue #952 - different json object names for bidir reverse ch…#1200
bmah888 merged 1 commit intoesnet:masterfrom
davidBar-On:issue-952-bidir-json-output

Conversation

@davidBar-On
Copy link
Contributor

@davidBar-On davidBar-On commented Sep 4, 2021

  • Version of iperf3 (or development branch, such as master or
    3.1-STABLE) to which this pull request applies:
    Latest master code

  • Issues fixed (if any):
    iperf3 json output unparsable with bidir option set #952 (Yest another try to fix it.)

  • Brief description of code changes (suitable for use as a commit message):

When BIDIR is set, give a different JSON object name to the sum and sent/receive sums.
The different names are given to the data sent from the server, which is the "reverse" channel. This makes sure that the name reported on the server and client are compatible, and that the names are the same as with non-bdir, except for when reverse mode is used.

With this approach there is no change to JSON output for non-bidir tests. In addition, and programs that know to read the server and client JSON output for the non-bidir case should be able to work properly also when bidir is specified.

Programs changes are required only if they already analyse the "reverse" channel output for the bidir case, but since currently these JSON outputs has duplicate keys, probably there are very few cases where this is done.

@bmah888 bmah888 added the bug:json Bugs related to JSON output label Sep 20, 2021
@bmah888 bmah888 self-assigned this Oct 15, 2021
if ((test->role == 'c' && !stream_must_be_sender) ||
(test->role != 'c' && stream_must_be_sender))
{
sum_name = "sum_bdir_reverse";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to change this to sum_bidir_reverse instead in order to match the spelling of the --bidir option?

Comment on lines +3701 to +3703
sum_name = "sum_bdir_reverse";
sum_sent_name = "sum_sent_bdir_reverse";
sum_received_name = "sum_received_bdir_reverse";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly to a comment above, could the new names be sum_bidir_reverse, sum_sent_bidir_reverse, and sum_received_bidir_reverse in order to match the spelling of the --bidir command-line option?

@bmah888
Copy link
Contributor

bmah888 commented Oct 21, 2021

Thanks for the PR! I'd like to merge this after a few changes to the new names for the JSON structures.

@bmah888
Copy link
Contributor

bmah888 commented Nov 8, 2021

I'm going to merge this as-is, and then do a follow-up commit to change the identifiers per comments above. Thanks!

@bmah888 bmah888 merged commit f39fa9c into esnet:master Nov 8, 2021
bmah888 added a commit that referenced this pull request Nov 8, 2021
Follow-up to #1200: s/bdir/bidir/ in JSON identifiers per review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug:json Bugs related to JSON output

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iperf3 json output unparsable with bidir option set

2 participants