From 06d716eb66347bd68cf4eb260211bc005e68883e Mon Sep 17 00:00:00 2001 From: Nikolay Stanchev <ns17@it-innovation.soton.ac.uk> Date: Mon, 30 Apr 2018 13:43:06 +0100 Subject: [PATCH] Updated simulator and documentation --- clmctest/monitoring/E2EAggregator.py | 32 +++++++++++++++------------- docs/aggregation.md | 2 ++ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/clmctest/monitoring/E2EAggregator.py b/clmctest/monitoring/E2EAggregator.py index d0ee8cb..372ec3c 100644 --- a/clmctest/monitoring/E2EAggregator.py +++ b/clmctest/monitoring/E2EAggregator.py @@ -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: diff --git a/docs/aggregation.md b/docs/aggregation.md index ac19ed2..cc0e626 100644 --- a/docs/aggregation.md +++ b/docs/aggregation.md @@ -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 | -- GitLab