Commit 94a99a08 authored by Julia Abramenko's avatar Julia Abramenko

prepared saving opportunity for different file formats

parent ae500e54
Pipeline #50756 passed with stage
in 22 minutes and 56 seconds
......@@ -25,6 +25,7 @@ class TimeSeriesAggregator:
self.agg_throughput = None
self.cols_latency = None
self.cols_throughput = None
self.format = 'pdf'
self.run = -1
self.files = 0
self.min_t = 0
......@@ -59,6 +60,7 @@ class TimeSeriesAggregator:
parser.add_argument('--plotAverage', '-pa', action='store_true', default=False, required=False)
# optional plotting of outliers as scatter points, processed if '-outscat' is given
parser.add_argument('--outlier_scatter', '-outscat', action='store_true', default=False, required=False)
parser.add_argument('--format', '-f', type=str, nargs=1, required=False)
# fix the parser as main parser object of the TimeSeriesAggregator object
self.parser = parser
......@@ -92,6 +94,8 @@ class TimeSeriesAggregator:
self.plotAverage = args.plotAverage
# if scatter plot shall be added
self.outlier_scatter = args.outlier_scatter
if args.format is not None:
self.format = args.format[0]
def extract_input(self):
"""
......@@ -178,7 +182,8 @@ class TimeSeriesAggregator:
# calculate the overall mean
overall_mean = self.agg_throughput["Mean"].mean()
# draw the overall mean as horizontal line
ax.axhline(overall_mean, linestyle='--', label='Overall Average', color='black')
if self.plotAverage:
ax.axhline(overall_mean, linestyle='--', label='Overall Average', color='black')
# draw the marker with its label on the graph if given
if self.marker_pos_x is not None:
ax.axvline(self.marker_pos_x, color='red', linestyle=':', label=self.label_text)
......@@ -196,7 +201,7 @@ class TimeSeriesAggregator:
# indicating saving process
print("Saving throughput plot to disk: " + output_file)
# store the created picture
plt.savefig(output_file, format='pdf')
plt.savefig(output_file, format=self.format)
plt.close()
def plot_latency(self):
......@@ -228,7 +233,8 @@ class TimeSeriesAggregator:
# calculate the overall mean
overall_mean = self.agg_latency["Mean"].mean()
# draw the overall mean as horizontal line
ax.axhline(overall_mean, linestyle='--', label='Overall Average', color='black')
if self.plotAverage:
ax.axhline(overall_mean, linestyle='--', label='Overall Average', color='black')
# draw the marker with its label on the graph if given
if self.marker_pos_x is not None:
ax.axvline(self.marker_pos_x, color='red', linestyle=':', label=str(self.label_text))
......@@ -253,14 +259,14 @@ class TimeSeriesAggregator:
x, y = zip(*item)
plt.scatter(x, y, color=color_dict[key], label="outlier {}".format(key))
# modify default legend
ax.legend(loc='lower center', ncol=3, borderpad=1, prop={'size': 6})
ax.legend(loc='lower center', ncol=4, borderpad=1, prop={'size': 6})
# adjust size of the figure
plt.plot(figsize=(1000, 600))
# indicating saving process
print("Saving latency plot to disk: " + output_file)
# store the created picture
plt.savefig(output_file, format='pdf')
plt.savefig(output_file, format=self.format)
# @staticmethod
def remove_outliers(self, df_in, col_name):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment