diff --git a/clmctest/monitoring/E2ESim.py b/clmctest/monitoring/E2ESim.py index 1a62443547a0f351aabe339d5ac738396d546bbb..a6520d280b52353ff7120746949a9127ecbed875 100644 --- a/clmctest/monitoring/E2ESim.py +++ b/clmctest/monitoring/E2ESim.py @@ -78,25 +78,29 @@ class Simulator(object): 'target': 'SR2', 'source': 'SR1', 'path_id': 'SR1---SR2', - 'latency': 5 + 'latency': 5, + 'bandwidth': 100*1024*1024 }, { 'target': 'SR1', 'source': 'SR2', 'path_id': 'SR1---SR2', - 'latency': 5 + 'latency': 5, + 'bandwidth': 100*1024*1024 }, { 'target': 'SR3', 'source': 'SR1', 'path_id': 'SR1---SR3', - 'latency': 15 + 'latency': 5, + 'bandwidth': 100*1024*1024 }, { 'target': 'SR1', 'source': 'SR3', 'path_id': 'SR1---SR3', - 'latency': 15 + 'latency': 5, + 'bandwidth': 100*1024*1024 } ] @@ -133,7 +137,7 @@ class Simulator(object): if i % sample_period_net == 0: path = random.choice(paths) self.db_client.write_points( - lp.generate_network_delay_report(path['path_id'], path['source'], path['target'], path['latency'], sim_time)) + lp.generate_network_delay_report(path['path_id'], path['source'], path['target'], path['latency'], path['bandwidth'], sim_time)) # increase/decrease the delay in every sample report (min delay is 1) path['latency'] = max(1, path['latency'] + random.randint(-3, 3)) diff --git a/clmctest/monitoring/LineProtocolGenerator.py b/clmctest/monitoring/LineProtocolGenerator.py index 30e37a4cf315d8e70888fa4531ccfbcd45970486..2d2b7a0db3d79f8f9f7989718d799b6d17593919 100644 --- a/clmctest/monitoring/LineProtocolGenerator.py +++ b/clmctest/monitoring/LineProtocolGenerator.py @@ -64,7 +64,7 @@ def generate_e2e_delay_report(path_id, source_sfr, target_sfr, endpoint, sf_inst return result -def generate_network_delay_report(path_id, source_sfr, target_sfr, latency, time): +def generate_network_delay_report(path_id, source_sfr, target_sfr, latency, bandwidth, time): """ Generates a platform measurement about the network delay between two specific service routers. @@ -72,6 +72,7 @@ def generate_network_delay_report(path_id, source_sfr, target_sfr, latency, time :param source_sfr: the source service router :param target_sfr: the target service router :param latency: the e2e network delay for traversing the path between the two service routers + :param bandwidth: the bandwidth of the path (minimum of bandwidths of the links it is composed of) :param time: the measurement timestamp :return: a list of dict-formatted reports to post on influx """ @@ -83,7 +84,8 @@ def generate_network_delay_report(path_id, source_sfr, target_sfr, latency, time "target": target_sfr }, "fields": { - "latency": latency + "latency": latency, + "bandwidth": bandwidth }, "time": _getNSTime(time) }] diff --git a/clmctest/monitoring/test_e2eresults.py b/clmctest/monitoring/test_e2eresults.py index ab4fd13175bd87f31b5c0131e964d8d781079541..2f469b72705f9d2b6e3ae0d21911a5523532e5e7 100644 --- a/clmctest/monitoring/test_e2eresults.py +++ b/clmctest/monitoring/test_e2eresults.py @@ -59,7 +59,7 @@ class TestE2ESimulation(object): @pytest.mark.parametrize("query, expected_result", [ ('SELECT count(*) FROM "E2EMetrics"."autogen"."network_delays"', - {"time": "1970-01-01T00:00:00Z", "count_latency": 120}), + {"time": "1970-01-01T00:00:00Z", "count_latency": 120, "count_bandwidth": 120}), ('SELECT count(*) FROM "E2EMetrics"."autogen"."service_delays"', {"time": "1970-01-01T00:00:00Z", "count_response_time": 24, "count_request_size": 24, "count_response_size": 24}), ('SELECT count(*) FROM "E2EMetrics"."autogen"."e2e_delays"',