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/httpd.py | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'src/benchmarks/httpd.py') diff --git a/src/benchmarks/httpd.py b/src/benchmarks/httpd.py index 8332f27..c46461f 100644 --- a/src/benchmarks/httpd.py +++ b/src/benchmarks/httpd.py @@ -60,29 +60,35 @@ class BenchmarkHTTPD(Benchmark): "Requests per second:\\s*(\\d*\\.\\d*) .*", stdout).group(1) def summary(self): - plt.plot_fixed_arg(self, - "{requests}", - xlabel="threads", - ylabel="requests/s", - autoticks=False, - file_postfix="requests", - title="{perm.site}: requests/s") + plt.plot(self, + "{requests}", + fig_options={ + 'xlabel': "threads", + 'ylabel': "requests/s", + 'title': "{perm.site}: requests/s" + 'autoticks': False, + }, + file_postfix="requests") - plt.plot_fixed_arg(self, - "{nginx_vmhwm}", - xlabel="threads", - ylabel="VmHWM in KB", - title="{perm.site}: nginx memory usage", - file_postfix="httpd_vmhwm", - autoticks=False) + plt.plot(self, + "{nginx_vmhwm}", + fig_options={ + 'xlabel': "threads", + 'ylabel': "VmHWM in KB", + 'title': "{perm.site}: nginx memory usage", + 'autoticks': False, + }, + file_postfix="httpd_vmhwm") - plt.plot_fixed_arg(self, - "{php-fpm_vmhwm}", - xlabel="threads", - ylabel="VmHWM in KB", - title="{perm.site}: php-fpm memory usage", - file_postfix="php-fpm_vmhwm", - autoticks=False) + plt.plot(self, + "{php-fpm_vmhwm}", + fig_options={ + 'xlabel': "threads", + 'ylabel': "VmHWM in KB", + 'title': "{perm.site}: php-fpm memory usage", + 'autoticks': False, + }, + file_postfix="php-fpm_vmhwm") httpd = BenchmarkHTTPD() -- cgit v1.2.3