diff --git a/figures/system.xml b/figures/system.xml new file mode 100644 index 0000000..e5472a0 --- /dev/null +++ b/figures/system.xml @@ -0,0 +1 @@ +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 \ No newline at end of file diff --git a/plots/baseline/azure/baseline_azure_CPU.png b/plots/baseline/azure/baseline_azure_CPU.png new file mode 100644 index 0000000..70dd6d2 Binary files /dev/null and b/plots/baseline/azure/baseline_azure_CPU.png differ diff --git a/plots/baseline/azure/baseline_azure_NETOUT.png b/plots/baseline/azure/baseline_azure_NETOUT.png new file mode 100644 index 0000000..69e7c1c Binary files /dev/null and b/plots/baseline/azure/baseline_azure_NETOUT.png differ diff --git a/plots/baseline/baseline_get1_agr_R.png b/plots/baseline/baseline_get1_agr_R.png new file mode 100644 index 0000000..296bddc Binary files /dev/null and b/plots/baseline/baseline_get1_agr_R.png differ diff --git a/plots/baseline/baseline_get1_agr_T.png b/plots/baseline/baseline_get1_agr_T.png new file mode 100644 index 0000000..a2a5f88 Binary files /dev/null and b/plots/baseline/baseline_get1_agr_T.png differ diff --git a/plots/baseline/baseline_get2_agr_R.png b/plots/baseline/baseline_get2_agr_R.png new file mode 100644 index 0000000..32ed681 Binary files /dev/null and b/plots/baseline/baseline_get2_agr_R.png differ diff --git a/plots/baseline/baseline_get2_agr_T.png b/plots/baseline/baseline_get2_agr_T.png new file mode 100644 index 0000000..8d9a40a Binary files /dev/null and b/plots/baseline/baseline_get2_agr_T.png differ diff --git a/plots/baseline/baseline_set1_agr_R.png b/plots/baseline/baseline_set1_agr_R.png new file mode 100644 index 0000000..390b3a9 Binary files /dev/null and b/plots/baseline/baseline_set1_agr_R.png differ diff --git a/plots/baseline/baseline_set1_agr_T.png b/plots/baseline/baseline_set1_agr_T.png new file mode 100644 index 0000000..5a3ae1b Binary files /dev/null and b/plots/baseline/baseline_set1_agr_T.png differ diff --git a/plots/baseline/baseline_set2_agr_R.png b/plots/baseline/baseline_set2_agr_R.png new file mode 100644 index 0000000..f3280ab Binary files /dev/null and b/plots/baseline/baseline_set2_agr_R.png differ diff --git a/plots/baseline/baseline_set2_agr_T.png b/plots/baseline/baseline_set2_agr_T.png new file mode 100644 index 0000000..caee76b Binary files /dev/null and b/plots/baseline/baseline_set2_agr_T.png differ diff --git a/plots/baselineMW/ADD_double_baselineMW_get_agr_R.png b/plots/baselineMW/ADD_double_baselineMW_get_agr_R.png new file mode 100644 index 0000000..0400851 Binary files /dev/null and b/plots/baselineMW/ADD_double_baselineMW_get_agr_R.png differ diff --git a/plots/baselineMW/ADD_double_baselineMW_get_agr_T.png b/plots/baselineMW/ADD_double_baselineMW_get_agr_T.png new file mode 100644 index 0000000..af74e1b Binary files /dev/null and b/plots/baselineMW/ADD_double_baselineMW_get_agr_T.png differ diff --git a/plots/baselineMW/ADD_double_baselineMW_set_agr_R.png b/plots/baselineMW/ADD_double_baselineMW_set_agr_R.png new file mode 100644 index 0000000..a3057dd Binary files /dev/null and b/plots/baselineMW/ADD_double_baselineMW_set_agr_R.png differ diff --git a/plots/baselineMW/ADD_double_baselineMW_set_agr_T.png b/plots/baselineMW/ADD_double_baselineMW_set_agr_T.png new file mode 100644 index 0000000..7d78449 Binary files /dev/null and b/plots/baselineMW/ADD_double_baselineMW_set_agr_T.png differ diff --git a/plots/baselineMW/baselineMW_get_agr_R.png b/plots/baselineMW/baselineMW_get_agr_R.png new file mode 100644 index 0000000..5ad4040 Binary files /dev/null and b/plots/baselineMW/baselineMW_get_agr_R.png differ diff --git a/plots/baselineMW/baselineMW_get_agr_T.png b/plots/baselineMW/baselineMW_get_agr_T.png new file mode 100644 index 0000000..cc1c66c Binary files /dev/null and b/plots/baselineMW/baselineMW_get_agr_T.png differ diff --git a/plots/baselineMW/baselineMW_set_agr_R.png b/plots/baselineMW/baselineMW_set_agr_R.png new file mode 100644 index 0000000..7a5c3f1 Binary files /dev/null and b/plots/baselineMW/baselineMW_set_agr_R.png differ diff --git a/plots/baselineMW/baselineMW_set_agr_T.png b/plots/baselineMW/baselineMW_set_agr_T.png new file mode 100644 index 0000000..ac74874 Binary files /dev/null and b/plots/baselineMW/baselineMW_set_agr_T.png differ diff --git a/plots/baselineMW/double_baselineMW_get_agr_R.png b/plots/baselineMW/double_baselineMW_get_agr_R.png new file mode 100644 index 0000000..dc6cafd Binary files /dev/null and b/plots/baselineMW/double_baselineMW_get_agr_R.png differ diff --git a/plots/baselineMW/double_baselineMW_get_agr_T.png b/plots/baselineMW/double_baselineMW_get_agr_T.png new file mode 100644 index 0000000..7b7e5d0 Binary files /dev/null and b/plots/baselineMW/double_baselineMW_get_agr_T.png differ diff --git a/plots/baselineMW/double_baselineMW_set_agr_R.png b/plots/baselineMW/double_baselineMW_set_agr_R.png new file mode 100644 index 0000000..c768e91 Binary files /dev/null and b/plots/baselineMW/double_baselineMW_set_agr_R.png differ diff --git a/plots/baselineMW/double_baselineMW_set_agr_T.png b/plots/baselineMW/double_baselineMW_set_agr_T.png new file mode 100644 index 0000000..d78a42d Binary files /dev/null and b/plots/baselineMW/double_baselineMW_set_agr_T.png differ diff --git a/scripts/baseline/azure-metrics-plot/azure_metrics_CPU.py b/scripts/baseline/azure-metrics-plot/azure_metrics_CPU.py index 2bed135..337939a 100644 --- a/scripts/baseline/azure-metrics-plot/azure_metrics_CPU.py +++ b/scripts/baseline/azure-metrics-plot/azure_metrics_CPU.py @@ -16,12 +16,14 @@ #x = [a for a in range(len(data))] -plt.plot(data) +plt.plot(data, color='blue', alpha=0.8) plt.ylim(ymax=100) plt.ylim(ymin=0) plt.xlim(xmin=0) plt.xlabel('Time') plt.ylabel('CPU %') +plt.title("CPU load during the experiments") + +plt.savefig("baseline_azure_CPU.png") -plt.show() diff --git a/scripts/baseline/azure-metrics-plot/azure_metrics_NETOUT.py b/scripts/baseline/azure-metrics-plot/azure_metrics_NETOUT.py index 2087265..5c83a65 100644 --- a/scripts/baseline/azure-metrics-plot/azure_metrics_NETOUT.py +++ b/scripts/baseline/azure-metrics-plot/azure_metrics_NETOUT.py @@ -18,12 +18,13 @@ data = [x / 10**6 for x in data] -plt.plot(data) +plt.plot(data, color='blue', alpha=0.8) plt.ylim(ymax=max(data)) plt.ylim(ymin=0) plt.xlim(xmin=0) plt.xlabel('Time') plt.ylabel('Network OUT MBytes') +plt.title("Network output load during the experiments") -plt.show() +plt.savefig("baseline_azure_NETOUT.png") diff --git a/scripts/baseline/azure-metrics-plot/baseline_azure_CPU.png b/scripts/baseline/azure-metrics-plot/baseline_azure_CPU.png new file mode 100644 index 0000000..70dd6d2 Binary files /dev/null and b/scripts/baseline/azure-metrics-plot/baseline_azure_CPU.png differ diff --git a/scripts/baseline/azure-metrics-plot/baseline_azure_NETOUT.png b/scripts/baseline/azure-metrics-plot/baseline_azure_NETOUT.png new file mode 100644 index 0000000..69e7c1c Binary files /dev/null and b/scripts/baseline/azure-metrics-plot/baseline_azure_NETOUT.png differ diff --git a/scripts/baseline/baseline_get1_agr_R.png b/scripts/baseline/baseline_get1_agr_R.png new file mode 100644 index 0000000..296bddc Binary files /dev/null and b/scripts/baseline/baseline_get1_agr_R.png differ diff --git a/scripts/baseline/baseline_get1_agr_T.png b/scripts/baseline/baseline_get1_agr_T.png new file mode 100644 index 0000000..a2a5f88 Binary files /dev/null and b/scripts/baseline/baseline_get1_agr_T.png differ diff --git a/scripts/baseline/baseline_get1_sep_R.png b/scripts/baseline/baseline_get1_sep_R.png new file mode 100644 index 0000000..ab22a13 Binary files /dev/null and b/scripts/baseline/baseline_get1_sep_R.png differ diff --git a/scripts/baseline/baseline_get1_sep_T.png b/scripts/baseline/baseline_get1_sep_T.png new file mode 100644 index 0000000..3c7f59e Binary files /dev/null and b/scripts/baseline/baseline_get1_sep_T.png differ diff --git a/scripts/baseline/baseline_get2_agr_R.png b/scripts/baseline/baseline_get2_agr_R.png new file mode 100644 index 0000000..32ed681 Binary files /dev/null and b/scripts/baseline/baseline_get2_agr_R.png differ diff --git a/scripts/baseline/baseline_get2_agr_T.png b/scripts/baseline/baseline_get2_agr_T.png new file mode 100644 index 0000000..8d9a40a Binary files /dev/null and b/scripts/baseline/baseline_get2_agr_T.png differ diff --git a/scripts/baseline/baseline_get2_sep_R.png b/scripts/baseline/baseline_get2_sep_R.png new file mode 100644 index 0000000..6b01130 Binary files /dev/null and b/scripts/baseline/baseline_get2_sep_R.png differ diff --git a/scripts/baseline/baseline_get2_sep_T.png b/scripts/baseline/baseline_get2_sep_T.png new file mode 100644 index 0000000..5bb85c0 Binary files /dev/null and b/scripts/baseline/baseline_get2_sep_T.png differ diff --git a/scripts/baseline/baseline_set1_agr_R.png b/scripts/baseline/baseline_set1_agr_R.png new file mode 100644 index 0000000..390b3a9 Binary files /dev/null and b/scripts/baseline/baseline_set1_agr_R.png differ diff --git a/scripts/baseline/baseline_set1_agr_T.png b/scripts/baseline/baseline_set1_agr_T.png new file mode 100644 index 0000000..5a3ae1b Binary files /dev/null and b/scripts/baseline/baseline_set1_agr_T.png differ diff --git a/scripts/baseline/baseline_set1_sep_R.png b/scripts/baseline/baseline_set1_sep_R.png new file mode 100644 index 0000000..58b87ad Binary files /dev/null and b/scripts/baseline/baseline_set1_sep_R.png differ diff --git a/scripts/baseline/baseline_set1_sep_T.png b/scripts/baseline/baseline_set1_sep_T.png new file mode 100644 index 0000000..fb99c7b Binary files /dev/null and b/scripts/baseline/baseline_set1_sep_T.png differ diff --git a/scripts/baseline/baseline_set2_agr_R.png b/scripts/baseline/baseline_set2_agr_R.png new file mode 100644 index 0000000..f3280ab Binary files /dev/null and b/scripts/baseline/baseline_set2_agr_R.png differ diff --git a/scripts/baseline/baseline_set2_agr_T.png b/scripts/baseline/baseline_set2_agr_T.png new file mode 100644 index 0000000..caee76b Binary files /dev/null and b/scripts/baseline/baseline_set2_agr_T.png differ diff --git a/scripts/baseline/baseline_set2_sep_R.png b/scripts/baseline/baseline_set2_sep_R.png new file mode 100644 index 0000000..f173066 Binary files /dev/null and b/scripts/baseline/baseline_set2_sep_R.png differ diff --git a/scripts/baseline/baseline_set2_sep_T.png b/scripts/baseline/baseline_set2_sep_T.png new file mode 100644 index 0000000..f369175 Binary files /dev/null and b/scripts/baseline/baseline_set2_sep_T.png differ diff --git a/scripts/baseline/plot_baselines.py b/scripts/baseline/plot_baselines.py index 5180c81..0ddee82 100644 --- a/scripts/baseline/plot_baselines.py +++ b/scripts/baseline/plot_baselines.py @@ -3,6 +3,7 @@ from operator import add from matplotlib import pyplot as plt from statistics import stdev +import operator class ExperimentPlotter: @@ -232,23 +233,33 @@ def plot_baseline_aggregate(self, filename1, filename2): #print(T_STD) # throughput + + print(T_total) + index, value = max(enumerate(T_total), key=operator.itemgetter(1)) + print(clients[index]) + print(value) + plt.figure(1) plt.title("Throughput") - plt.errorbar(clients, T_total, yerr=T_STD, fmt='-o', ecolor='r') + plt.errorbar(clients, T_total, yerr=T_STD, fmt='-x', ecolor='r', color='blue', capsize=2, elinewidth=0.5, alpha=0.8) plt.xticks(ticks) plt.ylim(ymin=0) plt.xlim(xmin=0) plt.grid() plt.xlabel('NumClients') plt.ylabel('Throughput (ops/sec)') + plt.legend() #plt.show() plt.savefig(filename1) plt.gcf().clear() # response time + print(R_total) + print(max(R_total)) + plt.figure(2) plt.title("Response time") - plt.errorbar(clients, R_total, yerr=R_STD, fmt='-o', ecolor='r') + plt.errorbar(clients, R_total, yerr=R_STD, fmt='-x', ecolor='r', color='blue', capsize=2, elinewidth=0.5, alpha=0.8) plt.xticks(ticks) plt.ylim(ymin=0) plt.xlim(xmin=0) @@ -256,6 +267,7 @@ def plot_baseline_aggregate(self, filename1, filename2): plt.xlabel('NumClients') plt.ylabel('Response time (msec)') #plt.show() + plt.legend() plt.savefig(filename2) plt.gcf().clear() @@ -264,14 +276,14 @@ def plot_baseline_aggregate(self, filename1, filename2): # path_GET1 = "/home/ivan/asl-fall17-project/experiments/logfiles/baseline/logfiles_baseline_1_server_GET" # path_SET1 = "/home/ivan/asl-fall17-project/experiments/logfiles/baseline/logfiles_baseline_1_server_SET" -# path_GET2 = "/home/ivan/asl-fall17-project/experiments/logfiles/baseline/logfiles_baseline_2_servers_GET" +path_GET2 = "/home/ivan/asl-fall17-project/experiments/logfiles/baseline/logfiles_baseline_2_servers_GET" # path_SET2 = "/home/ivan/asl-fall17-project/experiments/logfiles/baseline/logfiles_baseline_2_servers_SET" -# plotter = ExperimentPlotter() +plotter = ExperimentPlotter() # plotter.set_params(3, path_SET1, 3, 2, 60, [1, 33, 4]) # plotter.plot_baseline_aggregate("baseline_set1_agr_T.png","baseline_set1_agr_R.png") # plotter.plot_baseline_breakdown("baseline_set1_sep_T.png","baseline_set1_sep_R.png") -# + # plotter.set_params(3, path_GET1, 3, 2, 60, [1, 33, 4]) # plotter.plot_baseline_aggregate("baseline_get1_agr_T.png","baseline_get1_agr_R.png") # plotter.plot_baseline_breakdown("baseline_get1_sep_T.png","baseline_get1_sep_R.png") @@ -279,8 +291,8 @@ def plot_baseline_aggregate(self, filename1, filename2): # plotter.set_params(3, path_SET2, 2, 1, 60, [1, 33, 4]) # plotter.plot_baseline_aggregate("baseline_set2_agr_T.png","baseline_set2_agr_R.png") # plotter.plot_baseline_breakdown("baseline_set2_sep_T.png","baseline_set2_sep_R.png") -# -# plotter.set_params(3, path_GET2, 2, 1, 60, [1, 33, 4]) -# plotter.plot_baseline_aggregate("baseline_get2_agr_T.png","baseline_get2_agr_R.png") -# plotter.plot_baseline_breakdown("baseline_get2_sep_T.png","baseline_get2_sep_R.png") + +plotter.set_params(3, path_GET2, 2, 1, 60, [1, 33, 4]) +plotter.plot_baseline_aggregate("baseline_get2_agr_T.png","baseline_get2_agr_R.png") +plotter.plot_baseline_breakdown("baseline_get2_sep_T.png","baseline_get2_sep_R.png") diff --git a/scripts/baselineMW/plot_baseline_MW.py b/scripts/baselineMW/plot_baseline_MW.py index 580c08d..747e61d 100644 --- a/scripts/baselineMW/plot_baseline_MW.py +++ b/scripts/baselineMW/plot_baseline_MW.py @@ -56,7 +56,7 @@ def extractParamsMW(self, logfile): file.close() - print(logfile) + #print(logfile) return float(avg_throughput), float(avg_response_time) def extractParams(self, logfile): @@ -68,7 +68,7 @@ def extractParams(self, logfile): file.close() - print(logfile) + #print(logfile) return float(avg_throughput), float(avg_response_time) def plot_baseline_aggregate(self, filename1, filename2): @@ -80,11 +80,10 @@ def plot_baseline_aggregate(self, filename1, filename2): if self.INSIDE_MW: MACHINES_RANGE = self.MW_NUMBER + print("Plotting on the MW") else: - if self.MACHINES_NUMBER != 1: - MACHINES_RANGE = self.MACHINES_NUMBER * self.THREAD_PER_CLIENT - else: - MACHINES_RANGE = self.MACHINES_NUMBER + MACHINES_RANGE = self.MACHINES_NUMBER + print("Plotting on the Clients") for worker in self.WORKERS_RANGE: # Build @@ -155,7 +154,9 @@ def plot_baseline_aggregate(self, filename1, filename2): # throughput plt.figure(1) + print("WORKERS # {} MAX Throuthput {}".format(self.WORKERS_RANGE[i], max(T))) #plt.title("Throughput graph") + #print(T) p = plt.errorbar(clients, T, yerr=T_STD, fmt=markers[i], ecolor='r', color=colors[i]) legends.append(p) legends_name.append("Worker threads # " + str(self.WORKERS_RANGE[i])) @@ -182,6 +183,8 @@ def plot_baseline_aggregate(self, filename1, filename2): # response time plt.figure(2) + #print(R) + print("WORKERS # {} MAX Response {}".format(self.WORKERS_RANGE[i], max(R))) p = plt.errorbar(clients, R, yerr=R_STD, fmt=markers[i], ecolor='r', color=colors[i]) legends.append(p) @@ -200,67 +203,19 @@ def plot_baseline_aggregate(self, filename1, filename2): plt.gcf().clear() - -# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_single_SET_MW/" -# plotter = ExperimentPlotter() -# plotter.INSIDE_MW = False -# plotter.set_params(3, path, 1, 2, 60, [1, 33, 4]) -# plotter.plot_baseline_aggregate("baselineClient_get_agr_T.png","baselineClient_get_agr_R.png") - -#path = "/home/ivan/asl-fall17-project/scripts/baselineMW/single/logfiles_baselineMW_single_GET_MW" -# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_single_SET_MW" -# plotter = ExperimentPlotter() -# plotter.INSIDE_MW = True -# plotter.set_params(3, path, 1, 2, [1, 33, 4]) -# plotter.plot_baseline_aggregate("baselineMW_set_agr_T.png","baselineMW_set_agr_R.png") -# -# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_single_SET_client" -# plotter = ExperimentPlotter() -# plotter.INSIDE_MW = False -# plotter.set_params(3, path, 1, 2, [1, 33, 4]) -# plotter.plot_baseline_aggregate("baselineMWClient_set_agr_T.png","baselineMWClient_set_agr_R.png") - -# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_single_GET_MW" -# plotter = ExperimentPlotter() -# plotter.INSIDE_MW = True -# plotter.set_params(3, path, 1, 2, [1, 33, 4]) -# plotter.plot_baseline_aggregate("baselineMW_get_agr_T.png","baselineMW_get_agr_R.png") - -# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_single_GET_client" -# plotter = ExperimentPlotter() -# plotter.INSIDE_MW = False -# plotter.set_params(3, path, 1, 2, [1, 33, 4]) -# plotter.plot_baseline_aggregate("baselineMWClient_get_agr_T.png","baselineMWClient_get_agr_R.png") - -# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_double_GET_MW" -# plotter = ExperimentPlotter() -# plotter.INSIDE_MW = True -# plotter.set_params(3, path, 2, 1, [1, 33, 4]) -# plotter.plot_baseline_aggregate("double_baselineMW_get_agr_T.png","double_baselineMW_get_agr_R.png") - -# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_double_GET_client" -# plotter = ExperimentPlotter() -# plotter.INSIDE_MW = False -# plotter.set_params(3, path, 2, 1, [1, 33, 4]) -# plotter.plot_baseline_aggregate("double_baselineMWClient_get_agr_T.png","double_baselineMWClient_get_agr_R.png") - - - - - # FINAL commands -# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_single_SET_client" +# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_single_GET_client" # plotter = ExperimentPlotter() # plotter.INSIDE_MW = False # plotter.set_params(3, path, 1, 2, 1, [1, 33, 4]) -# plotter.plot_baseline_aggregate("baselineMWClient_set_agr_T.png","baselineMWClient_set_agr_R.png") +# plotter.plot_baseline_aggregate("baselineMWClient_get_agr_T.png","baselineMWClient_get_agr_R.png") # -# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_single_SET_MW" +# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_single_GET_MW" # plotter = ExperimentPlotter() # plotter.INSIDE_MW = True # plotter.set_params(3, path, 1, 2, 1, [1, 33, 4]) -# plotter.plot_baseline_aggregate("baselineMW_set_agr_T.png","baselineMW_set_agr_R.png") +# plotter.plot_baseline_aggregate("baselineMW_get_agr_T.png","baselineMW_get_agr_R.png") # path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_double_GET_client" @@ -277,16 +232,16 @@ def plot_baseline_aggregate(self, filename1, filename2): # DOUBLE ADD -path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_double_GET_client_ADD" -plotter = ExperimentPlotter() -plotter.INSIDE_MW = False -plotter.set_params(3, path, 4, 1, 2, [1, 33, 4]) -plotter.WORKERS_RANGE=[64] -plotter.plot_baseline_aggregate("ADD_double_baselineMWClient_get_agr_T.png","ADD_double_baselineMWClient_get_agr_R.png") - -path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_double_GET_MW_ADD" -plotter = ExperimentPlotter() -plotter.INSIDE_MW = True -plotter.set_params(3, path, 4, 1, 2, [1, 33, 4]) -plotter.WORKERS_RANGE=[64] -plotter.plot_baseline_aggregate("ADD_double_baselineMW_get_agr_T.png","ADD_double_baselineMW_get_agr_R.png") \ No newline at end of file +# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_double_GET_client_ADD" +# plotter = ExperimentPlotter() +# plotter.INSIDE_MW = False +# plotter.set_params(3, path, 4, 1, 2, [1, 33, 4]) +# plotter.WORKERS_RANGE=[64] +# plotter.plot_baseline_aggregate("ADD_double_baselineMWClient_get_agr_T.png","ADD_double_baselineMWClient_get_agr_R.png") +# +# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_double_GET_MW_ADD" +# plotter = ExperimentPlotter() +# plotter.INSIDE_MW = True +# plotter.set_params(3, path, 4, 1, 2, [1, 33, 4]) +# plotter.WORKERS_RANGE=[64] +# plotter.plot_baseline_aggregate("ADD_double_baselineMW_get_agr_T.png","ADD_double_baselineMW_get_agr_R.png") \ No newline at end of file diff --git a/scripts/multiGets/6_keys_nonshard_MW.png b/scripts/multiGets/6_keys_nonshard_MW.png index dddf5b1..b8db9ee 100644 Binary files a/scripts/multiGets/6_keys_nonshard_MW.png and b/scripts/multiGets/6_keys_nonshard_MW.png differ diff --git a/scripts/multiGets/6_keys_nonshard_client.png b/scripts/multiGets/6_keys_nonshard_client.png index 941f528..85c7197 100644 Binary files a/scripts/multiGets/6_keys_nonshard_client.png and b/scripts/multiGets/6_keys_nonshard_client.png differ diff --git a/scripts/multiGets/6_keys_shard_MW.png b/scripts/multiGets/6_keys_shard_MW.png index cc503ae..fa99e18 100644 Binary files a/scripts/multiGets/6_keys_shard_MW.png and b/scripts/multiGets/6_keys_shard_MW.png differ diff --git a/scripts/multiGets/6_keys_shard_client.png b/scripts/multiGets/6_keys_shard_client.png index f0196eb..8fe40ca 100644 Binary files a/scripts/multiGets/6_keys_shard_client.png and b/scripts/multiGets/6_keys_shard_client.png differ diff --git a/scripts/multiGets/histograms.py b/scripts/multiGets/histograms.py index 7141092..73cdc42 100644 --- a/scripts/multiGets/histograms.py +++ b/scripts/multiGets/histograms.py @@ -26,6 +26,7 @@ def cdfToPdf(self, response_percentage, total_num): for i in range(1, len(pdf)): pdf[i] = (((response_percentage[i] - response_percentage[i - 1]) * total_num) / 100.0) * self.TIME + pdf[i] *= 10 # pdf[i] = (((response_number[i] * total_num) / 100) * self.TIME ) - pdf[i - 1] #print("PDF " + str(i) + " "+str(pdf[i])) return pdf @@ -199,7 +200,11 @@ def plot_histogram_client(self, filename): # print(len(OUT_TIMES)) # print(len(R_STD)) + # OUT_NUMBERS = [x / 10 for x in OUT_NUMBERS] + # R_STD = [x / 10 for x in R_STD] plt.bar(OUT_TIMES, OUT_NUMBERS, 0.1, yerr=R_STD, error_kw=dict(ecolor='red', lw=1, capsize=2, capthick=2)) + plt.ylabel('Number of requests') + plt.xlabel('Response time (msec)') plt.savefig(filename) plt.gcf().clear() print(max(OUT_NUMBERS)) @@ -259,26 +264,28 @@ def plot_histogram_MW(self, filename): # print(len(OUT_TIMES)) # print(len(R_STD)) - OUT_NUMBERS = [x / 10 for x in OUT_NUMBERS] - R_STD = [x / 10 for x in R_STD] + # OUT_NUMBERS = [x / 10 for x in OUT_NUMBERS] + # R_STD = [x / 10 for x in R_STD] # fig, ax = plt.subplots() # ax.bar(OUT_TIMES, OUT_NUMBERS, 0.1, yerr=R_STD, error_kw=dict(ecolor='red', lw=1, capsize=2, capthick=2)) # ax.set_yticks(OUT_NUMBERS) # plt.savefig(filename) plt.bar(OUT_TIMES, OUT_NUMBERS, 0.1, yerr=R_STD, error_kw=dict(ecolor='red', lw=1, capsize=2, capthick=2)) + plt.ylabel('Number of requests') + plt.xlabel('Response time (msec)') plt.savefig(filename) plt.gcf().clear() - print(max(OUT_TIMES)) + print(max(OUT_NUMBERS)) -path = "/home/ivan/asl-fall17-project/experiments/logfiles/multiGets/logfiles_multiGET_nonshard_Client" +path = "/home/ivan/asl-fall17-project/experiments/logfiles/multiGets/logfiles_multiGET_shard_Client" inside_MW = False h = Histogram(path, inside_MW) -h.plot_histogram_client("6_keys_nonshard_client.png") +h.plot_histogram_client("6_keys_shard_client.png") -path = "/home/ivan/asl-fall17-project/experiments/logfiles/multiGets/logfiles_multiGET_nonshard_MW" +path = "/home/ivan/asl-fall17-project/experiments/logfiles/multiGets/logfiles_multiGET_shard_MW" inside_MW = True h = Histogram(path, inside_MW) -h.plot_histogram_MW("6_keys_nonshard_MW.png") +h.plot_histogram_MW("6_keys_shard_MW.png") diff --git a/scripts/sysOverview/eq_load.png b/scripts/sysOverview/eq_load.png new file mode 100644 index 0000000..865574c Binary files /dev/null and b/scripts/sysOverview/eq_load.png differ diff --git a/scripts/sysOverview/eq_load_multi.png b/scripts/sysOverview/eq_load_multi.png new file mode 100644 index 0000000..551e671 Binary files /dev/null and b/scripts/sysOverview/eq_load_multi.png differ diff --git a/scripts/sysOverview/serverLoads.py b/scripts/sysOverview/serverLoads.py new file mode 100644 index 0000000..8bd250a --- /dev/null +++ b/scripts/sysOverview/serverLoads.py @@ -0,0 +1,35 @@ +import matplotlib.pyplot as plt + +fig, ax = plt.subplots() + +NUM_SERVERS = 3 +loads = [318085, 316155, 316358] +loads_multiget = [25023, 25023, 25022] +# rep2 = [319351, 317349, 316976] +# [294879, 293679, 295232] +# [292145, 291415, 291442] +# [291833, 288222, 289314] + +servers = list(range(1, NUM_SERVERS+1)) +print(servers) + +# ax.bar(servers, loads, alpha=0.5, color=['red', 'green', 'blue']) +# ax.set_xticks(servers) +# ax.set_xticklabels(['Server 1', 'Server 2', 'Server 3']) +# ax.margins(0.05) +# ax.set_ylabel('Number of requests') +# ax.set_xlabel('Servers') +# ax.set_title('Servers load round robin scheduling') +# +# plt.savefig("eq_load.png") + + +ax.bar(servers, loads_multiget, alpha=0.5, color=['red', 'green', 'blue']) +ax.set_xticks(servers) +ax.set_xticklabels(['Server 1', 'Server 2', 'Server 3']) +ax.margins(0.05) +ax.set_ylabel('Number of requests') +ax.set_xlabel('Servers') +ax.set_title('Servers load round robin scheduling') + +plt.savefig("eq_load_multi.png") \ No newline at end of file diff --git a/src/ch/ethz/asl/main/ShutDownHook.java b/src/ch/ethz/asl/main/ShutDownHook.java index 06949b1..86aac0b 100644 --- a/src/ch/ethz/asl/main/ShutDownHook.java +++ b/src/ch/ethz/asl/main/ShutDownHook.java @@ -135,6 +135,8 @@ public void run() { ArrayList finalResponseTimes = new ArrayList<>(); //ArrayList cacheMisses = new ArrayList<>(); + + //ArrayList> serverLoads = new ArrayList>(MiddlewareMain.serversNum); workersPool.forEach(worker -> { List responseTimes = worker.getStatistics().getResponseTimesList(); @@ -148,8 +150,27 @@ public void run() { //Histogram h = new Histogram(responseTimes); //h.printHistogram(); responseTimes.forEach(x -> finalResponseTimes.add(x)); + + }); + + int[] serverLoads = new int[MiddlewareMain.serversNum]; + for (int i = 0; i < workersPool.size(); i++) { + //serverLoads[i] = 0; + HashMap histo = workersPool.get(i).getStatistics().getEqualLoadHistogram(); + for (int j = 0; j < MiddlewareMain.serversNum; j++) { + System.out.println("Worker # "+ workersPool.get(i).getId() + " server # " + i + " load = "+ histo.get(j)); + serverLoads[j] += histo.get(j); + //serverLoads.get(0).add(histo.get(i)); + } + } + + System.out.println(Arrays.toString(serverLoads)); + + //serverLoads.forEach(serverLoad -> System.out.println(serverLoad.stream().mapToInt(x -> x).average()) ); + + System.out.println("\n"); System.out.println("FINAL STATS"); int T = finalT.stream().mapToInt(x -> x).sum(); double R = finalResponseTimes.stream().mapToLong(x -> x).average().getAsDouble() / 1000000; diff --git a/src/ch/ethz/asl/main/Statistics.java b/src/ch/ethz/asl/main/Statistics.java index 849dc3c..10afb99 100644 --- a/src/ch/ethz/asl/main/Statistics.java +++ b/src/ch/ethz/asl/main/Statistics.java @@ -1,6 +1,7 @@ package ch.ethz.asl.main; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; // Statistics object for instrumentation @@ -27,6 +28,8 @@ public class Statistics { private long latency; private int cacheMissCount; + // server number of requests send to server + private HashMap equalLoadHistogram; public Statistics(String name, int throughput, int queueLength, long queueWaitTime, long serviceTime, int SETCount, int GETCount, int MULTIGETCount, long latency) { this.workerName = name; @@ -39,6 +42,7 @@ public Statistics(String name, int throughput, int queueLength, long queueWaitTi this.MULTIGETCount = MULTIGETCount; this.latency = latency; this.cacheMissCount = 0; + this.equalLoadHistogram = new HashMap<>(); } public Statistics(String name, int throughput, int queueLength, long queueWaitTime, long serviceTime, int SETCount, int GETCount, int MULTIGETCount, List times) { @@ -52,6 +56,7 @@ public Statistics(String name, int throughput, int queueLength, long queueWaitTi this.MULTIGETCount = MULTIGETCount; this.responseTimesList = times; this.cacheMissCount = 0; + this.equalLoadHistogram = new HashMap<>(); } public Statistics() { @@ -66,8 +71,18 @@ public Statistics() { latency = 0; responseTimesList = new ArrayList<>(); cacheMissCount = 0; + this.equalLoadHistogram = new HashMap<>(); } + public HashMap getEqualLoadHistogram() { + return equalLoadHistogram; + } + + public void setEqualLoadHistogram(HashMap equalLoadHistogram) { + this.equalLoadHistogram = equalLoadHistogram; + } + + public int getCacheMissCount() { return cacheMissCount; } diff --git a/src/ch/ethz/asl/main/Worker.java b/src/ch/ethz/asl/main/Worker.java index 612eae9..841cfaf 100644 --- a/src/ch/ethz/asl/main/Worker.java +++ b/src/ch/ethz/asl/main/Worker.java @@ -93,6 +93,10 @@ public Worker(LinkedBlockingQueue reqQueue, CycleCounter counter, List< } + for (int i = 0; i < serversNumber; i++) { + statistics.getEqualLoadHistogram().put(i, 0); + } + } private void openServerConnections() throws IOException { @@ -137,6 +141,9 @@ private int writeOne(Request request) { roundRobinCounter.increment(); responsesLeft++; + + statistics.getEqualLoadHistogram().put(serverIdx, statistics.getEqualLoadHistogram().get(serverIdx) + 1); + return serverIdx; }