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

Exceptions parsing results should not stop throughput grid #110

Merged
merged 1 commit into from
Jan 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions skylark/cli/experiments/throughput.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@ def start_iperf3_client(arg_pair: Tuple[Server, Server], iperf3_log_dir: Path, i
out_rec = dict(tag=tag, stdout_path=str(iperf3_log_dir / f"{tag}.stdout"), stderr_path=str(iperf3_log_dir / f"{tag}.stderr"))
try:
result = json.loads(stdout)
except json.JSONDecodeError as e:
out_rec["throughput_sent"] = result["end"]["sum_sent"]["bits_per_second"]
out_rec["throughput_recieved"] = result["end"]["sum_received"]["bits_per_second"]
out_rec["cpu_utilization"] = result["end"]["cpu_utilization_percent"]["host_total"]
out_rec["success"] = True
except Exception as e:
logger.exception(e)
logger.error(f"({instance_src.region_tag} -> {instance_dst.region_tag}) iperf3 client failed: {stdout} {stderr}")
out_rec["success"] = False
out_rec["exception"] = str(e)
out_rec["raw_output"] = str(stdout)
return out_rec

out_rec["throughput_sent"] = result["end"]["sum_sent"]["bits_per_second"]
out_rec["throughput_recieved"] = result["end"]["sum_received"]["bits_per_second"]
out_rec["cpu_utilization"] = result["end"]["cpu_utilization_percent"]["host_total"]
out_rec["success"] = True

instance_src.close_server()
instance_dst.close_server()
return out_rec
Expand Down