LEFT | RIGHT |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 import argparse | 2 import argparse |
3 import json | 3 import json |
4 import logging | 4 import logging |
5 import os | 5 import os |
6 from threading import Thread | 6 from threading import Thread |
7 import time | 7 import time |
8 | 8 |
9 import api as api | 9 import api as api |
10 import cli as cli | 10 import cli as cli |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 ) | 199 ) |
200 | 200 |
201 # All tests are finished at this point | 201 # All tests are finished at this point |
202 api.get_ycsb_plot_from_list( | 202 api.get_ycsb_plot_from_list( |
203 os.path.join( | 203 os.path.join( |
204 unique_exp_folder, 'Varying_latency_frequency_levels.csv' | 204 unique_exp_folder, 'Varying_latency_frequency_levels.csv' |
205 ), | 205 ), |
206 where_to_save=unique_exp_folder, | 206 where_to_save=unique_exp_folder, |
207 label="Varying sleep frequency changes effects" | 207 label="Varying sleep frequency changes effects" |
208 ) | 208 ) |
209 return unique_exp_folder | |
210 | 209 |
211 | 210 |
212 def run_constant_latency_and_jitter_exp(FLAGS, conf, net, jitter, latency): | 211 def run_constant_latency_and_jitter_exp(FLAGS, conf, net, jitter, latency): |
213 """ | 212 """ |
214 Run exp with worst case latency and jitter | 213 Run exp with worst case latency and jitter |
215 :param FLAGS: | 214 :param FLAGS: |
216 :param conf: | 215 :param conf: |
217 :param net: | 216 :param net: |
218 :return: | 217 :return: |
219 """ | 218 """ |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 unique_exp_folder = create_experiment_folders() | 398 unique_exp_folder = create_experiment_folders() |
400 | 399 |
401 # Do initial setting up testbed here | 400 # Do initial setting up testbed here |
402 net = setup_testbed(FLAGS, conf, launch_system=True) | 401 net = setup_testbed(FLAGS, conf, launch_system=True) |
403 # Load YCSB stuff to the keyspace | 402 # Load YCSB stuff to the keyspace |
404 api.experiment_setup_keyspace(FLAGS, conf, net=net) | 403 api.experiment_setup_keyspace(FLAGS, conf, net=net) |
405 | 404 |
406 if FLAGS.vary_latency_score: | 405 if FLAGS.vary_latency_score: |
407 print("#########################################################") | 406 print("#########################################################") |
408 print("Muliconf multi sleep time experiment started with score log") | 407 print("Muliconf multi sleep time experiment started with score log") |
409 output_folder_of_exp = run_multiconf_sleep_time( | 408 run_multiconf_sleep_time( |
410 FLAGS, conf, net=net, unique_exp_folder=unique_exp_folder | 409 FLAGS, conf, net=net, unique_exp_folder=unique_exp_folder |
411 ) | 410 ) |
412 fetch_data_from_log_and_write_to_csv( | 411 fetch_data_from_log_and_write_to_csv( |
413 conf=conf, pattern='The new score of host', | 412 conf=conf, pattern='The new score of host', |
414 out_dir=output_folder_of_exp | 413 out_dir=unique_exp_folder |
415 ) | 414 ) |
416 plot_score_data(conf, target_foler=output_folder_of_exp) | 415 plot_score_data(conf, target_folder=unique_exp_folder) |
417 print("Muliconf multi sleep time experiment finished") | 416 print("Muliconf multi sleep time experiment finished") |
418 print("#############################################################
") | 417 print("#############################################################
") |
419 | 418 |
420 # Run experiments one after other | 419 # Run experiments one after other |
421 print("#############################################################") | 420 print("#############################################################") |
422 print("Muliconf multi thread experiment started") | 421 print("Muliconf multi thread experiment started") |
423 run_multiconf_threads_and_plot( | 422 run_multiconf_threads_and_plot( |
424 FLAGS, conf, net=net, unique_exp_folder=unique_exp_folder | 423 FLAGS, conf, net=net, unique_exp_folder=unique_exp_folder |
425 ) | 424 ) |
426 print("Muliconf multi thread experiment finished") | 425 print("Muliconf multi thread experiment finished") |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 where_to_save=os.path.join( | 499 where_to_save=os.path.join( |
501 conf["env"]["out_exp_dir"], 'plot_data', 'jitter_data' | 500 conf["env"]["out_exp_dir"], 'plot_data', 'jitter_data' |
502 ), | 501 ), |
503 title='Round-Trip-Time vs Time at varying Jitter' | 502 title='Round-Trip-Time vs Time at varying Jitter' |
504 ) | 503 ) |
505 else: # If no flag has been provided, we give CLI back to the user | 504 else: # If no flag has been provided, we give CLI back to the user |
506 net = setup_testbed(FLAGS, conf, launch_system=True) | 505 net = setup_testbed(FLAGS, conf, launch_system=True) |
507 # Load YCSB stuff to the keyspace | 506 # Load YCSB stuff to the keyspace |
508 api.experiment_setup_keyspace(FLAGS, conf, net=net) | 507 api.experiment_setup_keyspace(FLAGS, conf, net=net) |
509 cli.run_cli(FLAGS, conf, net) | 508 cli.run_cli(FLAGS, conf, net) |
LEFT | RIGHT |