Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement --forceflush for --json #923

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ikreb7
Copy link

@ikreb7 ikreb7 commented Oct 24, 2019

Hello,
I use iperf to test stuff and don't want wait too long until the json output returned. There are only few changes at the code. I use the forceflush-flag and print immediately the current json content. I look forward to your feedback.

PLEASE NOTE the following text from the iperf3 license. Submitting a
pull request to the iperf3 repository constitutes "[making]
Enhancements available...publicly":

You are under no obligation whatsoever to provide any bug fixes, patches, or
upgrades to the features, functionality or performance of the source code
("Enhancements") to anyone; however, if you choose to make your Enhancements
available either publicly, or directly to Lawrence Berkeley National
Laboratory, without imposing a separate written license agreement for such
Enhancements, then you hereby grant the following license: a non-exclusive,
royalty-free perpetual license to install, use, modify, prepare derivative
works, incorporate into other computer software, distribute, and sublicense
such enhancements or derivative works thereof, in binary and source code form.

The complete iperf3 license is available in the LICENSE file in the
top directory of the iperf3 source tree.

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

  • Brief description of code changes (suitable for use as a commit message):
    There are only few changes at the code. I use the forceflush-Flag and print immediately the current json content.

@hoax-killer
Copy link

hoax-killer commented Dec 13, 2019

@ikreb7
I was trying to test this feature. I tried to test using following command
iperf3 -s -J --forceflush 10 --logfile test.json

It prints the start and end summaries, but not the intermediate results.
Secondly, the results where not getting flushed into test.json every 10 seconds.
Could you please elaborate more on what this PR tries to accomplish.

print immediately the current json content.

More specifically, I am confused and not sure what you mean by print immediately.

@bmah888
Copy link
Contributor

bmah888 commented Dec 23, 2019

I'm trying to understand the value of this change. For better or for worse, iperf3 currently emits its output with the --json flag as a single JSON object at the end of the run. If we flush the output in the middle of the run (what your change does), the output won't be valid JSON. So any consumer of this output still won't be able to parse it until the end of the run anyway.

@rchromatic
Copy link

Hello,
I found this thread while I was looking for the same feature. I tested the patch but unfortunately these changes do not cover the server side. The server still prints "intervals" only at the end of the session.

@bmah888
I need the output from iperf3 during the speed test, to show it on UI. It allows users to see the progress and be sure that speed test is working. Right now I use non JSON output, but wanted to switch to JSON to make parsing more clean.

So any consumer of this output still won't be able to parse it until the end of the run anyway.

iperf3 should print valid JSON, which is done in this patch. It adds extra {} before printing "intervals".

@hoax-killer

I am confused and not sure what you mean by print immediately.

Iperf3 should print result once the data is available. It should not wait until the end of the speed test session.

@bmah888 bmah888 changed the title implement forceflush for json Implement --forceflush for --json Nov 9, 2020
swlars pushed a commit that referenced this pull request May 10, 2024
---------------------

* Notable user-visible changes

  * BREAKING CHANGE: iperf3's authentication features, when used with
    OpenSSL prior to 3.2.0, contain a vulnerability to a side-channel
    timing attack. To address this flaw, a change has been made to the
    padding applied to encrypted strings. This change is not backwards
    compatible with older versions of iperf3 (before 3.17). To restore
    the older (vulnerable) behavior, and hence
    backwards-compatibility, use the --use-pkcs1-padding flag. The
    iperf3 team thanks Hubert Kario from RedHat for reporting this
    issue and providing feedback on the fix. (CVE-2024-26306)(PR#1695)

  * iperf3 no longer changes its current working directory in --daemon
    mode. This results in more predictable behavior with relative
    paths, in particular finding key and credential files for
    authentication. (PR#1672)

  * A new --json-stream option has been added to enable a streaming
    output format, consisting of a series of JSON objects (for the
    start of the test, each measurement interval, and the end of the
    test) separated by newlines (#444, #923, #1098).

  * UDP tests now work correctly between different endian hosts
    (#1415).

  * The --fq-rate parameter now works for --reverse tests (#1632, PR#1667).

  * The statistics reporting interval is now available in the --json
    start test object (#1663).

  * A negative time test duration is now properly flagged as an error
    (IS#1662 / PR#1666).

* Notable developer-visible changes

  * Fixes have been made to better (unofficially) support builds on
    Android (#1641 / #1651) and VxWorks (#1595).

  * iperf3 now builds correctly on architectures without native
    support for 64-bit atomic types, by linking with the libatomic
    library (#1611).
swlars pushed a commit that referenced this pull request May 10, 2024
---------------------

* Notable user-visible changes

  * BREAKING CHANGE: iperf3's authentication features, when used with
    OpenSSL prior to 3.2.0, contain a vulnerability to a side-channel
    timing attack. To address this flaw, a change has been made to the
    padding applied to encrypted strings. This change is not backwards
    compatible with older versions of iperf3 (before 3.17). To restore
    the older (vulnerable) behavior, and hence
    backwards-compatibility, use the --use-pkcs1-padding flag. The
    iperf3 team thanks Hubert Kario from RedHat for reporting this
    issue and providing feedback on the fix. (CVE-2024-26306)(PR#1695)

  * iperf3 no longer changes its current working directory in --daemon
    mode. This results in more predictable behavior with relative
    paths, in particular finding key and credential files for
    authentication. (PR#1672)

  * A new --json-stream option has been added to enable a streaming
    output format, consisting of a series of JSON objects (for the
    start of the test, each measurement interval, and the end of the
    test) separated by newlines (#444, #923, #1098).

  * UDP tests now work correctly between different endian hosts
    (#1415).

  * The --fq-rate parameter now works for --reverse tests (#1632, PR#1667).

  * The statistics reporting interval is now available in the --json
    start test object (#1663).

  * A negative time test duration is now properly flagged as an error
    (IS#1662 / PR#1666).

* Notable developer-visible changes

  * Fixes have been made to better (unofficially) support builds on
    Android (#1641 / #1651) and VxWorks (#1595).

  * iperf3 now builds correctly on architectures without native
    support for 64-bit atomic types, by linking with the libatomic
    library (#1611).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants