-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiget percentiles aggreagated plot
Signed-off-by: tivan <[email protected]>
- Loading branch information
1 parent
675d133
commit 1ba2985
Showing
31 changed files
with
816 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import matplotlib.pyplot as plt | ||
|
||
# Pie chart, where the slices will be ordered and plotted counter-clockwise: | ||
labels = 'Servers', 'Middlewares', 'Worker threads', 'Servers & Middlewares', 'Servers & Worker threads', 'Middlewares & Worker threads', 'Servers & Middlewares & Worker threads' | ||
sizes_SET_T = [4.82, 33.93, 55.39, 0.22, 0.44, 4.7, 0.01] | ||
sizes_SET_R = [5.65, 32.17, 55.32, 0.72, 1.11, 4.43, 0.12] | ||
|
||
sizes_GET_T = [0.74, 38.25, 56.25, 0.00, 0.14, 3.28, 0.13] | ||
sizes_GET_R = [2.11, 36.30, 55.90, 0.13, 0.64, 4.13, 0.19] | ||
|
||
|
||
sizes_MIX_T = [3.62, 33.57, 46.62, 1.32, 0.88, 2.84, 0.45] | ||
sizes_MIX_R = [0.92, 38.23, 55.90, 0.05, 0.49, 2.83, 0.11] | ||
|
||
|
||
|
||
explode = (0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1) # only "explode" the 2nd slice (i.e. 'Hogs') | ||
|
||
fig1, ax1 = plt.subplots() | ||
patches, texts = plt.pie(sizes_SET_T, explode=explode, labels=labels, autopct='%1.1f%%',shadow=True, startangle=90) | ||
plt.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle. | ||
|
||
plt.legend(patches, labels, loc="lower left") | ||
plt.tight_layout() | ||
plt.savefig("pie_SET_T.png") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,255 @@ | ||
import re | ||
import sys | ||
from operator import add | ||
from matplotlib import pyplot as plt | ||
from statistics import stdev | ||
|
||
class ExperimentPlotter: | ||
|
||
REP_NUMBER = 3 | ||
LOGFILES_PATH = "" | ||
MACHINES_NUMBER = 3 | ||
THREAD_PER_CLIENT = 2 | ||
|
||
# CHANGE | ||
RUN_TIME = 60 | ||
# See the same in bash script | ||
# clients=`seq 1 4 33` | ||
CLIENTS_RANGE_BEG = 1 | ||
CLIENTS_RANGE_END = 33 | ||
CLIENTS_RANGE_STEP = 4 | ||
|
||
MW_NUMBER = 2 | ||
WORKERS_RANGE = [8, 16, 32, 64] | ||
|
||
INSIDE_MW = True | ||
|
||
def __init__(self, rep=3, path="", machines_num=3, threads_num=2, mw_num=2, range_clients=[1,33,4]): | ||
self.REP_NUMBER = rep | ||
self.LOGFILES_PATH = path | ||
self.MACHINES_NUMBER = machines_num | ||
self.THREAD_PER_CLIENT = threads_num | ||
self.CLIENTS_RANGE_BEG = range_clients[0] | ||
self.CLIENTS_RANGE_END = range_clients[1] | ||
self.CLIENTS_RANGE_STEP = range_clients[2] | ||
self.MW_NUMBER = mw_num | ||
|
||
def set_params(self, rep, path, machines_num, threads_num, mw_num, range_clients): | ||
self.REP_NUMBER = rep | ||
self.LOGFILES_PATH = path | ||
self.MACHINES_NUMBER = machines_num | ||
self.THREAD_PER_CLIENT = threads_num | ||
self.CLIENTS_RANGE_BEG = range_clients[0] | ||
self.CLIENTS_RANGE_END = range_clients[1] | ||
self.CLIENTS_RANGE_STEP = range_clients[2] | ||
self.MW_NUMBER = mw_num | ||
|
||
def extractParamsMW(self, logfile): | ||
file = open(logfile, 'r') | ||
for line in file: | ||
if line.startswith("FINAL STATS"): | ||
for line in file: | ||
if line.startswith("Average queue length"): | ||
queue_len = line.split()[4] | ||
if line.startswith("Average service time"): | ||
serve_time = line.split()[5] | ||
#print(avg_response_time) | ||
|
||
file.close() | ||
|
||
#print(logfile) | ||
return float(queue_len), float(serve_time) | ||
|
||
def extractParams(self, logfile): | ||
file = open(logfile, 'r') | ||
for line in file: | ||
if line.startswith("Totals"): | ||
avg_throughput = line.split()[1] | ||
avg_response_time = line.split()[4] | ||
|
||
file.close() | ||
|
||
#print(logfile) | ||
return float(avg_throughput), float(avg_response_time) | ||
|
||
def plot_baseline_aggregate(self, filename1, filename2): | ||
|
||
T_workers = [] | ||
R_workers = [] | ||
T_STD_workers = [] | ||
R_STD_workers = [] | ||
|
||
if self.INSIDE_MW: | ||
MACHINES_RANGE = self.MW_NUMBER | ||
print("Plotting on the MW") | ||
else: | ||
MACHINES_RANGE = self.MACHINES_NUMBER | ||
print("Plotting on the Clients") | ||
|
||
for worker in self.WORKERS_RANGE: | ||
# Build | ||
T_total = [] | ||
R_total = [] | ||
T_STD = [] | ||
R_STD = [] | ||
|
||
for virtual_client in range(self.CLIENTS_RANGE_BEG, self.CLIENTS_RANGE_END + 1, self.CLIENTS_RANGE_STEP): | ||
final_throughput = 0 | ||
final_response_time = 0 | ||
aggregate_throughput_vals = [] | ||
avg_response_time_vals = [] | ||
|
||
for repetition in range(1, self.REP_NUMBER + 1): | ||
aggregate_throughput = 0 | ||
avg_response_time = 0 | ||
|
||
for machine in range(1, MACHINES_RANGE + 1): | ||
logfile_name = self.LOGFILES_PATH + "/" + str(worker) + "/baselineMW_{}_{}_{}.log".format(virtual_client, repetition, machine) | ||
#print(logfile_name) | ||
|
||
if self.INSIDE_MW: | ||
throughput, response = self.extractParamsMW(logfile_name) | ||
else: | ||
throughput, response = self.extractParams(logfile_name) | ||
|
||
# Agregates | ||
# SUM thriuputs | ||
aggregate_throughput += throughput | ||
# AVG response times | ||
avg_response_time += response | ||
|
||
avg_response_time /= MACHINES_RANGE | ||
# at this point we have aggregates from all machines | ||
final_throughput += aggregate_throughput | ||
final_response_time += avg_response_time | ||
|
||
aggregate_throughput_vals.append(aggregate_throughput) | ||
avg_response_time_vals.append(avg_response_time) | ||
|
||
final_throughput /= self.REP_NUMBER | ||
final_response_time /= self.REP_NUMBER | ||
|
||
T_total.append(final_throughput) | ||
R_total.append(final_response_time) | ||
T_STD.append(stdev(aggregate_throughput_vals)) | ||
R_STD.append(stdev(avg_response_time_vals)) | ||
|
||
# PLOTTING | ||
|
||
T_workers.append(T_total) | ||
R_workers.append(R_total) | ||
T_STD_workers.append(T_STD) | ||
R_STD_workers.append(R_STD) | ||
|
||
|
||
colors = ['b', 'm', 'y', 'g'] | ||
markers = ['-x', '-^', '-o', '-d'] | ||
legends = [] | ||
legends_name = [] | ||
for i in range(len(self.WORKERS_RANGE)): | ||
T = T_workers[i] | ||
T_STD = T_STD_workers[i] | ||
|
||
clients = [x * self.THREAD_PER_CLIENT * self.MACHINES_NUMBER for x in range(self.CLIENTS_RANGE_BEG, self.CLIENTS_RANGE_END + 1, self.CLIENTS_RANGE_STEP)] | ||
ticks = [x * self.THREAD_PER_CLIENT * self.MACHINES_NUMBER for x in range(self.CLIENTS_RANGE_BEG, self.CLIENTS_RANGE_END + 1, self.CLIENTS_RANGE_STEP)] | ||
|
||
# throughput | ||
print(T) | ||
plt.figure(1) | ||
print("WORKERS # {} MAX Throuthput {}".format(self.WORKERS_RANGE[i], max(T))) | ||
print("") | ||
|
||
#plt.title("Throughput graph") | ||
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])) | ||
|
||
|
||
plt.xticks(ticks) | ||
plt.ylim(ymin=0) | ||
plt.ylim(ymin=0) | ||
plt.xlim(xmin=0) | ||
plt.grid() | ||
plt.xlabel('NumClients') | ||
plt.ylabel('Number of jobs') | ||
#plt.show() | ||
plt.legend(legends, legends_name) | ||
plt.savefig(filename1) | ||
plt.gcf().clear() | ||
|
||
legends = [] | ||
legends_name = [] | ||
for i in range(len(self.WORKERS_RANGE)): | ||
R = R_workers[i] | ||
R_STD = R_STD_workers[i] | ||
|
||
|
||
# response time | ||
plt.figure(2) | ||
print(R) | ||
print("WORKERS # {} MAX Response {}".format(self.WORKERS_RANGE[i], max(R))) | ||
print("") | ||
|
||
p = plt.errorbar(clients, R, yerr=R_STD, fmt=markers[i], ecolor='r', color=colors[i]) | ||
legends.append(p) | ||
legends_name.append("Worker threads # " + str(self.WORKERS_RANGE[i])) | ||
|
||
|
||
plt.xticks(ticks) | ||
plt.ylim(ymin=0) | ||
plt.xlim(xmin=0) | ||
plt.grid() | ||
plt.xlabel('NumClients') | ||
plt.ylabel('Service time (msec)') | ||
#plt.show() | ||
plt.legend(legends, legends_name) | ||
plt.savefig(filename2) | ||
plt.gcf().clear() | ||
|
||
|
||
# FINAL commands | ||
|
||
# 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, [1, 33, 4]) | ||
# plotter.plot_baseline_aggregate("queueLen_baselineMWClient_set_agr.png","serveTime_baselineMWClient_set_agr.png") | ||
|
||
|
||
path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/logfiles_baselineMW_double_SET_MW" | ||
plotter = ExperimentPlotter() | ||
plotter.INSIDE_MW = True | ||
plotter.set_params(3, path, 2, 1, 2, [1, 33, 4]) | ||
plotter.plot_baseline_aggregate("queueLen_double_baselineMW_set_agr.png","serveTime_double_baselineMW_set_agr.png") | ||
|
||
# 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") | ||
|
||
# REDO GET DOUBLE | ||
# | ||
# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/redoGET/logfiles_baselineMW_double_GET_client" | ||
# plotter = ExperimentPlotter() | ||
# plotter.INSIDE_MW = False | ||
# plotter.WORKERS_RANGE = [64] | ||
# plotter.set_params(3, path, 2, 1, 2, [1, 33, 4]) | ||
# plotter.plot_baseline_aggregate("redo_double_baselineMWClient_get_agr_T.png","redo_double_baselineMWClient_get_agr_R.png") | ||
# | ||
# path = "/home/ivan/asl-fall17-project/experiments/logfiles/baselineMiddleware/redoGET/logfiles_baselineMW_double_GET_MW" | ||
# plotter = ExperimentPlotter() | ||
# plotter.INSIDE_MW = True | ||
# plotter.WORKERS_RANGE = [64] | ||
# plotter.set_params(3, path, 2, 1, 2, [1, 33, 4]) | ||
# plotter.plot_baseline_aggregate("redo_double_baselineMW_get_agr_T.png","redo_double_baselineMW_get_agr_R.png") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.