diff options
| author | Karsten Loesing <karsten.loesing@gmx.net> | 2020-05-15 15:49:04 +0200 |
|---|---|---|
| committer | Karsten Loesing <karsten.loesing@gmx.net> | 2020-05-15 15:49:04 +0200 |
| commit | 026a5232f2326747e472ba0cdd30979484b0108f (patch) | |
| tree | 5d26ca040bdea6419ce7b1710b4a8e8b55bc88a7 | |
| parent | d1b8b907d45d0adac22b63ab1c2bc79b83e0b75d (diff) | |
squash! Rewrite tgen plots to use pandas and seaborn.task-33258-2
- Only plot error plots when there have been errors.
| -rw-r--r-- | onionperf/visualization.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/onionperf/visualization.py b/onionperf/visualization.py index 702e844..51ea59e 100644 --- a/onionperf/visualization.py +++ b/onionperf/visualization.py @@ -229,15 +229,17 @@ class TGenVisualization(Visualization): title="Number of downloads of {0} bytes completed".format(bytes)) def __plot_errors_count(self): - self.__draw_countplot(x="error_code", hue="label", hue_name="Data set", data=self.data, - xlabel="Error code", ylabel="Downloads failed (#)", - title="Number of downloads failed") + if "error_code" in self.data.columns: + self.__draw_countplot(x="error_code", hue="label", hue_name="Data set", data=self.data, + xlabel="Error code", ylabel="Downloads failed (#)", + title="Number of downloads failed") def __plot_errors_time(self): - self.__draw_stripplot(x="start", y="error_code", hue="label", hue_name="Data set", - data = self.data, - xlabel="Download start time", ylabel="Error code", - title="Downloads failed over time") + if "error_code" in self.data.columns: + self.__draw_stripplot(x="start", y="error_code", hue="label", hue_name="Data set", + data = self.data, + xlabel="Download start time", ylabel="Error code", + title="Downloads failed over time") def __draw_ecdf(self, x, hue, hue_name, data, title, xlabel, ylabel): data = data.dropna(subset=[x]) |
