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

Invalid JSON Output For Measurements With Parallel Streams #1491

Closed
manedurphy opened this issue Mar 25, 2023 · 1 comment · Fixed by #1492
Closed

Invalid JSON Output For Measurements With Parallel Streams #1491

manedurphy opened this issue Mar 25, 2023 · 1 comment · Fixed by #1492

Comments

@manedurphy
Copy link
Contributor

NOTE: The iperf3 issue tracker is for registering bugs, enhancement
requests, or submissions of code. It is not a means for asking
questions about building or using iperf3. Those are best directed
towards the Discussions section for this project at
https://github.com/esnet/iperf/discussions
or to the iperf3 mailing list at iperf-dev@googlegroups.com.
A list of frequently-asked questions
regarding iperf3 can be found at http://software.es.net/iperf/faq.html.

Context

  • Version of iperf3: 3.12

  • Hardware:

  • Operating system (and distribution, if any):

# Command
uname --all

# Output
Linux archbox-nexus 6.2.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 13 Mar 2023 17:02:08 +0000 x86_64 GNU/Linux

Please note: iperf3 is supported on Linux, FreeBSD, and macOS.
Support may be provided on a best-effort basis to other UNIX-like
platforms. We cannot provide support for building and/or running
iperf3 on Windows, iOS, or Android.

  • Other relevant information (for example, non-default compilers,
    libraries, cross-compiling, etc.):

Please fill out one of the "Bug Report" or "Enhancement Request"
sections, as appropriate. Note that submissions of bug fixes, new
features, etc. should be done as a pull request at
https://github.com/esnet/iperf/pulls

Bug Report

  • Expected Behavior

The JSON output should not duplicate fields when a measurement is run with multiple streams.

  • Actual Behavior

The JSON output should duplicates fields when a measurement is run with multiple streams.

  • Steps to Reproduce

Run a measurement with a --parallel value greater than 1 and the --json flag.

  • Possible Solution

Unsure at this time, will need to read some code to see what's up.

Example

You will notice in the output that there are several duplicate fields:

  1. sock_bufsize
  2. sndbuf_actual
  3. rcvbuf_actual

The issue is that I am unable to parse this JSON data into my own data structure when these fields are duplicated. What would be the fix here? Given that the values for each repeated field are the same, I'd guess that the fix is to simply remove the logic that is populating the result multiple times, but please correct me if I am wrong.

