Example #1
0
 def show(self, buffer):
     stats = self.stateless_client._get_formatted_stats(
         port_id_list=None, stats_mask=trex_stl_stats.UT_COMPAT)
     # print stats to screen
     for stat_type, stat_data in stats.items():
         text_tables.print_table_with_header(stat_data.text_table,
                                             stat_type,
                                             buffer=buffer)
Example #2
0
 def show(self, buffer):
     stats = self.stateless_client._get_formatted_stats(
         self.get_showed_ports())
     # print stats to screen
     for stat_type, stat_data in stats.items():
         text_tables.print_table_with_header(stat_data.text_table,
                                             stat_type,
                                             buffer=buffer)
Example #3
0
 def show (self, buffer):
     if self.is_histogram:
         stats = self.stateless_client._get_formatted_stats(port_id_list = None, stats_mask = trex_stl_stats.LH_COMPAT)
     else:
         stats = self.stateless_client._get_formatted_stats(port_id_list = None, stats_mask = trex_stl_stats.LS_COMPAT)
     # print stats to screen
     for stat_type, stat_data in stats.items():
         if stat_type == 'latency_statistics':
             untouched_header = ' (usec)'
         else:
             untouched_header = ''
         text_tables.print_table_with_header(stat_data.text_table, stat_type, untouched_header = untouched_header, buffer = buffer)
Example #4
0
 def show (self, buffer):
     if self.is_histogram:
         stats = self.stateless_client._get_formatted_stats(port_id_list = None, stats_mask = trex_stl_stats.LH_COMPAT)
     else:
         stats = self.stateless_client._get_formatted_stats(port_id_list = None, stats_mask = trex_stl_stats.LS_COMPAT)
     # print stats to screen
     for stat_type, stat_data in stats.items():
         if stat_type == 'latency_statistics':
             untouched_header = ' (usec)'
         else:
             untouched_header = ''
         text_tables.print_table_with_header(stat_data.text_table, stat_type, untouched_header = untouched_header, buffer = buffer)
Example #5
0
    def parse_show(self, opts):
        data = self.c.get_capture_status()

        # captures
        cap_table = text_tables.TRexTextTable()
        cap_table.set_cols_align(["c"] * 6)
        cap_table.set_cols_width([15] * 6)

        # monitor
        mon_table = text_tables.TRexTextTable()
        mon_table.set_cols_align(["c"] * 6)
        mon_table.set_cols_width([15] * 6)

        for capture_id, elem in data.items():

            if self.monitor and (self.monitor.get_capture_id() == capture_id):
                row = self.monitor.get_mon_row()
                mon_table.add_rows([row], header=False)

            else:
                row = [
                    capture_id,
                    format_text(elem['state'], 'bold'),
                    '[{0}/{1}]'.format(elem['count'], elem['limit']),
                    format_num(elem['bytes'], suffix='B'),
                    bitfield_to_str(elem['filter']['tx']),
                    bitfield_to_str(elem['filter']['rx'])
                ]

                cap_table.add_rows([row], header=False)

        cap_table.header(
            ['ID', 'Status', 'Packets', 'Bytes', 'TX Ports', 'RX Ports'])
        mon_table.header([
            'ID', 'Status', 'Packets Seen', 'Bytes Seen', 'TX Ports',
            'RX Ports'
        ])

        if cap_table._rows:
            text_tables.print_table_with_header(cap_table,
                                                '\nActive Recorders')

        if mon_table._rows:
            text_tables.print_table_with_header(mon_table, '\nActive Monitor')
Example #6
0
 def show(self):
     stats = self.stateless_client._get_formatted_stats(self.ports)
     # print stats to screen
     for stat_type, stat_data in stats.iteritems():
         text_tables.print_table_with_header(stat_data.text_table,
                                             stat_type)
Example #7
0
 def show (self, buffer):
     stats = self.stateless_client._get_formatted_stats(port_id_list = None, stats_mask = trex_stl_stats.UT_COMPAT)
     # print stats to screen
     for stat_type, stat_data in stats.items():
         text_tables.print_table_with_header(stat_data.text_table, stat_type, buffer = buffer)
Example #8
0
 def show (self, buffer):
     stats = self.stateless_client._get_formatted_stats(self.get_showed_ports())
     # print stats to screen
     for stat_type, stat_data in stats.items():
         text_tables.print_table_with_header(stat_data.text_table, stat_type, buffer = buffer)
Example #9
0
 def show (self):
     stats = self.stateless_client._get_formatted_stats(self.ports)
     # print stats to screen
     for stat_type, stat_data in stats.iteritems():
         text_tables.print_table_with_header(stat_data.text_table, stat_type)