|
@@ -40,8 +40,7 @@ class Benchmarker:
|
|
all_tests = gather_remaining_tests(self.config, self.results)
|
|
all_tests = gather_remaining_tests(self.config, self.results)
|
|
|
|
|
|
# Setup client/server
|
|
# Setup client/server
|
|
- log(
|
|
|
|
- "Preparing Server, Database, and Client ...", border='=')
|
|
|
|
|
|
+ log("Preparing Server, Database, and Client ...", border='=')
|
|
with self.config.quiet_out.enable():
|
|
with self.config.quiet_out.enable():
|
|
self.__setup_server()
|
|
self.__setup_server()
|
|
self.__setup_database()
|
|
self.__setup_database()
|
|
@@ -204,15 +203,16 @@ class Benchmarker:
|
|
if test.os.lower() != self.config.os.lower() or test.database_os.lower(
|
|
if test.os.lower() != self.config.os.lower() or test.database_os.lower(
|
|
) != self.config.database_os.lower():
|
|
) != self.config.database_os.lower():
|
|
log("OS or Database OS specified in benchmark_config.json does not match the current environment. Skipping.",
|
|
log("OS or Database OS specified in benchmark_config.json does not match the current environment. Skipping.",
|
|
- log_prefix, benchmark_log)
|
|
|
|
|
|
+ prefix=log_prefix,
|
|
|
|
+ file=benchmark_log)
|
|
return False
|
|
return False
|
|
|
|
|
|
# If the test is in the excludes list, we skip it
|
|
# If the test is in the excludes list, we skip it
|
|
if self.config.exclude != None and test.name in self.config.exclude:
|
|
if self.config.exclude != None and test.name in self.config.exclude:
|
|
log("Test {name} has been added to the excludes list. Skipping.".
|
|
log("Test {name} has been added to the excludes list. Skipping.".
|
|
format(name=test.name),
|
|
format(name=test.name),
|
|
- log_prefix,
|
|
|
|
- benchmark_log)
|
|
|
|
|
|
+ prefix=log_prefix,
|
|
|
|
+ file=benchmark_log)
|
|
return False
|
|
return False
|
|
|
|
|
|
database_container_id = None
|
|
database_container_id = None
|
|
@@ -225,8 +225,10 @@ class Benchmarker:
|
|
self.results.write_intermediate(test.name, "port " + str(
|
|
self.results.write_intermediate(test.name, "port " + str(
|
|
test.port) + " is not available before start")
|
|
test.port) + " is not available before start")
|
|
log("Error: Port %s is not available, cannot start %s" %
|
|
log("Error: Port %s is not available, cannot start %s" %
|
|
- (test.port, test.name),
|
|
|
|
- prefix=log_prefix, file=benchmark_log, color=Fore.RED)
|
|
|
|
|
|
+ (test.port, test.name),
|
|
|
|
+ prefix=log_prefix,
|
|
|
|
+ file=benchmark_log,
|
|
|
|
+ color=Fore.RED)
|
|
return False
|
|
return False
|
|
|
|
|
|
# Start database container
|
|
# Start database container
|
|
@@ -237,7 +239,9 @@ class Benchmarker:
|
|
self.results.write_intermediate(test.name,
|
|
self.results.write_intermediate(test.name,
|
|
"ERROR: Problem starting")
|
|
"ERROR: Problem starting")
|
|
log("ERROR: Problem building/running database container",
|
|
log("ERROR: Problem building/running database container",
|
|
- prefix=log_prefix, file=benchmark_log, color=Fore.RED)
|
|
|
|
|
|
+ prefix=log_prefix,
|
|
|
|
+ file=benchmark_log,
|
|
|
|
+ color=Fore.RED)
|
|
return False
|
|
return False
|
|
|
|
|
|
# Start webapp
|
|
# Start webapp
|
|
@@ -247,7 +251,9 @@ class Benchmarker:
|
|
self.results.write_intermediate(test.name,
|
|
self.results.write_intermediate(test.name,
|
|
"ERROR: Problem starting")
|
|
"ERROR: Problem starting")
|
|
log("ERROR: Problem starting {name}".format(name=test.name),
|
|
log("ERROR: Problem starting {name}".format(name=test.name),
|
|
- prefix=log_prefix, file=benchmark_log, color=Fore.RED)
|
|
|
|
|
|
+ prefix=log_prefix,
|
|
|
|
+ file=benchmark_log,
|
|
|
|
+ color=Fore.RED)
|
|
return False
|
|
return False
|
|
|
|
|
|
slept = 0
|
|
slept = 0
|
|
@@ -258,7 +264,9 @@ class Benchmarker:
|
|
docker_helper.stop(self.config, database_container_id,
|
|
docker_helper.stop(self.config, database_container_id,
|
|
test)
|
|
test)
|
|
log("ERROR: One or more expected docker container exited early",
|
|
log("ERROR: One or more expected docker container exited early",
|
|
- prefix=log_prefix, file=benchmark_log, color=Fore.RED)
|
|
|
|
|
|
+ prefix=log_prefix,
|
|
|
|
+ file=benchmark_log,
|
|
|
|
+ color=Fore.RED)
|
|
return False
|
|
return False
|
|
time.sleep(1)
|
|
time.sleep(1)
|
|
slept += 1
|
|
slept += 1
|
|
@@ -266,7 +274,9 @@ class Benchmarker:
|
|
# Debug mode blocks execution here until ctrl+c
|
|
# Debug mode blocks execution here until ctrl+c
|
|
if self.config.mode == "debug":
|
|
if self.config.mode == "debug":
|
|
log("Entering debug mode. Server has started. CTRL-c to stop.",
|
|
log("Entering debug mode. Server has started. CTRL-c to stop.",
|
|
- prefix=log_prefix, file=benchmark_log, color=Fore.YELLOW)
|
|
|
|
|
|
+ prefix=log_prefix,
|
|
|
|
+ file=benchmark_log,
|
|
|
|
+ color=Fore.YELLOW)
|
|
while True:
|
|
while True:
|
|
time.sleep(1)
|
|
time.sleep(1)
|
|
|
|
|
|
@@ -277,7 +287,8 @@ class Benchmarker:
|
|
# Benchmark this test
|
|
# Benchmark this test
|
|
if self.config.mode == "benchmark":
|
|
if self.config.mode == "benchmark":
|
|
log("Benchmarking %s" % test.name,
|
|
log("Benchmarking %s" % test.name,
|
|
- file=benchmark_log, border='-')
|
|
|
|
|
|
+ file=benchmark_log,
|
|
|
|
+ border='-')
|
|
self.__benchmark(test, benchmark_log)
|
|
self.__benchmark(test, benchmark_log)
|
|
|
|
|
|
# Stop this test
|
|
# Stop this test
|
|
@@ -292,7 +303,8 @@ class Benchmarker:
|
|
stdout=benchmark_log)
|
|
stdout=benchmark_log)
|
|
except Exception:
|
|
except Exception:
|
|
log("Error: Could not empty /tmp",
|
|
log("Error: Could not empty /tmp",
|
|
- file=benchmark_log, color=Fore.RED)
|
|
|
|
|
|
+ file=benchmark_log,
|
|
|
|
+ color=Fore.RED)
|
|
|
|
|
|
# Save results thus far into the latest results directory
|
|
# Save results thus far into the latest results directory
|
|
self.results.write_intermediate(test.name,
|
|
self.results.write_intermediate(test.name,
|
|
@@ -305,7 +317,9 @@ class Benchmarker:
|
|
|
|
|
|
if self.config.mode == "verify" and not passed_verify:
|
|
if self.config.mode == "verify" and not passed_verify:
|
|
log("Failed verify!",
|
|
log("Failed verify!",
|
|
- prefix=log_prefix, file=benchmark_log, color=Fore.RED)
|
|
|
|
|
|
+ prefix=log_prefix,
|
|
|
|
+ file=benchmark_log,
|
|
|
|
+ color=Fore.RED)
|
|
return False
|
|
return False
|
|
except KeyboardInterrupt:
|
|
except KeyboardInterrupt:
|
|
docker_helper.stop(self.config, database_container_id, test)
|
|
docker_helper.stop(self.config, database_container_id, test)
|
|
@@ -314,7 +328,9 @@ class Benchmarker:
|
|
self.results.write_intermediate(
|
|
self.results.write_intermediate(
|
|
test.name, "error during test setup: " + str(e))
|
|
test.name, "error during test setup: " + str(e))
|
|
log("Subprocess Error %s" % test.name,
|
|
log("Subprocess Error %s" % test.name,
|
|
- file=benchmark_log, border='-', color=Fore.RED)
|
|
|
|
|
|
+ file=benchmark_log,
|
|
|
|
+ border='-',
|
|
|
|
+ color=Fore.RED)
|
|
log(tb, prefix=log_prefix, file=benchmark_log)
|
|
log(tb, prefix=log_prefix, file=benchmark_log)
|
|
return False
|
|
return False
|
|
|
|
|