From fe26e05dfba7b6c4a3e28b2be6dc369426277790 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 7 Apr 2020 15:54:25 +0200 Subject: unify plotting code Now there is only a single plot function which takes a plot type as well as some plot and figure options. --- src/benchmarks/mysql.py | 72 ++++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 27 deletions(-) (limited to 'src/benchmarks/mysql.py') diff --git a/src/benchmarks/mysql.py b/src/benchmarks/mysql.py index a5b215c..0df85d2 100644 --- a/src/benchmarks/mysql.py +++ b/src/benchmarks/mysql.py @@ -201,42 +201,60 @@ class BenchmarkMYSQL(Benchmark): args = self.results["args"] # linear plot - plt.plot_single_arg(self, "{transactions}", - xlabel='"threads"', - ylabel='"transactions"', - title='"sysbench oltp read only"', - file_postfix="l") + plt.plot(self, + "{transactions}", + fig_options={ + 'xlabel': 'threads', + 'ylabel': 'transactions', + 'title': 'sysbench oltp read only', + }, + file_postfix="l") # normalized linear plot ref_alloc = list(allocators)[0] - plt.plot_single_arg(self, "{transactions}", - xlabel='"threads"', - ylabel='"transactions scaled at " + scale', - title='"sysbench oltp read only"', - file_postfix="norm.l", - scale=ref_alloc) + plt.plot(self, + "{transactions}", + fig_options={ + 'xlabel': 'threads', + 'ylabel': 'transactions scaled at {scale}', + 'title': 'sysbench oltp read only', + }, + file_postfix="norm.l", + scale=ref_alloc) # bar plot - plt.barplot_single_arg(self, "{transactions}", - xlabel='"threads"', - ylabel='"transactions"', - title='"sysbench oltp read only"', - file_postfix="b") + plt.plot(self, + "{transactions}", + plot_type='bar', + fig_options={ + 'xlabel': 'threads', + 'ylabel': 'transactions', + 'title': 'sysbench oltp read only', + }, + file_postfix="b") # normalized bar plot - plt.barplot_single_arg(self, "{transactions}", - xlabel='"threads"', - ylabel='"transactions scaled at " + scale', - title='"sysbench oltp read only"', - file_postfix="norm.b", - scale=ref_alloc) + plt.plot(self, + "{transactions}", + plot_type='bar', + fig_options={ + 'xlabel': 'threads', + 'ylabel': 'transactions scaled at {scale}', + 'title': 'sysbench oltp read only', + }, + file_postfix="norm.b", + scale=ref_alloc) # Memusage - plt.barplot_single_arg(self, "{mysqld_vmhwm}", - xlabel='"threads"', - ylabel='"VmHWM in kB"', - title='"Memusage sysbench oltp read only"', - file_postfix="mem") + plt.plot(self, + "{mysqld_vmhwm}", + plot_type='bar', + fig_options={ + 'xlabel': 'threads', + 'ylabel': 'VmHWM in kB', + 'title': 'Memusage sysbench oltp read only', + }, + file_postfix="mem") plt.write_tex_table(self, [{ "label": "Transactions", -- cgit v1.2.3