Command
iperf3 -c 127.0.0.1 --port 5201 --version4 --omit 1 --time 2 --parallel 3 --reverse --json
Output
{
        "start":        {
                "connected":    [{
                                "socket":       5,
                                "local_host":   "127.0.0.1",
                                "local_port":   51778,
                                "remote_host":  "127.0.0.1",
                                "remote_port":  5201
                        }, {
                                "socket":       7,
                                "local_host":   "127.0.0.1",
                                "local_port":   51786,
                                "remote_host":  "127.0.0.1",
                                "remote_port":  5201
                        }, {
                                "socket":       9,
                                "local_host":   "127.0.0.1",
                                "local_port":   51790,
                                "remote_host":  "127.0.0.1",
                                "remote_port":  5201
                        }],
                "version":      "iperf 3.12",
                "system_info":  "Linux archbox-nexus 6.2.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 13 Mar 2023 17:02:08 +0000 x86_64",
                "timestamp":    {
                        "time": "Sat, 25 Mar 2023 00:54:31 GMT",
                        "timesecs":     1679705671
                },
                "connecting_to":        {
                        "host": "127.0.0.1",
                        "port": 5201
                },
                "cookie":       "kusywcixkimiog5xjcobpyugrafofxddcd5u",
                "tcp_mss_default":      32768,
                "target_bitrate":       0,
                "sock_bufsize": 0,
                "sndbuf_actual":        16384,
                "rcvbuf_actual":        131072,
                "sock_bufsize": 0,
                "sndbuf_actual":        16384,
                "rcvbuf_actual":        131072,
                "sock_bufsize": 0,
                "sndbuf_actual":        16384,
                "rcvbuf_actual":        131072,
                "test_start":   {
                        "protocol":     "TCP",
                        "num_streams":  3,
                        "blksize":      131072,
                        "omit": 1,
                        "duration":     2,
                        "bytes":        0,
                        "blocks":       0,
                        "reverse":      1,
                        "tos":  0,
                        "target_bitrate":       0
                }
        },
        "intervals":    [{
                        "streams":      [{
                                        "socket":       5,
                                        "start":        0,
                                        "end":  1.000057,
                                        "seconds":      1.0000569820404053,
                                        "bytes":        1520041984,
                                        "bits_per_second":      12159642990.731789,
                                        "omitted":      true,
                                        "sender":       false
                                }, {
                                        "socket":       7,
                                        "start":        0,
                                        "end":  1.000063,
                                        "seconds":      1.0000629425048828,
                                        "bytes":        1517420544,
                                        "bits_per_second":      12138600318.090208,
                                        "omitted":      true,
                                        "sender":       false
                                }, {
                                        "socket":       9,
                                        "start":        0,
                                        "end":  1.000064,
                                        "seconds":      1.0000640153884888,
                                        "bytes":        1515978752,
                                        "bits_per_second":      12127053697.9463,
                                        "omitted":      true,
                                        "sender":       false
                                }],
                        "sum":  {
                                "start":        0,
                                "end":  1.000057,
                                "seconds":      1.0000569820404053,
                                "bytes":        4553441280,
                                "bits_per_second":      36425454643.271736,
                                "omitted":      true,
                                "sender":       false
                        }
                }, {
                        "streams":      [{
                                        "socket":       5,
                                        "start":        3.5e-05,
                                        "end":  0.999977,
                                        "seconds":      1.0000120401382446,
                                        "bytes":        1455816704,
                                        "bits_per_second":      11646393407.813318,
                                        "omitted":      false,
                                        "sender":       false
                                }, {
                                        "socket":       7,
                                        "start":        2.9e-05,
                                        "end":  0.999982,
                                        "seconds":      1.0000109672546387,
                                        "bytes":        1453195264,
                                        "bits_per_second":      11625434612.898315,
                                        "omitted":      false,
                                        "sender":       false
                                }, {
                                        "socket":       9,
                                        "start":        2.8e-05,
                                        "end":  0.999983,
                                        "seconds":      1.0000109672546387,
                                        "bytes":        1453195264,
                                        "bits_per_second":      11625434612.898315,
                                        "omitted":      false,
                                        "sender":       false
                                }],
                        "sum":  {
                                "start":        3.5e-05,
                                "end":  0.999977,
                                "seconds":      1.0000120401382446,
                                "bytes":        4362207232,
                                "bits_per_second":      34897237688.433876,
                                "omitted":      false,
                                "sender":       false
                        }
                }, {
                        "streams":      [{
                                        "socket":       5,
                                        "start":        0.999977,
                                        "end":  1.99994,
                                        "seconds":      0.99996298551559448,
                                        "bytes":        1409417216,
                                        "bits_per_second":      11275755094.261097,
                                        "omitted":      false,
                                        "sender":       false
                                }, {
                                        "socket":       7,
                                        "start":        0.999982,
                                        "end":  1.999945,
                                        "seconds":      0.99996298551559448,
                                        "bytes":        1409286144,
                                        "bits_per_second":      11274706479.447161,
                                        "omitted":      false,
                                        "sender":       false
                                }, {
                                        "socket":       9,
                                        "start":        0.999983,
                                        "end":  1.999947,
                                        "seconds":      0.99996399879455566,
                                        "bytes":        1409417216,
                                        "bits_per_second":      11275743668.364342,
                                        "omitted":      false,
                                        "sender":       false
                                }],
                        "sum":  {
                                "start":        0.999977,
                                "end":  1.99994,
                                "seconds":      0.99996298551559448,
                                "bytes":        4228120576,
                                "bits_per_second":      33826216667.969353,
                                "omitted":      false,
                                "sender":       false
                        }
                }],
        "end":  {
                "streams":      [{
                                "sender":       {
                                        "socket":       5,
                                        "start":        0,
                                        "end":  1.998564,
                                        "seconds":      1.998564,
                                        "bytes":        2862612480,
                                        "bits_per_second":      11458677250.26569,
                                        "retransmits":  0,
                                        "max_snd_cwnd": 0,
                                        "max_snd_wnd":  0,
                                        "max_rtt":      0,
                                        "min_rtt":      0,
                                        "mean_rtt":     0,
                                        "sender":       false
                                },
                                "receiver":     {
                                        "socket":       5,
                                        "start":        0,
                                        "end":  1.99994,
                                        "seconds":      1.99994,
                                        "bytes":        2865233920,
                                        "bits_per_second":      11461279518.385551,
                                        "sender":       false
                                }
                        }, {
                                "sender":       {
                                        "socket":       7,
                                        "start":        0,
                                        "end":  1.998564,
                                        "seconds":      1.998564,
                                        "bytes":        2859991040,
                                        "bits_per_second":      11448183956.080465,
                                        "retransmits":  0,
                                        "max_snd_cwnd": 0,
                                        "max_snd_wnd":  0,
                                        "max_rtt":      0,
                                        "min_rtt":      0,
                                        "mean_rtt":     0,
                                        "sender":       false
                                },
                                "receiver":     {
                                        "socket":       7,
                                        "start":        0,
                                        "end":  1.99994,
                                        "seconds":      1.99994,
                                        "bytes":        2862481408,
                                        "bits_per_second":      11450269140.0742,
                                        "sender":       false
                                }
                        }, {
                                "sender":       {
                                        "socket":       9,
                                        "start":        0,
                                        "end":  1.998564,
                                        "seconds":      1.998564,
                                        "bytes":        2859991040,
                                        "bits_per_second":      11448183956.080465,
                                        "retransmits":  0,
                                        "max_snd_cwnd": 0,
                                        "max_snd_wnd":  0,
                                        "max_rtt":      0,
                                        "min_rtt":      0,
                                        "mean_rtt":     0,
                                        "sender":       false
                                },
                                "receiver":     {
                                        "socket":       9,
                                        "start":        0,
                                        "end":  1.99994,
                                        "seconds":      1.99994,
                                        "bytes":        2862612480,
                                        "bits_per_second":      11450793443.803314,
                                        "sender":       false
                                }
                        }],
                "sum_sent":     {
                        "start":        0,
                        "end":  1.998564,
                        "seconds":      1.998564,
                        "bytes":        8582594560,
                        "bits_per_second":      34355045162.42662,
                        "retransmits":  0,
                        "sender":       false
                },
                "sum_received": {
                        "start":        0,
                        "end":  1.99994,
                        "seconds":      1.99994,
                        "bytes":        8590327808,
                        "bits_per_second":      34362342102.263069,
                        "sender":       false
                },
                "cpu_utilization_percent":      {
                        "host_total":   61.469771392303421,
                        "host_user":    2.3047267851156557,
                        "host_system":  59.164978355609321,
                        "remote_total": 84.966699080050844,
                        "remote_user":  0.34607230428503166,
                        "remote_system":        84.6205934515189
                },
                "sender_tcp_congestion":        "cubic",
                "receiver_tcp_congestion":      "cubic"
        }
}
@bmah888
Copy link
Contributor

bmah888 commented Mar 29, 2023

Thanks for the bug report and PR...I recall hearing about this issue before, but I don't remember if there was an issue filed for it or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants