Commit 8bc678a2 authored by Thomas Schöpping's avatar Thomas Schöpping
Browse files

uRT-Benchmark: evaluation script enhanced

parent ca8ed7a2
......@@ -497,10 +497,10 @@ for line in infile:
latencies = np.array(values[3], dtype=np.int32)
elif len(line.strip()) == 0:
evals[publishers][publisher] = {'min': np.amin(latencies),
'max': np.amax(latencies),
'mean': np.mean(latencies),
'median': np.median(latencies),
'jitter': np.amax(latencies) - np.amin(latencies)}
'max': np.amax(latencies),
'mean': np.mean(latencies),
'median': np.median(latencies),
'jitter': np.amax(latencies) - np.amin(latencies)}
header = "publishers\tpublisher\tmin\tmax\tmean\tmedian\tjitter\n"
for publishers, publisher_evals in evals.items():
outfile = open(os.path.join(outpath, outfiles_bases['pubsubpublisher'] + "_" + str(publishers).zfill(4) + outfiles_ext), 'w')
......@@ -773,10 +773,10 @@ for line in infile:
latencies = np.array(values[2], dtype=np.int32)
elif re.match(r'\d+ deadline violations', line) or len(line.strip()) == 0:
evals[step] = {'min': np.amin(latencies),
'max': np.amax(latencies),
'mean': np.mean(latencies),
'median': np.median(latencies),
'jitter': np.amax(latencies) - np.amin(latencies)}
'max': np.amax(latencies),
'mean': np.mean(latencies),
'median': np.median(latencies),
'jitter': np.amax(latencies) - np.amin(latencies)}
header = "critical\tstep\tmin\tmax\tmean\tmedian\tjitter\n"
outfile = open(os.path.join(outpath, outfiles_bases['pubsubrate'] + outfiles_ext), 'w')
outfile.write(header)
......@@ -848,6 +848,7 @@ for line in infile:
dispatches = np.empty(shape=0, dtype=np.int32)
retrievals = np.empty(shape=0, dtype=np.int32)
evals = {requests: {request: {}}}
evals_wof = {requests: {request: {}}} # without first element
elif re.match(r'\s*\d+\s+\d+\s+\d+\s+\d+\s+\d+', line):
values = np.array(re.findall(r'\d+', line), dtype=np.int32)
if values[0] == requests and values[1] == request:
......@@ -864,8 +865,19 @@ for line in infile:
'mean': np.mean(retrievals),
'median': np.median(retrievals),
'jitter': np.amax(retrievals) - np.amin(retrievals)}}
evals_wof[requests][request] = {'dispatch': {'min': np.amin(dispatches[1:]),
'max': np.amax(dispatches[1:]),
'mean': np.mean(dispatches[1:]),
'median': np.median(dispatches[1:]),
'jitter': np.amax(dispatches[1:]) - np.amin(dispatches[1:])},
'retrieve': {'min': np.amin(retrievals[1:]),
'max': np.amax(retrievals[1:]),
'mean': np.mean(retrievals[1:]),
'median': np.median(retrievals[1:]),
'jitter': np.amax(retrievals[1:]) - np.amin(retrievals[1:])}}
if values[0] != requests:
evals[values[0]] = {values[1]: {}}
evals_wof[values[0]] = {values[1] : {}}
requests = values[0]
request = values[1]
dispatches = np.array(values[3], dtype=np.int32)
......@@ -881,7 +893,18 @@ for line in infile:
'mean': np.mean(retrievals),
'median': np.median(retrievals),
'jitter': np.amax(retrievals) - np.amin(retrievals)}}
evals_wof[requests][request] = {'dispatch': {'min': np.amin(dispatches[1:]),
'max': np.amax(dispatches[1:]),
'mean': np.mean(dispatches[1:]),
'median': np.median(dispatches[1:]),
'jitter': np.amax(dispatches[1:]) - np.amin(dispatches[1:])},
'retrieve': {'min': np.amin(retrievals[1:]),
'max': np.amax(retrievals[1:]),
'mean': np.mean(retrievals[1:]),
'median': np.median(retrievals[1:]),
'jitter': np.amax(retrievals[1:]) - np.amin(retrievals[1:])}}
header = "requests\trequest\tdispatch:min\tdispatch:max\tdispatch:mean\tdispatch:median\tdispatch:jitter\tretrieve:min\tretrieve:max\tretrieve:mean\tretrieve:median\tretrieve:jitter\n"
# print full data to files
for requests, request_evals in evals.items():
if state == 'urtrpcrequestnrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequestnrt'] + "_" + str(requests).zfill(4) + outfiles_ext), 'w')
......@@ -901,7 +924,14 @@ for line in infile:
str(values['retrieve']['mean']) + "\t" + str(values['retrieve']['median']) + "\t" +
str(values['retrieve']['jitter']) + "\n")
outfile.close()
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequestnrt'] + outfiles_ext), 'w')
if state == 'urtrpcrequestnrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequestnrt'] + outfiles_ext), 'w')
elif state == 'urtrpcrequestsrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequestsrt'] + outfiles_ext), 'w')
elif state == 'urtrpcrequestfrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequestfrt'] + outfiles_ext), 'w')
elif state == 'urtrpcrequesthrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequesthrt'] + outfiles_ext), 'w')
outfile.write(header)
for requests, request_evals in evals.items():
worst = 0
......@@ -919,6 +949,51 @@ for line in infile:
str(values['retrieve']['mean']) + "\t" + str(values['retrieve']['median']) + "\t" +
str(values['retrieve']['jitter']) + "\n")
outfile.close()
# print wof data to files
for requests, request_evals_wof in evals_wof.items():
if state == 'urtrpcrequestnrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequestnrt'] + "_" + str(requests).zfill(4) + "_wof" + outfiles_ext), 'w')
elif state == 'urtrpcrequestsrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequestsrt'] + "_" + str(requests).zfill(4) + "_wof" + outfiles_ext), 'w')
elif state == 'urtrpcrequestfrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequestfrt'] + "_" + str(requests).zfill(4) + "_wof" + outfiles_ext), 'w')
elif state == 'urtrpcrequesthrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequesthrt'] + "_" + str(requests).zfill(4) + "_wof" + outfiles_ext), 'w')
outfile.write(header)
for request, values in request_evals_wof.items():
outfile.write(str(requests) + "\t" + str(request) + "\t"+
str(values['dispatch']['min']) + "\t" + str(values['dispatch']['max']) + "\t" +
str(values['dispatch']['mean']) + "\t" + str(values['dispatch']['median']) + "\t" +
str(values['dispatch']['jitter']) + "\t" +
str(values['retrieve']['min']) + "\t" + str(values['retrieve']['max']) + "\t" +
str(values['retrieve']['mean']) + "\t" + str(values['retrieve']['median']) + "\t" +
str(values['retrieve']['jitter']) + "\n")
outfile.close()
if state == 'urtrpcrequestnrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequestnrt'] + "_wof" + outfiles_ext), 'w')
elif state == 'urtrpcrequestsrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequestsrt'] + "_wof" + outfiles_ext), 'w')
elif state == 'urtrpcrequestfrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequestfrt'] + "_wof" + outfiles_ext), 'w')
elif state == 'urtrpcrequesthrt':
outfile = open(os.path.join(outpath, outfiles_bases['rpcrequesthrt'] + "_wof" + outfiles_ext), 'w')
outfile.write(header)
for requests, request_evals_wof in evals_wof.items():
worst = 0
worstval = 0
for request, values in request_evals_wof.items():
if values['retrieve']['mean'] > worstval:
worst = request
values['retrieve']['mean']
values = request_evals_wof[worst]
outfile.write(str(requests) + "\t" + str(request) + "\t"+
str(values['dispatch']['min']) + "\t" + str(values['dispatch']['max']) + "\t" +
str(values['dispatch']['mean']) + "\t" + str(values['dispatch']['median']) + "\t" +
str(values['dispatch']['jitter']) + "\t" +
str(values['retrieve']['min']) + "\t" + str(values['retrieve']['max']) + "\t" +
str(values['retrieve']['mean']) + "\t" + str(values['retrieve']['median']) + "\t" +
str(values['retrieve']['jitter']) + "\n")
outfile.close()
print("done")
state = 'searchrpc'
......@@ -930,6 +1005,7 @@ for line in infile:
dispatches = np.empty(shape=0, dtype=np.int32)
retrievals = np.empty(shape=0, dtype=np.int32)
evals = {services: {service: {}}}
evals_wof = {services: {service: {}}} # without first element
elif re.match(r'\s*\d+\s+\d+\s+\d+\s+\d+\s+\d+', line):
values = np.array(re.findall(r'\d+', line), dtype=np.int32)
if values[0] == services and values[1] == service:
......@@ -946,8 +1022,19 @@ for line in infile:
'mean': np.mean(retrievals),
'median': np.median(retrievals),
'jitter': np.amax(retrievals) - np.amin(retrievals)}}
evals_wof[services][service] = {'dispatch': {'min': np.amin(dispatches[1:]),
'max': np.amax(dispatches[1:]),
'mean': np.mean(dispatches[1:]),
'median': np.median(dispatches[1:]),
'jitter': np.amax(dispatches[1:]) - np.amin(dispatches[1:])},
'retrieve': {'min': np.amin(retrievals[1:]),
'max': np.amax(retrievals[1:]),
'mean': np.mean(retrievals[1:]),
'median': np.median(retrievals[1:]),
'jitter': np.amax(retrievals[1:]) - np.amin(retrievals[1:])}}
if values[0] != services:
evals[values[0]] = {values[1]: {}}
evals_wof[values[0]] = {values[1]: {}}
services = values[0]
service = values[1]
dispatches = np.array(values[3], dtype=np.int32)
......@@ -963,7 +1050,18 @@ for line in infile:
'mean': np.mean(retrievals),
'median': np.median(retrievals),
'jitter': np.amax(retrievals) - np.amin(retrievals)}}
evals_wof[services][service] = {'dispatch': {'min': np.amin(dispatches[1:]),
'max': np.amax(dispatches[1:]),
'mean': np.mean(dispatches[1:]),
'median': np.median(dispatches[1:]),
'jitter': np.amax(dispatches[1:]) - np.amin(dispatches[1:])},
'retrieve': {'min': np.amin(retrievals[1:]),
'max': np.amax(retrievals[1:]),
'mean': np.mean(retrievals[1:]),
'median': np.median(retrievals[1:]),
'jitter': np.amax(retrievals[1:]) - np.amin(retrievals[1:])}}
header = "services\tservice\tdispatch:min\tdispatch:max\tdispatch:mean\tdispatch:median\tdispatch:jitter\tretrieve:min\tretrieve:max\tretrieve:mean\tretrieve:median\tretrieve:jitter\n"
# print full data to files
for services, service_evals in evals.items():
outfile = open(os.path.join(outpath, outfiles_bases['rpcservice'] + "_" + str(services).zfill(4) + outfiles_ext), 'w')
outfile.write(header)
......@@ -994,6 +1092,37 @@ for line in infile:
str(values['retrieve']['mean']) + "\t" + str(values['retrieve']['median']) + "\t" +
str(values['retrieve']['jitter']) + "\n")
outfile.close()
# print wof data to files
for services, service_evals_wof in evals_wof.items():
outfile = open(os.path.join(outpath, outfiles_bases['rpcservice'] + "_" + str(services).zfill(4) + "_wof" + outfiles_ext), 'w')
outfile.write(header)
for service, values in service_evals_wof.items():
outfile.write(str(services) + "\t" + str(service) + "\t"+
str(values['dispatch']['min']) + "\t" + str(values['dispatch']['max']) + "\t" +
str(values['dispatch']['mean']) + "\t" + str(values['dispatch']['median']) + "\t" +
str(values['dispatch']['jitter']) + "\t" +
str(values['retrieve']['min']) + "\t" + str(values['retrieve']['max']) + "\t" +
str(values['retrieve']['mean']) + "\t" + str(values['retrieve']['median']) + "\t" +
str(values['retrieve']['jitter']) + "\n")
outfile.close()
outfile = open(os.path.join(outpath, outfiles_bases['rpcservice'] + "_wof" + outfiles_ext), 'w')
outfile.write(header)
for services, service_evals_wof in evals_wof.items():
worst = 0
worstval = 0
for service, values in service_evals_wof.items():
if values['retrieve']['mean'] > worstval:
worst = service
worstval = values['retrieve']['mean']
values = service_evals_wof[worst]
outfile.write(str(services) + "\t" + str(service) + "\t"+
str(values['dispatch']['min']) + "\t" + str(values['dispatch']['max']) + "\t" +
str(values['dispatch']['mean']) + "\t" + str(values['dispatch']['median']) + "\t" +
str(values['dispatch']['jitter']) + "\t" +
str(values['retrieve']['min']) + "\t" + str(values['retrieve']['max']) + "\t" +
str(values['retrieve']['mean']) + "\t" + str(values['retrieve']['median']) + "\t" +
str(values['retrieve']['jitter']) + "\n")
outfile.close()
print("done")
state = 'searchrpc'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment