Add Ability To Get Full JSON Result Object With Streams Enabled#1903
Add Ability To Get Full JSON Result Object With Streams Enabled#1903bmah888 merged 5 commits intoesnet:masterfrom
Conversation
|
Thanks for the PR! Does this new option preserve the existing behavior of |
|
@bmah888 it does preserve existing behavior to ensure this note stays true: |
|
This PR looks pretty reasonable and I'm planning on merging this soon. I'm trying to understand the interactions between
If If neither |
da87ef9 to
f655d42
Compare
|
@bmah888 your table is correct. I'm not sure that the varying combinations of these flags are as intuitive as they could be just by reading, but a few trial-and-error tests covers all the cases you've shown in the table here. If I was building this from scratch, I think I would have made |
|
Thanks @manedurphy, I think the functionality of the new flag you added is fine, and we should maybe have thought a little more about So I'm going to merge your patch as-is right now, and then I'm going to maybe make up a few sentences of documentation to add to the manpage to explain the interaction between the various JSON flags. Thanks! Historical note: At one point (2015-ish), we were considering trying to make JSON the only native output format, and then having a post-processor either pass that through or render that in a human-readable form. But I don't think we could have done that without some major changes to the original (Note for anyone reading this in 2025 or later, there is no plan to do this within the existing iperf3 code base, so please don't send in a PR unsolicited, even if you have a super-clever way to do this.) |
PLEASE NOTE the following text from the iperf3 license. Submitting a
pull request to the iperf3 repository constitutes "[making]
Enhancements available...publicly":
The complete iperf3 license is available in the
LICENSEfile in thetop directory of the iperf3 source tree.
Version of iperf3 (or development branch, such as
masteror3.1-STABLE) to which this pull request applies:masterIssues fixed (if any):
Brief description of code changes (suitable for use as a commit message):
iperf3command line user can leverage the--json-stream-full-outputflag in addition to the--json-streamto get both real-time events as well as the full JSON result at the end of a bandwidth measurement.libiperfuser can use theiperf_set_test_json_stream_full_outputAPI to ensure that a full JSON result object is available at the end of a bandwidth measurement. From the snippet below, the developer can expect that stream events will be printed as well as the full result at the end wheniperf_get_test_json_output_stringis called.