diff options
author | Luc Provoost <luc.provoost@intel.com> | 2021-04-12 18:18:30 +0200 |
---|---|---|
committer | Luc Provoost <luc.provoost@intel.com> | 2021-04-12 21:04:44 +0200 |
commit | e6b54f87766cead3df1f1f5b7099ac6562f6096a (patch) | |
tree | 3de6fe4fb5de1a275471b482a76ed3d24ea022a1 /VNFs | |
parent | 9efb0fe5411cd3cd4eb7b8a6dbf2645ed18dbd1d (diff) |
Code improvements
Rework of some of the code for better readability
Change-Id: I559e88faba31d93e593d39cf436f3e114ba4528a
Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs')
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/format.yaml | 42 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/prox_ctrl.py | 28 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py | 157 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_impairtest.py | 38 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py | 283 |
5 files changed, 268 insertions, 280 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/format.yaml b/VNFs/DPPD-PROX/helper-scripts/rapid/format.yaml index d9c55405..01415ecc 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/format.yaml +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/format.yaml @@ -11,16 +11,17 @@ Flows: Flows Size: Size RequestedSpeed: RequestedSpeed - CoreGenerated: CoreGenerated - SentByNIC: SentByNIC - FwdBySUT: FwdBySUT - RevByCore: RevByCore - AvgLatency: AvgLatency - PCTLatency: PCTLatency - MaxLatency: MaxLatency - PacketsSent: PacketsSent - PacketsReceived: PacketsReceived - PacketsLost: PacketsLost + CoreGenerated: pps_req_tx + SentByNIC: pps_tx + FwdBySUT: pps_sut_tx + RevByCore: pps_rx + AvgLatency: lat_avg + PCTLatency: lat_perc + MinLatency: lat_min + MaxLatency: lat_max + PacketsSent: abs_tx + PacketsReceived: abs_rx + PacketsLost: abs_dropped rapid_flowsizetest: Environment: environment_file Test: test @@ -28,21 +29,22 @@ rapid_flowsizetest: Size: Size Speed (Mpps): RequestedSpeed: RequestedSpeed - CoreGenerated: CoreGenerated - SentByNIC: SentByNIC - FwdBySUT: FwdBySUT - RevByCore: RevByCore + CoreGenerated: pps_req_tx + SentByNIC: pps_tx + FwdBySUT: pps_sut_tx + RevByCore: pps_rx Latency (usec): - AvgLatency: AvgLatency - PCTLatency: PCTLatency - MaxLatency: MaxLatency + AvgLatency: lat_avg + PCTLatency: lat_perc + MinLatency: lat_min + MaxLatency: lat_max Distribution: bucket_size: bucket_size buckets: buckets Absolute Packet Count: - PacketsSent: PacketsSent - PacketsReceived: PacketsReceived - PacketsLost: PacketsLost + PacketsSent: abs_tx + PacketsReceived: abs_rx + PacketsLost: abs_dropped rapid_irqtest: Environment: environment_file Test: test diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/prox_ctrl.py b/VNFs/DPPD-PROX/helper-scripts/rapid/prox_ctrl.py index 9f4539cb..a9497e1b 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/prox_ctrl.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/prox_ctrl.py @@ -198,10 +198,11 @@ class prox_sock(object): self._send('reset stats') def lat_stats(self, cores, tasks=[0]): - min_lat = 999999999 - max_lat = avg_lat = 0 + result = {} + result['lat_min'] = 999999999 + result['lat_max'] = result['lat_avg'] = 0 number_tasks_returning_stats = 0 - buckets = [0] * 128 + result['buckets'] = [0] * 128 self._send('lat all stats %s %s' % (','.join(map(str, cores)), ','.join(map(str, tasks)))) for core in cores: @@ -214,15 +215,15 @@ class prox_sock(object): (potential incompatibility between scripts and PROX)") raise Exception("lat stats error") number_tasks_returning_stats += 1 - min_lat = min(int(stats[0]),min_lat) - max_lat = max(int(stats[1]),max_lat) - avg_lat += int(stats[2]) + result['lat_min'] = min(int(stats[0]),result['lat_min']) + result['lat_max'] = max(int(stats[1]),result['lat_max']) + result['lat_avg'] += int(stats[2]) #min_since begin = int(stats[3]) #max_since_begin = int(stats[4]) - tsc = int(stats[5]) # Taking the last tsc as the timestamp since + result['lat_tsc'] = int(stats[5]) # Taking the last tsc as the timestamp since # PROX will return the same tsc for each # core/task combination - hz = int(stats[6]) + result['lat_hz'] = int(stats[6]) #coreid = int(stats[7]) #taskid = int(stats[8]) mis_ordered = int(stats[9]) @@ -234,17 +235,18 @@ class prox_sock(object): reply (potential incompatibility between scripts \ and PROX)") raise Exception("lat bucket reply error") - buckets[0] = int(stats[1]) + result['buckets'][0] = int(stats[1]) for i in range(1, 128): stats = self._recv().split(':') - buckets[i] = int(stats[1]) - avg_lat = old_div(avg_lat,number_tasks_returning_stats) + result['buckets'][i] = int(stats[1]) + result['lat_avg'] = old_div(result['lat_avg'], + number_tasks_returning_stats) self._send('stats latency(0).used') used = float(self._recv()) self._send('stats latency(0).total') total = float(self._recv()) - return (min_lat, max_lat, avg_lat, (old_div(used,total)), tsc, hz, - buckets) + result['lat_used'] = old_div(used,total) + return (result) def irq_stats(self, core, bucket, task=0): self._send('stats task.core(%s).task(%s).irq(%s)' % diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py index 042fc8dc..d65afd62 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py @@ -18,6 +18,7 @@ ## import sys import time +import copy from math import ceil from statistics import mean from past.utils import old_div @@ -99,6 +100,8 @@ class FlowSizeTest(RapidTest): def run(self): result_details = {'Details': 'Nothing'} TestResult = 0 + end_data = {} + iteration_prefix = {} for imix in self.test['imixs']: size = mean(imix) self.gen_machine.set_udp_packet_size(imix) @@ -119,7 +122,8 @@ class FlowSizeTest(RapidTest): self.sut_machine.reset_stats() flow_number = self.gen_machine.set_flows(flow_number) self.set_background_flows(self.background_machines, flow_number) - endspeed = None +# endspeed = None + end_data['speed'] = None speed = self.get_start_speed_and_init(size) while True: attempts += 1 @@ -131,137 +135,108 @@ class FlowSizeTest(RapidTest): self.set_background_speed(self.background_machines, speed) self.start_background_traffic(self.background_machines) # Get statistics now that the generation is stable and initial ARP messages are dealt with - pps_req_tx,pps_tx,pps_sut_tx,pps_rx,lat_avg,lat_perc , lat_perc_max, lat_max, abs_tx,abs_rx,abs_dropped, abs_tx_fail, drop_rate, lat_min, lat_used, r, actual_duration, avg_bg_rate, bucket_size, buckets = self.run_iteration(float(self.test['runtime']),flow_number,size,speed) + iteration_data = self.run_iteration( + float(self.test['runtime']),flow_number,size,speed) + iteration_data['speed'] = speed self.stop_background_traffic(self.background_machines) - if r > 1: - retry_warning = bcolors.WARNING + ' {:1} retries needed'.format(r) + bcolors.ENDC + if iteration_data['r'] > 1: + retry_warning = bcolors.WARNING + ' {:1} retries needed'.format(iteration_data['r']) + bcolors.ENDC else: retry_warning = '' # Drop rate is expressed in percentage. lat_used is a ratio (0 to 1). The sum of these 2 should be 100%. # If the sum is lower than 95, it means that more than 5% of the latency measurements where dropped for accuracy reasons. - if (drop_rate + lat_used * 100) < 95: - lat_warning = bcolors.WARNING + ' Latency accuracy issue?: {:>3.0f}%'.format(lat_used*100) + bcolors.ENDC + if (iteration_data['drop_rate'] + iteration_data['lat_used'] * 100) < 95: + lat_warning = bcolors.WARNING + ' Latency accuracy issue?: {:>3.0f}%'.format(iteration_data['lat_used']*100) + bcolors.ENDC else: lat_warning = '' + iteration_prefix = {'speed' : bcolors.ENDC, + 'lat_avg' : bcolors.ENDC, + 'lat_perc' : bcolors.ENDC, + 'lat_max' : bcolors.ENDC, + 'abs_drop_rate' : bcolors.ENDC, + 'drop_rate' : bcolors.ENDC} if self.test['test'] == 'fixed_rate': - endspeed = speed - endpps_req_tx = None - endpps_tx = None - endpps_sut_tx = None - endpps_rx = None - endlat_avg = lat_avg - endlat_perc = lat_perc - endlat_perc_max = lat_perc_max - endlat_max = lat_max - endbuckets = buckets - endabs_dropped = abs_dropped - enddrop_rate = drop_rate - endabs_tx = abs_tx - endabs_rx = abs_rx - endavg_bg_rate = avg_bg_rate + end_data = copy.deepcopy(iteration_data) + end_prefix = copy.deepcopy(iteration_prefix) if lat_warning or retry_warning: endwarning = '| | {:177.177} |'.format(retry_warning + lat_warning) success = True - TestResult = TestResult + pps_rx # fixed rate testing result is strange: we just report the pps received - speed_prefix = lat_avg_prefix = lat_perc_prefix = lat_max_prefix = abs_drop_rate_prefix = drop_rate_prefix = bcolors.ENDC + #TestResult = TestResult + iteration_data['pps_rx'] # fixed rate testing result is strange: we just report the pps received # The following if statement is testing if we pass the success criteria of a certain drop rate, average latency and maximum latency below the threshold # The drop rate success can be achieved in 2 ways: either the drop rate is below a treshold, either we want that no packet has been lost during the test # This can be specified by putting 0 in the .test file - elif ((drop_rate < self.test['drop_rate_threshold']) or (abs_dropped==self.test['drop_rate_threshold']==0)) and (lat_avg< self.test['lat_avg_threshold']) and (lat_perc< self.test['lat_perc_threshold']) and (lat_max < self.test['lat_max_threshold']): - if (old_div((self.get_pps(speed,size) - pps_tx),self.get_pps(speed,size)))>0.01: - speed_prefix = bcolors.WARNING - if abs_tx_fail > 0: - gen_warning = bcolors.WARNING + ' Network limit?: requesting {:<.3f} Mpps and getting {:<.3f} Mpps - {} failed to be transmitted'.format(self.get_pps(speed,size), pps_tx, abs_tx_fail) + bcolors.ENDC + elif ((iteration_data['drop_rate'] < self.test['drop_rate_threshold']) or (iteration_data['abs_dropped']==self.test['drop_rate_threshold']==0)) and (iteration_data['lat_avg']< self.test['lat_avg_threshold']) and (iteration_data['lat_perc']< self.test['lat_perc_threshold']) and (iteration_data['lat_max'] < self.test['lat_max_threshold']): + if (old_div((self.get_pps(speed,size) - iteration_data['pps_tx']),self.get_pps(speed,size)))>0.01: + iteration_prefix['speed'] = bcolors.WARNING + if iteration_data['abs_tx_fail'] > 0: + gen_warning = bcolors.WARNING + ' Network limit?: requesting {:<.3f} Mpps and getting {:<.3f} Mpps - {} failed to be transmitted'.format(self.get_pps(speed,size), iteration_data['pps_tx'], iteration_data['abs_tx_fail']) + bcolors.ENDC else: - gen_warning = bcolors.WARNING + ' Generator limit?: requesting {:<.3f} Mpps and getting {:<.3f} Mpps'.format(self.get_pps(speed,size), pps_tx) + bcolors.ENDC + gen_warning = bcolors.WARNING + ' Generator limit?: requesting {:<.3f} Mpps and getting {:<.3f} Mpps'.format(self.get_pps(speed,size), iteration_data['pps_tx']) + bcolors.ENDC else: - speed_prefix = bcolors.ENDC + iteration_prefix['speed'] = bcolors.ENDC gen_warning = '' - endspeed = speed - endspeed_prefix = speed_prefix - endpps_req_tx = pps_req_tx - endpps_tx = pps_tx - endpps_sut_tx = pps_sut_tx - endpps_rx = pps_rx - endlat_avg = lat_avg - endlat_perc = lat_perc - endlat_perc_max = lat_perc_max - endlat_max = lat_max - endbuckets = buckets - endabs_dropped = None - enddrop_rate = drop_rate - endabs_tx = abs_tx - endabs_rx = abs_rx - endavg_bg_rate = avg_bg_rate + end_data = copy.deepcopy(iteration_data) + end_prefix = copy.deepcopy(iteration_prefix) + end_data['abs_dropped'] = None if lat_warning or gen_warning or retry_warning: endwarning = '| | {:186.186} |'.format(retry_warning + lat_warning + gen_warning) success = True success_message=' SUCCESS' - speed_prefix = lat_avg_prefix = lat_perc_prefix = lat_max_prefix = abs_drop_rate_prefix = drop_rate_prefix = bcolors.ENDC - RapidLog.debug(self.report_result(-attempts,size,speed,pps_req_tx,pps_tx,pps_sut_tx,pps_rx,lat_avg,lat_perc,lat_perc_max,lat_max,abs_tx,abs_rx,abs_dropped,actual_duration,speed_prefix,lat_avg_prefix,lat_max_prefix,abs_drop_rate_prefix,drop_rate_prefix)+ success_message + retry_warning + lat_warning + gen_warning) + RapidLog.debug(self.report_result(-attempts, size, + iteration_data, iteration_prefix) + success_message + + retry_warning + lat_warning + gen_warning) else: success_message=' FAILED' - abs_drop_rate_prefix = bcolors.ENDC - if ((abs_dropped>0) and (self.test['drop_rate_threshold'] ==0)): - abs_drop_rate_prefix = bcolors.FAIL - if (drop_rate < self.test['drop_rate_threshold']): - drop_rate_prefix = bcolors.ENDC + if ((iteration_data['abs_dropped']>0) and (self.test['drop_rate_threshold'] ==0)): + iteration_prefix['abs_drop_rate'] = bcolors.FAIL + if (iteration_data['drop_rate'] < self.test['drop_rate_threshold']): + iteration_prefix['drop_rate'] = bcolors.ENDC else: - drop_rate_prefix = bcolors.FAIL - if (lat_avg< self.test['lat_avg_threshold']): - lat_avg_prefix = bcolors.ENDC + iteration_prefix['drop_rate'] = bcolors.FAIL + if (iteration_data['lat_avg']< self.test['lat_avg_threshold']): + iteration_prefix['lat_avg'] = bcolors.ENDC else: - lat_avg_prefix = bcolors.FAIL - if (lat_perc< self.test['lat_perc_threshold']): - lat_perc_prefix = bcolors.ENDC + iteration_prefix['lat_avg'] = bcolors.FAIL + if (iteration_data['lat_perc']< self.test['lat_perc_threshold']): + iteration_prefix['lat_perc'] = bcolors.ENDC else: - lat_perc_prefix = bcolors.FAIL - if (lat_max< self.test['lat_max_threshold']): - lat_max_prefix = bcolors.ENDC + iteration_prefix['lat_perc'] = bcolors.FAIL + if (iteration_data['lat_max']< self.test['lat_max_threshold']): + iteration_prefix['lat_max'] = bcolors.ENDC else: - lat_max_prefix = bcolors.FAIL - if ((old_div((self.get_pps(speed,size) - pps_tx),self.get_pps(speed,size)))<0.001): - speed_prefix = bcolors.ENDC + iteration_prefix['lat_max'] = bcolors.FAIL + if ((old_div((self.get_pps(speed,size) - iteration_data['pps_tx']),self.get_pps(speed,size)))<0.001): + iteration_prefix['speed'] = bcolors.ENDC else: - speed_prefix = bcolors.FAIL + iteration_prefix['speed'] = bcolors.FAIL success = False - RapidLog.debug(self.report_result(-attempts,size,speed,pps_req_tx,pps_tx,pps_sut_tx,pps_rx,lat_avg,lat_perc,lat_perc_max,lat_max,abs_tx,abs_rx,abs_dropped,actual_duration,speed_prefix,lat_avg_prefix,lat_perc_prefix,lat_max_prefix,abs_drop_rate_prefix,drop_rate_prefix)+ success_message + retry_warning + lat_warning) + RapidLog.debug(self.report_result(-attempts, size, + iteration_data, iteration_prefix) + + success_message + retry_warning + lat_warning) speed = self.new_speed(speed, size, success) if self.test['test'] == 'increment_till_fail': if not success: break elif self.resolution_achieved(): break - if endspeed is not None: - speed_prefix = lat_avg_prefix = lat_perc_prefix = lat_max_prefix = abs_drop_rate_prefix = drop_rate_prefix = bcolors.ENDC - RapidLog.info(self.report_result(flow_number,size,endspeed,endpps_req_tx,endpps_tx,endpps_sut_tx,endpps_rx,endlat_avg,endlat_perc,endlat_perc_max,endlat_max,endabs_tx,endabs_rx,endabs_dropped,actual_duration,speed_prefix,lat_avg_prefix,lat_perc_prefix,lat_max_prefix,abs_drop_rate_prefix,drop_rate_prefix)) - if endavg_bg_rate: - tot_avg_rx_rate = endpps_rx + (endavg_bg_rate * len(self.background_machines)) + if end_data['speed'] is not None: + RapidLog.info(self.report_result(flow_number, size, + end_data, end_prefix)) + if end_data['avg_bg_rate']: + tot_avg_rx_rate = end_data['pps_rx'] + (end_data['avg_bg_rate'] * len(self.background_machines)) endtotaltrafficrate = '| | Total amount of traffic received by all generators during this test: {:>4.3f} Gb/s {:7.3f} Mpps {} |'.format(RapidTest.get_speed(tot_avg_rx_rate,size) , tot_avg_rx_rate, ' '*84) RapidLog.info (endtotaltrafficrate) if endwarning: RapidLog.info (endwarning) RapidLog.info("+--------+------------------+-------------+-------------+-------------+------------------------+----------+----------+----------+-----------+-----------+-----------+-----------+-------+----+") if self.test['test'] != 'fixed_rate': - TestResult = TestResult + endpps_rx - result_details = {'test': self.test['testname'], - 'environment_file': self.test['environment_file'], - 'Flows': flow_number, - 'Size': size, - 'RequestedSpeed': RapidTest.get_pps(endspeed,size), - 'CoreGenerated': endpps_req_tx, - 'SentByNIC': endpps_tx, - 'FwdBySUT': endpps_sut_tx, - 'RevByCore': endpps_rx, - 'AvgLatency': endlat_avg, - 'PCTLatency': endlat_perc, - 'MaxLatency': endlat_max, - 'PacketsSent': endabs_tx, - 'PacketsReceived': endabs_rx, - 'PacketsLost': endabs_dropped, - 'bucket_size': bucket_size, - 'buckets': endbuckets} - result_details = self.post_data('rapid_flowsizetest', result_details) + TestResult = TestResult + end_data['pps_rx'] + end_data['test'] = self.test['testname'] + end_data['environment_file'] = self.test['environment_file'] + end_data['Flows'] = flow_number + end_data['Size'] = size + end_data['RequestedSpeed'] = RapidTest.get_pps(end_data['speed'] ,size) + result_details = self.post_data('rapid_flowsizetest', end_data) else: RapidLog.info('|{:>7}'.format(str(flow_number))+" | Speed 0 or close to 0") self.gen_machine.stop_latency_cores() diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_impairtest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_impairtest.py index 8dfdc805..ee9ed792 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_impairtest.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_impairtest.py @@ -58,30 +58,38 @@ class ImpairTest(RapidTest): sys.stdout.flush() time.sleep(1) # Get statistics now that the generation is stable and NO ARP messages any more - pps_req_tx,pps_tx,pps_sut_tx,pps_rx,lat_avg, lat_perc, lat_perc_max, lat_max, abs_tx, abs_rx, abs_dropped, abs_tx_fail, drop_rate, lat_min, lat_used, r, actual_duration, _,bucket_size, buckets = self.run_iteration(float(self.test['runtime']),flow_number,size,speed) + iteration_data = self.run_iteration(float(self.test['runtime']),flow_number,size,speed) + iteration_data['speed'] = speed # Drop rate is expressed in percentage. lat_used is a ratio (0 to 1). The sum of these 2 should be 100%. # If the sum is lower than 95, it means that more than 5% of the latency measurements where dropped for accuracy reasons. - if (drop_rate + lat_used * 100) < 95: - lat_warning = bcolors.WARNING + ' Latency accuracy issue?: {:>3.0f}%'.format(lat_used*100) + bcolors.ENDC + if (iteration_data['drop_rate'] + iteration_data['lat_used'] * 100) < 95: + lat_warning = bcolors.WARNING + ' Latency accuracy issue?: {:>3.0f}%'.format(iteration_data['lat_used']*100) + bcolors.ENDC else: lat_warning = '' - RapidLog.info(self.report_result(attempts,size,speed,pps_req_tx,pps_tx,pps_sut_tx,pps_rx,lat_avg,lat_perc,lat_perc_max,lat_max,abs_tx,abs_rx,abs_dropped,actual_duration)) + iteration_prefix = {'speed' : '', + 'lat_avg' : '', + 'lat_perc' : '', + 'lat_max' : '', + 'abs_drop_rate' : '', + 'drop_rate' : ''} + RapidLog.info(self.report_result(attempts, size, iteration_data, + iteration_prefix)) result_details = {'test': self.test['test'], 'environment_file': self.test['environment_file'], 'Flows': flow_number, 'Size': size, 'RequestedSpeed': RapidTest.get_pps(speed,size), - 'CoreGenerated': pps_req_tx, - 'SentByNIC': pps_tx, - 'FwdBySUT': pps_sut_tx, - 'RevByCore': pps_rx, - 'AvgLatency': lat_avg, - 'PCTLatency': lat_perc, - 'MaxLatency': lat_max, - 'PacketsLost': abs_dropped, - 'DropRate': drop_rate, - 'bucket_size': bucket_size, - 'buckets': buckets} + 'CoreGenerated': iteration_data['pps_req_tx'], + 'SentByNIC': iteration_data['pps_tx'], + 'FwdBySUT': iteration_data['pps_sut_tx'], + 'RevByCore': iteration_data['pps_rx'], + 'AvgLatency': iteration_data['lat_avg'], + 'PCTLatency': iteration_data['lat_perc'], + 'MaxLatency': iteration_data['lat_max'], + 'PacketsLost': iteration_data['abs_dropped'], + 'DropRate': iteration_data['drop_rate'], + 'bucket_size': iteration_data['bucket_size'], + 'buckets': iteration_data['buckets']} result_details = self.post_data('rapid_impairtest', result_details) self.gen_machine.stop_latency_cores() return (True, result_details) diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py index 3c13d1aa..b431e5b7 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py @@ -125,64 +125,63 @@ class RapidTest(object): return (var[test]) @staticmethod - def report_result(flow_number, size, speed, pps_req_tx, pps_tx, pps_sut_tx, - pps_rx, lat_avg, lat_perc, lat_perc_max, lat_max, tx, rx, tot_drop, - elapsed_time,speed_prefix='', lat_avg_prefix='', lat_perc_prefix='', - lat_max_prefix='', abs_drop_rate_prefix='', drop_rate_prefix=''): + def report_result(flow_number, size, data, prefix): if flow_number < 0: flow_number_str = '| ({:>4}) |'.format(abs(flow_number)) else: flow_number_str = '|{:>7} |'.format(flow_number) - if pps_req_tx is None: + if data['pps_req_tx'] is None: pps_req_tx_str = '{0: >14}'.format(' NA |') else: - pps_req_tx_str = '{:>7.3f} Mpps |'.format(pps_req_tx) - if pps_tx is None: + pps_req_tx_str = '{:>7.3f} Mpps |'.format(data['pps_req_tx']) + if data['pps_tx'] is None: pps_tx_str = '{0: >14}'.format(' NA |') else: - pps_tx_str = '{:>7.3f} Mpps |'.format(pps_tx) - if pps_sut_tx is None: + pps_tx_str = '{:>7.3f} Mpps |'.format(data['pps_tx']) + if data['pps_sut_tx'] is None: pps_sut_tx_str = '{0: >14}'.format(' NA |') else: - pps_sut_tx_str = '{:>7.3f} Mpps |'.format(pps_sut_tx) - if pps_rx is None: + pps_sut_tx_str = '{:>7.3f} Mpps |'.format(data['pps_sut_tx']) + if data['pps_rx'] is None: pps_rx_str = '{0: >25}'.format('NA |') else: pps_rx_str = bcolors.OKBLUE + '{:>4.1f} Gb/s |{:7.3f} Mpps {}|'.format( - RapidTest.get_speed(pps_rx,size),pps_rx,bcolors.ENDC) - if tot_drop is None: + RapidTest.get_speed(data['pps_rx'],size),data['pps_rx'],bcolors.ENDC) + if data['abs_dropped'] is None: tot_drop_str = ' | NA | ' else: - tot_drop_str = ' | {:>9.0f} | '.format(tot_drop) - if lat_perc is None: - lat_perc_str = ' |{:^10.10}|'.format('NA') - elif lat_perc_max == True: - lat_perc_str = '|>{}{:>5.0f} us{} |'.format(lat_perc_prefix, - float(lat_perc), bcolors.ENDC) + tot_drop_str = ' | {:>9.0f} | '.format(data['abs_dropped']) + if data['lat_perc'] is None: + lat_perc_str = '|{:^10.10}|'.format('NA') + elif data['lat_perc_max'] == True: + lat_perc_str = '|>{}{:>5.0f} us{} |'.format(prefix['lat_perc'], + float(data['lat_perc']), bcolors.ENDC) else: - lat_perc_str = '| {}{:>5.0f} us{} |'.format(lat_perc_prefix, - float(lat_perc), bcolors.ENDC) - if elapsed_time is None: + lat_perc_str = '| {}{:>5.0f} us{} |'.format(prefix['lat_perc'], + float(data['lat_perc']), bcolors.ENDC) + if data['actual_duration'] is None: elapsed_time_str = ' NA |' else: - elapsed_time_str = '{:>3.0f} |'.format(elapsed_time) - return(flow_number_str + '{:>5.1f}'.format(speed) + '% ' + speed_prefix - + '{:>6.3f}'.format(RapidTest.get_pps(speed,size)) + ' Mpps|' + + elapsed_time_str = '{:>3.0f} |'.format(data['actual_duration']) + return(flow_number_str + '{:>5.1f}'.format(data['speed']) + '% ' + prefix['speed'] + + '{:>6.3f}'.format(RapidTest.get_pps(data['speed'],size)) + ' Mpps|' + pps_req_tx_str + pps_tx_str + bcolors.ENDC + pps_sut_tx_str + - pps_rx_str + lat_avg_prefix + ' {:>6.0f}'.format(lat_avg) + - ' us' + lat_perc_str +lat_max_prefix+'{:>6.0f}'.format(lat_max) - + ' us | ' + '{:>9.0f}'.format(tx) + ' | {:>9.0f}'.format(rx) + - ' | '+ abs_drop_rate_prefix+ '{:>9.0f}'.format(tx-rx) + - tot_drop_str +drop_rate_prefix + - '{:>5.2f}'.format(100*old_div(float(tx-rx),tx)) + bcolors.ENDC + + pps_rx_str + prefix['lat_avg'] + ' {:>6.0f}'.format(data['lat_avg']) + + ' us' + lat_perc_str +prefix['lat_max']+'{:>6.0f}'.format(data['lat_max']) + + ' us | ' + '{:>9.0f}'.format(data['abs_tx']) + ' | {:>9.0f}'.format(data['abs_rx']) + + ' | '+ prefix['abs_drop_rate']+ '{:>9.0f}'.format(data['abs_tx']-data['abs_rx']) + + tot_drop_str + prefix['drop_rate'] + + '{:>5.2f}'.format(100*old_div(float(data['abs_tx']-data['abs_rx']),data['abs_tx'])) + bcolors.ENDC + ' |' + elapsed_time_str) - + def run_iteration(self, requested_duration, flow_number, size, speed): BUCKET_SIZE_EXP = self.gen_machine.bucket_size_exp LAT_PERCENTILE = self.test['lat_percentile'] - r = 0; + iteration_data= {} + time_loop_data= {} + iteration_data['r'] = 0; sleep_time = 2 - while (r < self.test['maxr']): + while (iteration_data['r'] < self.test['maxr']): self.gen_machine.start_latency_cores() time.sleep(sleep_time) # Sleep_time is needed to be able to do accurate measurements to check for packet loss. We need to make this time large enough so that we do not take the first measurement while some packets from the previous tests migth still be in flight @@ -207,6 +206,7 @@ class RapidTest(object): self.gen_machine.set_generator_speed(speed) if self.background_machines: self.set_background_speed(self.background_machines, speed) + iteration_data['speed'] = time_loop_data['speed'] = speed time.sleep(2) ## Needs to be 2 seconds since this 1 sec is the time that PROX uses to refresh the stats. Note that this can be changed in PROX!! Don't do it. start_bg_gen_stats = [] for bg_gen_machine in self.background_machines: @@ -221,66 +221,76 @@ class RapidTest(object): t2_sut_rx, t2_sut_non_dp_rx, t2_sut_tx, t2_sut_non_dp_tx, t2_sut_drop, t2_sut_tx_fail, t2_sut_tsc, sut_tsc_hz = self.sut_machine.core_stats() t2_rx, t2_non_dp_rx, t2_tx, t2_non_dp_tx, t2_drop, t2_tx_fail, t2_tsc, tsc_hz = self.gen_machine.core_stats() tx = t2_tx - t1_tx - dp_tx = tx - (t2_non_dp_tx - t1_non_dp_tx ) - dp_rx = t2_rx - t1_rx - (t2_non_dp_rx - t1_non_dp_rx) - tot_dp_drop = dp_tx - dp_rx + iteration_data['abs_tx'] = tx - (t2_non_dp_tx - t1_non_dp_tx ) + iteration_data['abs_rx'] = t2_rx - t1_rx - (t2_non_dp_rx - t1_non_dp_rx) + iteration_data['abs_dropped'] = iteration_data['abs_tx'] - iteration_data['abs_rx'] if tx == 0: RapidLog.critical("TX = 0. Test interrupted since no packet has been sent.") - if dp_tx == 0: + if iteration_data['abs_tx'] == 0: RapidLog.critical("Only non-dataplane packets (e.g. ARP) sent. Test interrupted since no packet has been sent.") # Ask PROX to calibrate the bucket size once we have a PROX function to do this. # Measure latency statistics per second - lat_min, lat_max, lat_avg, used_avg, t2_lat_tsc, lat_hz, buckets = self.gen_machine.lat_stats() - lat_samples = sum(buckets) + iteration_data.update(self.gen_machine.lat_stats()) + t2_lat_tsc = iteration_data['lat_tsc'] sample_count = 0 - for sample_percentile, bucket in enumerate(buckets,start=1): + for sample_percentile, bucket in enumerate(iteration_data['buckets'],start=1): sample_count += bucket - if sample_count > (lat_samples * LAT_PERCENTILE): + if sample_count > sum(iteration_data['buckets']) * LAT_PERCENTILE: break - percentile_max = (sample_percentile == len(buckets)) - sample_percentile = sample_percentile * float(2 ** BUCKET_SIZE_EXP) / (old_div(float(lat_hz),float(10**6))) + iteration_data['lat_perc_max'] = (sample_percentile == len(iteration_data['buckets'])) + iteration_data['bucket_size'] = float(2 ** BUCKET_SIZE_EXP) / (old_div(float(iteration_data['lat_hz']),float(10**6))) + time_loop_data['bucket_size'] = iteration_data['bucket_size'] + iteration_data['lat_perc'] = sample_percentile * iteration_data['bucket_size'] if self.test['test'] == 'fixed_rate': - RapidLog.info(self.report_result(flow_number,size,speed,None,None,None,None,lat_avg,sample_percentile,percentile_max,lat_max, dp_tx, dp_rx , None, None)) + iteration_data['pps_req_tx'] = None + iteration_data['pps_tx'] = None + iteration_data['pps_sut_tx'] = None + iteration_data['pps_rx'] = None + iteration_data['lat_perc'] = None + iteration_data['actual_duration'] = None + iteration_prefix = {'speed' : '', + 'lat_avg' : '', + 'lat_perc' : '', + 'lat_max' : '', + 'abs_drop_rate' : '', + 'drop_rate' : ''} + RapidLog.info(self.report_result(flow_number, size, + iteration_data, iteration_prefix )) tot_rx = tot_non_dp_rx = tot_tx = tot_non_dp_tx = tot_drop = 0 - lat_avg = used_avg = 0 - buckets_total = buckets - tot_lat_samples = sum(buckets) + iteration_data['lat_avg'] = iteration_data['lat_used'] = 0 tot_lat_measurement_duration = float(0) - tot_core_measurement_duration = float(0) + iteration_data['actual_duration'] = float(0) tot_sut_core_measurement_duration = float(0) tot_sut_rx = tot_sut_non_dp_rx = tot_sut_tx = tot_sut_non_dp_tx = tot_sut_drop = tot_sut_tx_fail = tot_sut_tsc = 0 lat_avail = core_avail = sut_avail = False - while (tot_core_measurement_duration - float(requested_duration) <= 0.1) or (tot_lat_measurement_duration - float(requested_duration) <= 0.1): + while (iteration_data['actual_duration'] - float(requested_duration) <= 0.1) or (tot_lat_measurement_duration - float(requested_duration) <= 0.1): time.sleep(0.5) - lat_min_sample, lat_max_sample, lat_avg_sample, used_sample, t3_lat_tsc, lat_hz, buckets = self.gen_machine.lat_stats() + time_loop_data.update(self.gen_machine.lat_stats()) # Get statistics after some execution time - if t3_lat_tsc != t2_lat_tsc: - single_lat_measurement_duration = (t3_lat_tsc - t2_lat_tsc) * 1.0 / lat_hz # time difference between the 2 measurements, expressed in seconds. + if time_loop_data['lat_tsc'] != t2_lat_tsc: + single_lat_measurement_duration = (time_loop_data['lat_tsc'] - t2_lat_tsc) * 1.0 / time_loop_data['lat_hz'] # time difference between the 2 measurements, expressed in seconds. # A second has passed in between to lat_stats requests. Hence we need to process the results tot_lat_measurement_duration = tot_lat_measurement_duration + single_lat_measurement_duration - if lat_min > lat_min_sample: - lat_min = lat_min_sample - if lat_max < lat_max_sample: - lat_max = lat_max_sample - lat_avg = lat_avg + lat_avg_sample * single_lat_measurement_duration # Sometimes, There is more than 1 second between 2 lat_stats. Hence we will take the latest measurement - used_avg = used_avg + used_sample * single_lat_measurement_duration # and give it more weigth. - lat_samples = sum(buckets) - tot_lat_samples += lat_samples + if iteration_data['lat_min'] > time_loop_data['lat_min']: + iteration_data['lat_min'] = time_loop_data['lat_min'] + if iteration_data['lat_max'] < time_loop_data['lat_max']: + iteration_data['lat_max'] = time_loop_data['lat_max'] + iteration_data['lat_avg'] = iteration_data['lat_avg'] + time_loop_data['lat_avg'] * single_lat_measurement_duration # Sometimes, There is more than 1 second between 2 lat_stats. Hence we will take the latest measurement + iteration_data['lat_used'] = iteration_data['lat_used'] + time_loop_data['lat_used'] * single_lat_measurement_duration # and give it more weigth. sample_count = 0 - for sample_percentile, bucket in enumerate(buckets,start=1): + for sample_percentile, bucket in enumerate(time_loop_data['buckets'],start=1): sample_count += bucket - if sample_count > lat_samples * LAT_PERCENTILE: + if sample_count > sum(time_loop_data['buckets']) * LAT_PERCENTILE: break - percentile_max = (sample_percentile == len(buckets)) - bucket_size = float(2 ** BUCKET_SIZE_EXP) / (old_div(float(lat_hz),float(10**6))) - sample_percentile = sample_percentile * bucket_size - buckets_total = [buckets_total[i] + buckets[i] for i in range(len(buckets_total))] - t2_lat_tsc = t3_lat_tsc + time_loop_data['lat_perc_max'] = (sample_percentile == len(time_loop_data['buckets'])) + time_loop_data['lat_perc'] = sample_percentile * iteration_data['bucket_size'] + iteration_data['buckets'] = [iteration_data['buckets'][i] + time_loop_data['buckets'][i] for i in range(len(iteration_data['buckets']))] + t2_lat_tsc = time_loop_data['lat_tsc'] lat_avail = True t3_rx, t3_non_dp_rx, t3_tx, t3_non_dp_tx, t3_drop, t3_tx_fail, t3_tsc, tsc_hz = self.gen_machine.core_stats() if t3_tsc != t2_tsc: - single_core_measurement_duration = (t3_tsc - t2_tsc) * 1.0 / tsc_hz # time difference between the 2 measurements, expressed in seconds. - tot_core_measurement_duration = tot_core_measurement_duration + single_core_measurement_duration + time_loop_data['actual_duration'] = (t3_tsc - t2_tsc) * 1.0 / tsc_hz # time difference between the 2 measurements, expressed in seconds. + iteration_data['actual_duration'] = iteration_data['actual_duration'] + time_loop_data['actual_duration'] delta_rx = t3_rx - t2_rx tot_rx += delta_rx delta_non_dp_rx = t3_non_dp_rx - t2_non_dp_rx @@ -291,8 +301,8 @@ class RapidTest(object): tot_non_dp_tx += delta_non_dp_tx delta_dp_tx = delta_tx -delta_non_dp_tx delta_dp_rx = delta_rx -delta_non_dp_rx - delta_dp_drop = delta_dp_tx - delta_dp_rx - tot_dp_drop += delta_dp_drop + time_loop_data['abs_dropped'] = delta_dp_tx - delta_dp_rx + iteration_data['abs_dropped'] += time_loop_data['abs_dropped'] delta_drop = t3_drop - t2_drop tot_drop += delta_drop t2_rx, t2_non_dp_rx, t2_tx, t2_non_dp_tx, t2_drop, t2_tx_fail, t2_tsc = t3_rx, t3_non_dp_rx, t3_tx, t3_non_dp_tx, t3_drop, t3_tx_fail, t3_tsc @@ -313,37 +323,30 @@ class RapidTest(object): if self.test['test'] == 'fixed_rate': if lat_avail == core_avail == True: lat_avail = core_avail = False - pps_req_tx = (delta_tx + delta_drop - delta_rx)/single_core_measurement_duration/1000000 - pps_tx = delta_tx/single_core_measurement_duration/1000000 + time_loop_data['pps_req_tx'] = (delta_tx + delta_drop - delta_rx)/time_loop_data['actual_duration']/1000000 + time_loop_data['pps_tx'] = delta_tx/time_loop_data['actual_duration']/1000000 if self.sut_machine != None and sut_avail: - pps_sut_tx = delta_sut_tx/single_sut_core_measurement_duration/1000000 + time_loop_data['pps_sut_tx'] = delta_sut_tx/single_sut_core_measurement_duration/1000000 sut_avail = False else: - pps_sut_tx = None - pps_rx = delta_rx/single_core_measurement_duration/1000000 - RapidLog.info(self.report_result(flow_number, size, - speed, pps_req_tx, pps_tx, pps_sut_tx, pps_rx, - lat_avg_sample, sample_percentile, percentile_max, - lat_max_sample, delta_dp_tx, delta_dp_rx, - tot_dp_drop, single_core_measurement_duration)) - variables = { - 'Flows': flow_number, - 'Size': size, - 'RequestedSpeed': self.get_pps(speed,size), - 'CoreGenerated': pps_req_tx, - 'SentByNIC': pps_tx, - 'FwdBySUT': pps_sut_tx, - 'RevByCore': pps_rx, - 'AvgLatency': lat_avg_sample, - 'PCTLatency': sample_percentile, - 'MaxLatency': lat_max_sample, - 'PacketsSent': delta_dp_tx, - 'PacketsReceived': delta_dp_rx, - 'PacketsLost': tot_dp_drop, - 'bucket_size': bucket_size, - 'buckets': buckets} - - self.post_data('rapid_flowsizetest', variables) + time_loop_data['pps_sut_tx'] = None + time_loop_data['pps_rx'] = delta_rx/time_loop_data['actual_duration']/1000000 + time_loop_data['abs_tx'] = delta_dp_tx + time_loop_data['abs_rx'] = delta_dp_rx + time_loop_prefix = {'speed' : '', + 'lat_avg' : '', + 'lat_perc' : '', + 'lat_max' : '', + 'abs_drop_rate' : '', + 'drop_rate' : ''} + RapidLog.info(self.report_result(flow_number, size, time_loop_data, + time_loop_prefix)) + time_loop_data['test'] = self.test['testname'] + time_loop_data['environment_file'] = self.test['environment_file'] + time_loop_data['Flows'] = flow_number + time_loop_data['Size'] = size + time_loop_data['RequestedSpeed'] = RapidTest.get_pps(speed, size) + _ = self.post_data('rapid_flowsizetest', time_loop_data) end_bg_gen_stats = [] for bg_gen_machine in self.background_machines: bg_rx, bg_non_dp_rx, bg_tx, bg_non_dp_tx, _, _, bg_tsc, bg_hz = bg_gen_machine.core_stats() @@ -353,6 +356,8 @@ class RapidTest(object): "bg_hz" : bg_hz } end_bg_gen_stats.append(dict(bg_gen_stat)) + if self.background_machines: + self.stop_background_traffic(self.background_machines) i = 0 bg_rates =[] while i < len(end_bg_gen_stats): @@ -361,69 +366,65 @@ class RapidTest(object): start_bg_gen_stats[i]['bg_tsc']) * 1.0 / end_bg_gen_stats[i]['bg_hz'])) i += 1 if len(bg_rates): - avg_bg_rate = sum(bg_rates) / len(bg_rates) - RapidLog.debug('Average Background traffic rate: {:>7.3f} Mpps'.format(avg_bg_rate)) + iteration_data['avg_bg_rate'] = sum(bg_rates) / len(bg_rates) + RapidLog.debug('Average Background traffic rate: {:>7.3f} Mpps'.format(iteration_data['avg_bg_rate'])) else: - avg_bg_rate = None + iteration_data['avg_bg_rate'] = None #Stop generating self.gen_machine.stop_gen_cores() - r += 1 - lat_avg = old_div(lat_avg, float(tot_lat_measurement_duration)) - used_avg = old_div(used_avg, float(tot_lat_measurement_duration)) + iteration_data['r'] += 1 + iteration_data['lat_avg'] = old_div(iteration_data['lat_avg'], float(tot_lat_measurement_duration)) + iteration_data['lat_used'] = old_div(iteration_data['lat_used'], float(tot_lat_measurement_duration)) t4_tsc = t2_tsc while t4_tsc == t2_tsc: t4_rx, t4_non_dp_rx, t4_tx, t4_non_dp_tx, t4_drop, t4_tx_fail, t4_tsc, abs_tsc_hz = self.gen_machine.core_stats() if self.test['test'] == 'fixed_rate': - t4_lat_tsc = t2_lat_tsc - while t4_lat_tsc == t2_lat_tsc: - lat_min_sample, lat_max_sample, lat_avg_sample, used_sample, t4_lat_tsc, lat_hz, buckets = self.gen_machine.lat_stats() + iteration_data['lat_tsc'] = t2_lat_tsc + while iteration_data['lat_tsc'] == t2_lat_tsc: + iteration_data.update(self.gen_machine.lat_stats()) sample_count = 0 - lat_samples = sum(buckets) - for percentile, bucket in enumerate(buckets,start=1): + for percentile, bucket in enumerate(iteration_data['buckets'],start=1): sample_count += bucket - if sample_count > lat_samples * LAT_PERCENTILE: + if sample_count > sum(iteration_data['buckets']) * LAT_PERCENTILE: break - percentile_max = (percentile == len(buckets)) - percentile = percentile * bucket_size - lat_max = lat_max_sample - lat_avg = lat_avg_sample + iteration_data['lat_perc_max'] = (percentile == len(iteration_data['buckets'])) + iteration_data['lat_perc'] = percentile * iteration_data['bucket_size'] delta_rx = t4_rx - t2_rx delta_non_dp_rx = t4_non_dp_rx - t2_non_dp_rx delta_tx = t4_tx - t2_tx delta_non_dp_tx = t4_non_dp_tx - t2_non_dp_tx delta_dp_tx = delta_tx -delta_non_dp_tx delta_dp_rx = delta_rx -delta_non_dp_rx - dp_tx = delta_dp_tx - dp_rx = delta_dp_rx - tot_dp_drop += delta_dp_tx - delta_dp_rx - pps_req_tx = None - pps_tx = None - pps_sut_tx = None - pps_rx = None - drop_rate = 100.0*(dp_tx-dp_rx)/dp_tx - tot_core_measurement_duration = None + iteration_data['abs_tx'] = delta_dp_tx + iteration_data['abs_rx'] = delta_dp_rx + iteration_data['abs_dropped'] += delta_dp_tx - delta_dp_rx + iteration_data['pps_req_tx'] = None + iteration_data['pps_tx'] = None + iteration_data['pps_sut_tx'] = None + iteration_data['drop_rate'] = 100.0*(iteration_data['abs_tx']-iteration_data['abs_rx'])/iteration_data['abs_tx'] + iteration_data['actual_duration'] = None break ## Not really needed since the while loop will stop when evaluating the value of r else: sample_count = 0 - buckets = buckets_total - for percentile, bucket in enumerate(buckets_total,start=1): + for percentile, bucket in enumerate(iteration_data['buckets'],start=1): sample_count += bucket - if sample_count > tot_lat_samples * LAT_PERCENTILE: + if sample_count > sum(iteration_data['buckets']) * LAT_PERCENTILE: break - percentile_max = (percentile == len(buckets_total)) - percentile = percentile * bucket_size - pps_req_tx = (tot_tx + tot_drop - tot_rx)/tot_core_measurement_duration/1000000.0 # tot_drop is all packets dropped by all tasks. This includes packets dropped at the generator task + packets dropped by the nop task. In steady state, this equals to the number of packets received by this VM - pps_tx = tot_tx/tot_core_measurement_duration/1000000.0 # tot_tx is all generated packets actually accepted by the interface - pps_rx = tot_rx/tot_core_measurement_duration/1000000.0 # tot_rx is all packets received by the nop task = all packets received in the gen VM + iteration_data['lat_perc_max'] = (percentile == len(iteration_data['buckets'])) + iteration_data['lat_perc'] = percentile * iteration_data['bucket_size'] + iteration_data['pps_req_tx'] = (tot_tx + tot_drop - tot_rx)/iteration_data['actual_duration']/1000000.0 # tot_drop is all packets dropped by all tasks. This includes packets dropped at the generator task + packets dropped by the nop task. In steady state, this equals to the number of packets received by this VM + iteration_data['pps_tx'] = tot_tx/iteration_data['actual_duration']/1000000.0 # tot_tx is all generated packets actually accepted by the interface + iteration_data['pps_rx'] = tot_rx/iteration_data['actual_duration']/1000000.0 # tot_rx is all packets received by the nop task = all packets received in the gen VM if self.sut_machine != None and sut_avail: - pps_sut_tx = tot_sut_tx / tot_sut_core_measurement_duration / 1000000.0 + iteration_data['pps_sut_tx'] = tot_sut_tx / tot_sut_core_measurement_duration / 1000000.0 else: - pps_sut_tx = None - dp_tx = (t4_tx - t1_tx) - (t4_non_dp_tx - t1_non_dp_tx) - dp_rx = (t4_rx - t1_rx) - (t4_non_dp_rx - t1_non_dp_rx) - tot_dp_drop = dp_tx - dp_rx - drop_rate = 100.0*tot_dp_drop/dp_tx - if ((drop_rate < self.test['drop_rate_threshold']) or (tot_dp_drop == self.test['drop_rate_threshold'] ==0) or (tot_dp_drop > self.test['maxz'])): + iteration_data['pps_sut_tx'] = None + iteration_data['abs_tx'] = (t4_tx - t1_tx) - (t4_non_dp_tx - t1_non_dp_tx) + iteration_data['abs_rx'] = (t4_rx - t1_rx) - (t4_non_dp_rx - t1_non_dp_rx) + iteration_data['abs_dropped'] = iteration_data['abs_tx'] - iteration_data['abs_rx'] + iteration_data['drop_rate'] = 100.0*iteration_data['abs_dropped']/iteration_data['abs_tx'] + if ((iteration_data['drop_rate'] < self.test['drop_rate_threshold']) or (iteration_data['abs_dropped'] == self.test['drop_rate_threshold'] ==0) or (iteration_data['abs_dropped'] > self.test['maxz'])): break self.gen_machine.stop_latency_cores() - return(pps_req_tx,pps_tx,pps_sut_tx,pps_rx,lat_avg,percentile,percentile_max,lat_max,dp_tx,dp_rx,tot_dp_drop,(t4_tx_fail - t1_tx_fail),drop_rate,lat_min,used_avg,r,tot_core_measurement_duration,avg_bg_rate,bucket_size,buckets) + iteration_data['abs_tx_fail'] = t4_tx_fail - t1_tx_fail + return (iteration_data) |