Skip to content
Snippets Groups Projects
Commit 06d716eb authored by Nikolay Stanchev's avatar Nikolay Stanchev
Browse files

Updated simulator and documentation

parent c749fe83
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,7 @@ class Aggregator(Thread):
boundary_time_nano = boundary_time * 1000000000
current_time_nano = current_time * 1000000000
# query the network delays and group them by path ID
network_delays = {}
result = self.db_client.query(
'SELECT mean(delay) as "Dnet" FROM "E2EMetrics"."autogen".network_delays WHERE time >= {0} and time < {1} GROUP BY path'.format(
......@@ -93,6 +94,7 @@ class Aggregator(Thread):
network_delays[tags['path']] = next(result_points)['Dnet']
# query the service delays and group them by FQDN, service function instance and endpoint
service_delays = {}
result = self.db_client.query(
'SELECT mean(response_time) as "Dresponse" FROM "E2EMetrics"."autogen".service_delays WHERE time >= {0} and time < {1} GROUP BY FQDN, sf_instance, endpoint'.format(
......@@ -101,15 +103,14 @@ class Aggregator(Thread):
metadata, result_points = item
# measurement = metadata[0]
tags = metadata[1]
service_delays[tags['endpoint']] = (next(result_points)['Dresponse'], tags['FQDN'], tags['sf_instance'])
if tags['endpoint'] not in service_delays:
service_delays[tags['endpoint']] = [(next(result_points)['Dresponse'], tags['FQDN'], tags['sf_instance'])]
else:
service_delays[tags['endpoint']].append((next(result_points)['Dresponse'], tags['FQDN'], tags['sf_instnace']))
# for each path identifier check if there is a media service delay report for the target endpoint - if so, generate an e2e_delay measurement
for path in network_delays:
# check if target endpoint is reported in service delays, that is there is a media service instance running on target endpoint
target_endpoint = self.get_target_endpoint(path)
if target_endpoint not in service_delays:
# if not continue with the other path IDs
continue
e2e_arguments = {"path_id_f": None, "path_id_r": None, "fqdn": None, "sf_instance": None, "delay_path_f": None, "delay_path_r": None,
......@@ -118,21 +119,22 @@ class Aggregator(Thread):
e2e_arguments['path_id_f'] = path
e2e_arguments['delay_path_f'] = network_delays[path]
# reverse the path ID to get the network delay for the reversed path
reversed_path = self.reverse_path_id(path)
assert reversed_path in network_delays
assert reversed_path in network_delays # an assertion is made here, since reversed path should always be reported as well
e2e_arguments['path_id_r'] = reversed_path
e2e_arguments['delay_path_r'] = network_delays[reversed_path]
for service_delay in service_delays[target_endpoint]:
response_time, fqdn, sf_instance = service_delay
e2e_arguments['delay_service'] = response_time
e2e_arguments['fqdn'] = fqdn
e2e_arguments['sf_isntnace'] = sf_instance
service_delay = service_delays[target_endpoint]
response_time, fqdn, sf_instance = service_delay
e2e_arguments['delay_service'] = response_time
e2e_arguments['fqdn'] = fqdn
e2e_arguments['sf_isntnace'] = sf_instance
if None not in e2e_arguments.items():
self.db_client.write_points(
lp.generate_e2e_delay_report(e2e_arguments['path_id_f'], e2e_arguments['path_id_r'], e2e_arguments['fqdn'], e2e_arguments['sf_isntnace'],
e2e_arguments['delay_path_f'], e2e_arguments['delay_path_r'], e2e_arguments['delay_service'], e2e_arguments['time']))
if None not in e2e_arguments.items():
self.db_client.write_points(
lp.generate_e2e_delay_report(e2e_arguments['path_id_f'], e2e_arguments['path_id_r'], e2e_arguments['fqdn'], e2e_arguments['sf_isntnace'],
e2e_arguments['delay_path_f'], e2e_arguments['delay_path_r'], e2e_arguments['delay_service'], e2e_arguments['time']))
old_timestamp = current_time
while current_time != old_timestamp + 5:
......
......@@ -45,6 +45,8 @@ We can easily split the string on **'---'** and, thus, find the source endpoint
**endpoint2.ms-A.ict-flame.eu**.
The delay field value is the network end-to-end delay in milliseconds for the path identified in the tag value.
* A response will traverse the same network path as the request, but in reverse direction.
* Media service measurement - assumption is that we have a measurement for media services' response time, called **service_delays**, providing the following information:
| FQDN (tag) | sf_instance (tag) | endpoint (tag) | response_time | time |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment