Added 3 iterations to macro benchmark.
Reviewers: mislav.bradac Reviewed By: mislav.bradac Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D759
This commit is contained in:
parent
c8d34c58ef
commit
21782901c1
@ -226,10 +226,6 @@ class _QuerySuite:
|
|||||||
time.time() - start_time))
|
time.time() - start_time))
|
||||||
return r_val
|
return r_val
|
||||||
|
|
||||||
measurements = []
|
|
||||||
|
|
||||||
measurement_lists = defaultdict(list)
|
|
||||||
|
|
||||||
def add_measurement(dictionary, iteration, key):
|
def add_measurement(dictionary, iteration, key):
|
||||||
if key in dictionary:
|
if key in dictionary:
|
||||||
measurement = {"target": key,
|
measurement = {"target": key,
|
||||||
@ -243,45 +239,53 @@ class _QuerySuite:
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
pid = runner.start()
|
measurements = []
|
||||||
execute("setup")
|
|
||||||
|
|
||||||
# warmup phase
|
measurement_lists = defaultdict(list)
|
||||||
for _ in range(min(scenario_config.get("iterations", 1),
|
|
||||||
scenario_config.get("warmup", 2))):
|
|
||||||
execute("itersetup")
|
|
||||||
execute("run", scenario_config.get("num_client_workers", 1))
|
|
||||||
execute("iterteardown")
|
|
||||||
|
|
||||||
if self.perf:
|
# Run the whole test 3 times because memgraph is sometimes
|
||||||
self.perf.start(pid)
|
# consistently slow and with this hack we get a good median
|
||||||
|
for i in range(3):
|
||||||
|
pid = runner.start()
|
||||||
|
execute("setup")
|
||||||
|
|
||||||
# TODO per scenario/run runner configuration
|
# warmup phase
|
||||||
num_iterations = scenario_config.get("iterations", 1)
|
for _ in range(min(scenario_config.get("iterations", 1),
|
||||||
for iteration in range(num_iterations):
|
scenario_config.get("warmup", 2))):
|
||||||
# TODO if we didn't have the itersetup it would be trivial
|
execute("itersetup")
|
||||||
# to move iteration to the bolt_client script, so we would not
|
execute("run", scenario_config.get("num_client_workers", 1))
|
||||||
# have to start and stop the client for each iteration, it would
|
execute("iterteardown")
|
||||||
# most likely run faster
|
|
||||||
execute("itersetup")
|
|
||||||
run_result = execute("run",
|
|
||||||
scenario_config.get("num_client_workers", 1))
|
|
||||||
add_measurement(run_result, iteration, WALL_TIME)
|
|
||||||
add_measurement(run_result, iteration, CPU_TIME)
|
|
||||||
for measurement in ["parsing_time",
|
|
||||||
"plan_execution_time",
|
|
||||||
"planning_time"] :
|
|
||||||
for i in range(len(run_result.get("metadatas", []))):
|
|
||||||
add_measurement(run_result["metadatas"][i], iteration,
|
|
||||||
measurement)
|
|
||||||
execute("iterteardown")
|
|
||||||
|
|
||||||
if self.perf:
|
if self.perf:
|
||||||
self.perf.stop()
|
self.perf.start(pid)
|
||||||
|
|
||||||
|
# TODO per scenario/run runner configuration
|
||||||
|
num_iterations = scenario_config.get("iterations", 1)
|
||||||
|
for iteration in range(num_iterations):
|
||||||
|
# TODO if we didn't have the itersetup it would be trivial
|
||||||
|
# to move iteration to the bolt_client script, so we would not
|
||||||
|
# have to start and stop the client for each iteration, it would
|
||||||
|
# most likely run faster
|
||||||
|
execute("itersetup")
|
||||||
|
run_result = execute("run",
|
||||||
|
scenario_config.get("num_client_workers", 1))
|
||||||
|
add_measurement(run_result, iteration, WALL_TIME)
|
||||||
|
add_measurement(run_result, iteration, CPU_TIME)
|
||||||
|
for measurement in ["parsing_time",
|
||||||
|
"plan_execution_time",
|
||||||
|
"planning_time"] :
|
||||||
|
for i in range(len(run_result.get("metadatas", []))):
|
||||||
|
add_measurement(run_result["metadatas"][i], iteration,
|
||||||
|
measurement)
|
||||||
|
execute("iterteardown")
|
||||||
|
|
||||||
|
if self.perf:
|
||||||
|
self.perf.stop()
|
||||||
|
|
||||||
|
# TODO value outlier detection and warning across iterations
|
||||||
|
execute("teardown")
|
||||||
|
runner.stop()
|
||||||
|
|
||||||
# TODO value outlier detection and warning across iterations
|
|
||||||
execute("teardown")
|
|
||||||
runner.stop()
|
|
||||||
self.append_scenario_summary(group_name, scenario_name,
|
self.append_scenario_summary(group_name, scenario_name,
|
||||||
measurement_lists, num_iterations)
|
measurement_lists, num_iterations)
|
||||||
return measurements
|
return measurements
|
||||||
|
Loading…
Reference in New Issue
Block a user