|
|
@ -28,7 +28,7 @@ def file_name(file_dir, key_str):
|
|
|
|
|
|
|
|
|
|
|
|
return file_table
|
|
|
|
return file_table
|
|
|
|
|
|
|
|
|
|
|
|
def get_values(key, value, miss_deadline_rate, total_latency, preemption_count):
|
|
|
|
def get_values(key, value, miss_deadline_rate, total_latency, preemption_count, total_miss_deadline_rate):
|
|
|
|
for i in range(len(value)):
|
|
|
|
for i in range(len(value)):
|
|
|
|
file_name = value[i]
|
|
|
|
file_name = value[i]
|
|
|
|
cmd='python3 ~/sledge-serverless-framework/runtime/tests/meet_deadline_percentage.py %s 50' % file_name
|
|
|
|
cmd='python3 ~/sledge-serverless-framework/runtime/tests/meet_deadline_percentage.py %s 50' % file_name
|
|
|
@ -36,26 +36,34 @@ def get_values(key, value, miss_deadline_rate, total_latency, preemption_count):
|
|
|
|
#print(rt)
|
|
|
|
#print(rt)
|
|
|
|
rule=r'(.*?) miss deadline rate:(.*?) miss count is'
|
|
|
|
rule=r'(.*?) miss deadline rate:(.*?) miss count is'
|
|
|
|
finds=re.findall(rule, rt)
|
|
|
|
finds=re.findall(rule, rt)
|
|
|
|
func_name=finds[0][0]
|
|
|
|
finds_size=len(finds)
|
|
|
|
miss_rate=finds[0][1]
|
|
|
|
for j in range(finds_size):
|
|
|
|
#print(func_name, miss_rate)
|
|
|
|
func_name=finds[j][0]
|
|
|
|
key1=key+"_"+func_name
|
|
|
|
miss_rate=finds[j][1]
|
|
|
|
percentage=file_name.split('_')[-1].split('.')[0]
|
|
|
|
key1=key+"_"+func_name
|
|
|
|
print(key1, percentage, miss_rate)
|
|
|
|
percentage=file_name.split('_')[-1].split('.')[0]
|
|
|
|
miss_deadline_rate[key1][percentage]=round(float(miss_rate), 2)
|
|
|
|
print("miss rate:", key1, percentage, miss_rate)
|
|
|
|
|
|
|
|
miss_deadline_rate[key1][percentage]=round(float(miss_rate), 2)
|
|
|
|
|
|
|
|
|
|
|
|
rule2=r'function times: (.*)'
|
|
|
|
rule2=r'function times: (.*)'
|
|
|
|
finds=re.findall(rule2, rt)
|
|
|
|
finds=re.findall(rule2, rt)
|
|
|
|
func_name=finds[0].split(" ")[0]
|
|
|
|
for j in range(len(finds)):
|
|
|
|
latency=finds[0].split(" ")[1]
|
|
|
|
func_name=finds[j].split(" ")[0]
|
|
|
|
print(func_name, latency)
|
|
|
|
latency=finds[j].split(" ")[1]
|
|
|
|
total_latency[key1][percentage]=latency
|
|
|
|
key1=key+"_"+func_name
|
|
|
|
|
|
|
|
print("total latency:", func_name, latency)
|
|
|
|
|
|
|
|
total_latency[key1][percentage]=latency
|
|
|
|
|
|
|
|
|
|
|
|
rule3=r'scheduling counter: (.*)'
|
|
|
|
rule3=r'scheduling counter: (.*)'
|
|
|
|
finds=re.findall(rule3, rt)
|
|
|
|
finds=re.findall(rule3, rt)
|
|
|
|
schedule_count=finds[0].strip()
|
|
|
|
schedule_count=finds[0].strip()
|
|
|
|
preemption_count[key1][percentage]=schedule_count
|
|
|
|
preemption_count[key][percentage]=schedule_count
|
|
|
|
print("finds preemption count is ", schedule_count)
|
|
|
|
#print("finds preemption count is ", schedule_count)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule4=r'miss deadline percentage: (.*)'
|
|
|
|
|
|
|
|
finds=re.findall(rule4, rt)
|
|
|
|
|
|
|
|
total_miss_rate=finds[0].strip()
|
|
|
|
|
|
|
|
total_miss_deadline_rate[key][percentage]=total_miss_rate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
if __name__ == "__main__":
|
|
|
@ -63,6 +71,7 @@ if __name__ == "__main__":
|
|
|
|
miss_deadline_rate = defaultdict(defaultdict)
|
|
|
|
miss_deadline_rate = defaultdict(defaultdict)
|
|
|
|
total_latency = defaultdict(defaultdict)
|
|
|
|
total_latency = defaultdict(defaultdict)
|
|
|
|
preemption_count = defaultdict(defaultdict)
|
|
|
|
preemption_count = defaultdict(defaultdict)
|
|
|
|
|
|
|
|
total_miss_deadline_rate = defaultdict(defaultdict)
|
|
|
|
|
|
|
|
|
|
|
|
argv = sys.argv[1:]
|
|
|
|
argv = sys.argv[1:]
|
|
|
|
if len(argv) < 1:
|
|
|
|
if len(argv) < 1:
|
|
|
@ -75,16 +84,16 @@ if __name__ == "__main__":
|
|
|
|
i = 0
|
|
|
|
i = 0
|
|
|
|
|
|
|
|
|
|
|
|
for key, value in files_tables.items():
|
|
|
|
for key, value in files_tables.items():
|
|
|
|
get_values(key, value, miss_deadline_rate, total_latency, preemption_count)
|
|
|
|
get_values(key, value, miss_deadline_rate, total_latency, preemption_count, total_miss_deadline_rate)
|
|
|
|
|
|
|
|
|
|
|
|
for key, value in miss_deadline_rate.items():
|
|
|
|
for key, value in miss_deadline_rate.items():
|
|
|
|
print(key, value)
|
|
|
|
print("miss deadline rate:", key, value)
|
|
|
|
|
|
|
|
|
|
|
|
for key, value in total_latency.items():
|
|
|
|
for key, value in total_latency.items():
|
|
|
|
print(key, value)
|
|
|
|
print("total latency:", key, value)
|
|
|
|
|
|
|
|
|
|
|
|
for key, value in preemption_count.items():
|
|
|
|
for key, value in preemption_count.items():
|
|
|
|
print(key, value)
|
|
|
|
print("preemption:", key, value)
|
|
|
|
|
|
|
|
|
|
|
|
js = json.dumps(miss_deadline_rate)
|
|
|
|
js = json.dumps(miss_deadline_rate)
|
|
|
|
f= open("miss_deadline_rate.txt", 'w')
|
|
|
|
f= open("miss_deadline_rate.txt", 'w')
|
|
|
@ -103,3 +112,8 @@ if __name__ == "__main__":
|
|
|
|
f3.write(js3)
|
|
|
|
f3.write(js3)
|
|
|
|
f3.close()
|
|
|
|
f3.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js4 = json.dumps(total_miss_deadline_rate)
|
|
|
|
|
|
|
|
f4= open("total_miss_deadline_rate.txt", 'w')
|
|
|
|
|
|
|
|
f4.write(js4)
|
|
|
|
|
|
|
|
f4.close()
|
|
|
|
|
|
|
|
|
|
|
|