In the case of shared net, some columns in packets array can have ''.
Some columns cab also be None which means the data is not available.
"""
In the case of shared net, some columns in packets array can have ''.
Some columns cab also be None which means the data is not available.
"""
def standard(data):
if isinstance(data, int):
return Formatter.int(data)
def standard(data):
if isinstance(data, int):
return Formatter.int(data)
"""ASCII readable table class."""
def __init__(self, header):
"""ASCII readable table class."""
def __init__(self, header):
def _put_dict(self, data):
with self._create_block(False):
def _put_dict(self, data):
with self._create_block(False):
self._put(component + ':', version)
if self.config['ndr_run'] or self.config['pdr_run']:
self._put(component + ':', version)
if self.config['ndr_run'] or self.config['pdr_run']:
if self.config['pdr_run']:
self._put('PDR:', self.config['measurement']['PDR'])
self._put('Service chain:')
if self.config['pdr_run']:
self._put('PDR:', self.config['measurement']['PDR'])
self._put('Service chain:')
self._put('Bidirectional:', traffic_benchmark['bidirectional'])
self._put('Flow count:', traffic_benchmark['flow_count'])
self._put('Service chains count:', traffic_benchmark['service_chain_count'])
self._put('Bidirectional:', traffic_benchmark['bidirectional'])
self._put('Flow count:', traffic_benchmark['flow_count'])
self._put('Service chains count:', traffic_benchmark['service_chain_count'])
self.__record_header_put('profile', traffic_benchmark['profile'])
self.__record_header_put('bidirectional', traffic_benchmark['bidirectional'])
self.__record_header_put('flow_count', traffic_benchmark['flow_count'])
self.__record_header_put('sc_count', traffic_benchmark['service_chain_count'])
self.__record_header_put('profile', traffic_benchmark['profile'])
self.__record_header_put('bidirectional', traffic_benchmark['bidirectional'])
self.__record_header_put('flow_count', traffic_benchmark['flow_count'])
self.__record_header_put('sc_count', traffic_benchmark['service_chain_count'])
'max_delay_usec': analysis['pdr']['stats']['overall']['max_delay_usec']
}})
if self.config['single_run']:
'max_delay_usec': analysis['pdr']['stats']['overall']['max_delay_usec']
}})
if self.config['single_run']:
chain_stats: {
'interfaces': ['Port0', 'drop %'', 'vhost0', 'Port1'],
'chains': {
chain_stats: {
'interfaces': ['Port0', 'drop %'', 'vhost0', 'Port1'],
'chains': {
- 0: {'packets': [2000054, '-0.023%', 1999996, 1999996],
+ '0': {'packets': [2000054, '-0.023%', 1999996, 1999996],
lat_map = {'lat_avg_usec': 'Avg lat.',
'lat_min_usec': 'Min lat.',
'lat_max_usec': 'Max lat.'}
lat_map = {'lat_avg_usec': 'Avg lat.',
'lat_min_usec': 'Min lat.',
'lat_max_usec': 'Max lat.'}
lat_keys = ['lat_avg_usec', 'lat_min_usec', 'lat_max_usec']
for key in lat_keys:
header.append((lat_map[key], Formatter.standard))
table = Table(header)
lat_keys = ['lat_avg_usec', 'lat_min_usec', 'lat_max_usec']
for key in lat_keys:
header.append((lat_map[key], Formatter.standard))
table = Table(header)
row = [chain] + chains[chain]['packets']
for lat_key in lat_keys:
row.append('{:,} usec'.format(chains[chain][lat_key]))
row = [chain] + chains[chain]['packets']
for lat_key in lat_keys:
row.append('{:,} usec'.format(chains[chain][lat_key]))