# # query the network delays and group them by path ID
# network_delays = {}
# result = self.db_client.query(
# 'SELECT mean(delay) as "net_delay" FROM "E2EMetrics"."autogen"."network_delays" WHERE time >= {0} and time < {1} GROUP BY path, source, target'.format(
# # query the service delays and group them by endpoint, service function instance and sfr
# service_delays = {}
# result = self.db_client.query('SELECT mean(response_time) as "response_time" FROM "E2EMetrics"."autogen"."service_delays" WHERE time >= {0} and time < {1} GROUP BY endpoint, sf_instance, sfr'.format(boundary_time_nano, current_time_nano))
# # reverse the path ID to get the network delay for the reversed path
# reversed_path = (path_id, target, source)
# assert reversed_path in network_delays # reversed path must always be reported with the forward one - if there is network path A-B, there is also network path B-A
Performs the functionality of the aggregator - query data from both measurements merge that data and post it back in influx every 5 seconds.
"""
current_time=int(time())
whileTrue:
boundary_time=current_time-self.report_period
boundary_time_nano=boundary_time*1000000000
current_time_nano=current_time*1000000000
# query the network delays and group them by path ID
network_delays={}
whileTrue:
try:
result=self.db_client.query(
'SELECT mean(delay) as "net_delay" FROM "E2EMetrics"."autogen"."network_delays" WHERE time >= {0} and time < {1} GROUP BY path, source, target'.format(
# query the service delays and group them by endpoint, service function instance and sfr
service_delays={}
whileTrue:
try:
result=self.db_client.query('SELECT mean(response_time) as "response_time" FROM "E2EMetrics"."autogen"."service_delays" WHERE time >= {0} and time < {1} GROUP BY endpoint, sf_instance, sfr'.format(boundary_time_nano,current_time_nano))
# reverse the path ID to get the network delay for the reversed path
reversed_path=(path_id,target,source)
assertreversed_pathinnetwork_delays# reversed path must always be reported with the forward one - if there is network path A-B, there is also network path B-A