Skip to content

Commit

Permalink
iperf3: Add compatibility for servers pre version 3.2.
Browse files Browse the repository at this point in the history
Result message from servers pre version 3.2 do not encode start or end
time, so workaround this by using the t3, t0 timestamps used elsewhere for
sending.

Fixes issue #665.
  • Loading branch information
graeme-winter authored and dpgeorge committed Jul 27, 2023
1 parent ce3f282 commit 01ab7ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions python-ecosys/iperf3/iperf3.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,14 @@ def stop(self):

def report_receiver(self, stats):
st = stats["streams"][0]
dt = st["end_time"] - st["start_time"]

# iperf servers pre 3.2 do not transmit start or end time,
# so use local as fallback if not available.
dt = ticks_diff(self.t3, self.t0)

self.print_line(
st["start_time"],
st["end_time"],
st.get("start_time", 0.0),
st.get("end_time", dt * 1e-6),
st["bytes"],
st["packets"],
st["errors"],
Expand Down
2 changes: 1 addition & 1 deletion python-ecosys/iperf3/manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
metadata(version="0.1.3", pypi="iperf3", pypi_publish="uiperf3")
metadata(version="0.1.4", pypi="iperf3", pypi_publish="uiperf3")

module("iperf3.py")

0 comments on commit 01ab7ba

Please sign in to comment.