[tor-commits] [onionperf/develop] Always include error_code column in CSV output.
karsten at torproject.org
karsten at torproject.org
Thu Jul 2 08:43:43 UTC 2020
commit fc6e9702d3012edca463b96fbbe218bbff70d6c7
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Wed Jul 1 15:20:27 2020 +0200
Always include error_code column in CSV output.
We should include an error_code column in the CSV output, regardless
of whether data contains measurements with an error code or not.
Everything else is just too confusing to whoever processes these
files.
Fixes #40004.
---
onionperf/visualization.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/onionperf/visualization.py b/onionperf/visualization.py
index 2107d5a..0a2a9d9 100644
--- a/onionperf/visualization.py
+++ b/onionperf/visualization.py
@@ -58,7 +58,8 @@ class TGenVisualization(Visualization):
tgen_transfers = analysis.get_tgen_transfers(client)
for transfer_id, transfer_data in tgen_transfers.items():
transfer = {"transfer_id": transfer_id, "label": label,
- "filesize_bytes": transfer_data["filesize_bytes"]}
+ "filesize_bytes": transfer_data["filesize_bytes"],
+ "error_code": None}
transfer["server"] = "onion" if ".onion:" in transfer_data["endpoint_remote"] else "public"
if "elapsed_seconds" in transfer_data:
s = transfer_data["elapsed_seconds"]
@@ -147,7 +148,7 @@ class TGenVisualization(Visualization):
def __plot_errors_count(self):
for server in self.data["server"].unique():
- if "error_code" in self.data.columns and self.data[self.data["server"] == server]["error_code"].count() > 0:
+ if self.data[self.data["server"] == server]["error_code"].count() > 0:
self.__draw_countplot(x="error_code", hue="label", hue_name="Data set",
data=self.data[self.data["server"] == server],
xlabel="Error code", ylabel="Downloads failed (#)",
@@ -155,7 +156,7 @@ class TGenVisualization(Visualization):
def __plot_errors_time(self):
for server in self.data["server"].unique():
- if "error_code" in self.data.columns and self.data[self.data["server"] == server]["error_code"].count() > 0:
+ if self.data[self.data["server"] == server]["error_code"].count() > 0:
self.__draw_stripplot(x="start", y="error_code", hue="label", hue_name="Data set",
data=self.data[self.data["server"] == server],
xlabel="Download start time", ylabel="Error code",
More information about the tor-commits
mailing list