Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #114 from chicago-cdac/refactoring
Browse files Browse the repository at this point in the history
fix ndt7 bug
  • Loading branch information
ggmartins authored Feb 14, 2023
2 parents 8b9a5de + b07bd5f commit c549609
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/netrics/builtin/netrics_test_speedtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,29 @@ def test_ndt7(key, measurement, conf, results, quiet):
error_found = True
results[key]["ndt_error"] = error_found
return f'{err}'

res_json, res_text, total_bytes = parse_ndt7_output(output)

download_speed = float(res_json["Download"]["Value"])
upload_speed = float(res_json["Upload"]["Value"])
download_retrans = float(res_json["DownloadRetrans"]["Value"])
minrtt = float(res_json['MinRTT']['Value'])
download_speed = float(res_json["Download"]["Throughput"]["Value"])
download_latency = float(res_json["Download"]["Latency"]["Value"])
upload_speed = float(res_json["Upload"]["Throughput"]["Value"])
download_retrans = float(res_json["Download"]["Retransmission"]["Value"])
# not in new json
# minrtt = float(res_json['MinRTT']['Value'])

results[key]["speedtest_ndt7_download"] = download_speed
results[key]["speedtest_ndt7_upload"] = upload_speed
results[key]["speedtest_ndt7_downloadretrans"] = download_retrans
results[key]["speedtest_ndt7_minrtt"] = minrtt
results[key]["speedtest_ndt7_downloadlatency"] = download_latency
results[key]["speedtest_ndt7_server"] = res_json['ServerFQDN']
# results[key]["speedtest_ndt7_minrtt"] = minrtt
results["total_bytes_consumed"] += total_bytes

if not quiet:
print('\n --- NDT7 speed tests ---')
print(f'Download:\t{download_speed} Mb/s')
print(f'Upload:\t\t{upload_speed} Mb/s')
print(f'DownloadRetrans:{download_retrans} %')
print(f'MinRTT:\t\t{minrtt} ms')
print(f'Download Latency:{download_latency} ms')
# print(f'MinRTT:\t\t{minrtt} ms')

results[key]["ndt_error"] = error_found

Expand Down

0 comments on commit c549609

Please sign in to comment.