diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-03-06 13:20:52 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-03-06 13:20:52 +0100 |
| commit | 0623a281998ee1d7a62c3f904f76888446cb237a (patch) | |
| tree | dee8d03233c2d867106e9d4a346ca12742afc8c8 /src/mysql.py | |
| parent | 6027198427d77ae48932104eed2615968ae74616 (diff) | |
| download | allocbench-0623a281998ee1d7a62c3f904f76888446cb237a.tar.gz allocbench-0623a281998ee1d7a62c3f904f76888446cb237a.zip | |
add allocators to globalvars; kill mysql server on exit; save libc versions of requirements
Diffstat (limited to 'src/mysql.py')
| -rw-r--r-- | src/mysql.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mysql.py b/src/mysql.py index 2f0bce5..0ba820e 100644 --- a/src/mysql.py +++ b/src/mysql.py @@ -1,3 +1,4 @@ +import atexit import copy import matplotlib.pyplot as plt import numpy as np @@ -9,7 +10,7 @@ from subprocess import PIPE import sys from time import sleep -from src.allocators import allocators +from src.globalvars import allocators from src.benchmark import Benchmark from src.util import * @@ -42,6 +43,9 @@ class Benchmark_MYSQL(Benchmark): self.measure_cmd = "" self.requirements = ["mysqld", "sysbench"] + + atexit.register(self.terminate_server) + super().__init__() def start_and_wait_for_server(self, cmd_prefix=""): @@ -54,6 +58,12 @@ class Benchmark_MYSQL(Benchmark): sleep(10) return self.server.poll() is None + def terminate_server(self): + if self.server: + if self.server.poll() == None: + print_info("Killing still running mysql server") + self.server.kill() + def prepare(self): if not super().prepare(): return False |
