From 5f477e0561b613038888a0fd7169f9b6dc11b118 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 2 Apr 2019 11:51:20 +0200 Subject: add analyze and server_benchmark feature --analyze uses malt to trace the benchmarks behavior. It uses the run loop but the obtained results are not stored Benchmark.server_benchmark is used if only a server is started for each allocator and clients are used to measure its performance in the run loop. If server_benchmark is set to True the cmds are run with the system default allocator. Misc changes: * The global environment is no longer changed. Instead a custom env dict is passed to suprocesses containing LD_PRELOAD. * Failing cmds no longer skip the whole benchmark instead they now skip the malfunctioning allocator. * Fix default title in plot_single_arg an analyse run are not stored --- src/benchmarks/mysql.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/benchmarks/mysql.py') diff --git a/src/benchmarks/mysql.py b/src/benchmarks/mysql.py index e3f1f0f..0ac3f75 100644 --- a/src/benchmarks/mysql.py +++ b/src/benchmarks/mysql.py @@ -51,12 +51,12 @@ class Benchmark_MYSQL(Benchmark): super().__init__() - def start_and_wait_for_server(self, cmd_prefix=""): + def start_and_wait_for_server(self, cmd_prefix="", env=None): actual_cmd = cmd_prefix.split() + server_cmd print_info("Starting server with:", actual_cmd) self.server = subprocess.Popen(actual_cmd, stdout=PIPE, stderr=PIPE, - universal_newlines=True) + env=env, universal_newlines=True) # TODO make sure server comes up ! sleep(10) if self.server.poll() is not None: @@ -135,8 +135,8 @@ class Benchmark_MYSQL(Benchmark): print_status("Delete mysqld directory") shutil.rmtree("mysql_test", ignore_errors=True) - def preallocator_hook(self, allocator, run, verbose): - if not self.start_and_wait_for_server(cmd_prefix=allocator[1]["cmd_prefix"]): + def preallocator_hook(self, allocator, run, env, verbose): + if not self.start_and_wait_for_server(cmd_prefix=allocator[1]["cmd_prefix"], env=env): print_debug(allocator[1]["cmd_prefix"], file=sys.stderr) raise Exception("Starting mysql server for {} failed with".format(allocator[0], self.server.returncode)) -- cgit v1.2.3