コード例 #1
0
# Logs
Bins = [1, 2, 4, 5, 10, 20]
x_pts = [1, 3, 7, 9, 19, 39]
t_list = []
timefile  = './data/input/MGDS1_time.csv'



if (True == NEWMEASURE):
	# Step 1. Get exe_dist
	#=============== Analytical: M/G(DS)/1 ===============
	for N_exe in Bins:

		t_start = datetime.datetime.now()
		N_arr = 20
		exe_dist = get_dist_from_exec(execute_dur, N_exe, N_arr)
		(x_bg, y_bg) = get_MGDS1_from_BGDS1(arrival_rate, exe_dist, budget, period, N_arr)
		t_end  = datetime.datetime.now()
		t_delta = t_end - t_start

		
		t_list.append(t_delta.total_seconds())

	write_arrival_data(timefile, t_list)	
else:
	t_list = read_arrival_data(timefile)

print t_list


コード例 #2
0
x_lim = 20.0
y_lim = 1.0
xy_lim = (x_lim, y_lim)

#================= M/D(DS)/1 Theoretical ==================
(x_bd, y_bd) = get_MDDS1_from_BDDS1(arrival_rate, 1.0, budget, period, N)
#
x_bd = x_bd[0:int(x_lim * N)]
y_bd = y_bd[0:int(x_lim * N)]

#================= M/G(DS)/1 Theoretical ==================

execution_file = './data/res/redis_sort_calib.csv'
execution_time = read_arrival_data(execution_file)

exe_dist = get_dist_from_exec(execution_time, N)
(x_bd2, y_bd2) = get_MGDS1_from_BGDS1(arrival_rate, exe_dist, budget, period,
                                      N)
x_bd2 = x_bd2[0:int(x_lim * N)]
y_bd2 = y_bd2[0:int(x_lim * N)]

#================= M/D(DS)/1 Empirical ==================
ecdf_samples = 10000
x_axis = np.linspace(0, x_lim, ecdf_samples)
scale = 10.0

resultfile = './data/res/' + runfile + '.csv'
response_time = read_arrival_data(resultfile)
response_time = np.array(response_time)
response_time = response_time / scale
ecdf2 = sm.distributions.ECDF(response_time)