Пример #1
0
 def get_summary(self):
     try:
         summary = 'Upload:\n'
         summary += '  %s: %s\t%s: %s\n' % \
               ('Transferred'.ljust(11), DataFormatter.format_bytes(self.get_up_transferred()),
                'Speed'.ljust(11), DataFormatter.format_bits(self.get_up_speed()))
         summary += '  %s: %s\t%s: %s\n' % \
               ('Min'.ljust(11), DataFormatter.format_bits(self.get_up_speed_min()),
                'Max'.ljust(11), DataFormatter.format_bits(self.get_up_speed_max()))
         summary += '  %s: %2.2f%%\n' % ('Jitter'.ljust(11), self.get_up_jitter())
         summary += 'Download:\n'
         summary += '  %s: %s\t%s: %s\n' % \
               ('Transferred'.ljust(11), DataFormatter.format_bytes(self.get_down_transferred()),
                'Speed'.ljust(11), DataFormatter.format_bits(self.get_down_speed()))
         summary += '  %s: %s\t%s: %s\n' % \
               ('Min'.ljust(11), DataFormatter.format_bits(self.get_down_speed_min()),
                'Max'.ljust(11), DataFormatter.format_bits(self.get_down_speed_max()))
         summary += '  %s: %2.2f%%\n' % ('Jitter'.ljust(11), self.get_down_jitter())
         return summary
     except:
         pass
Пример #2
0
 def process_csv(self, csv_line, updown):
     data = csv_line.split(',')
     if self.cli:
         print ' %s sec \t%s\t%s/sec' % \
               (data[self.TIME_RANGE],
                DataFormatter.format_bytes(data[IPerfTest.TRANSFERED]),
                DataFormatter.format_bits(data[IPerfTest.SPEED])
               )
     if updown == 'up':
         self.process_up_csv(data)
     else:
         self.process_down_csv(data)
Пример #3
0
 def print_summary(self):
     print '-' * IPerfTest.PRINT_WIDTH
     print '|%s|' % self.description.center(IPerfTest.PRINT_WIDTH - 2)
     print '|%s|' % 'Summary'.center(IPerfTest.PRINT_WIDTH - 2)
     print '-' * IPerfTest.PRINT_WIDTH
     try:
         print 'Upload:'
         print '  %s: %s\t%s: %s' % \
               ('Transferred'.ljust(11), DataFormatter.format_bytes(self.get_up_transferred()),
                'Speed'.ljust(11), DataFormatter.format_bits(self.get_avg_up_speed()))
         print '  %s: %s\t%s: %s' % \
               ('Min'.ljust(11), DataFormatter.format_bits(self.total_up_min),
                'Max'.ljust(11), DataFormatter.format_bits(self.total_up_max))
         print '  %s: %2.2f%%' % ('Jitter'.ljust(11), self.get_up_jitter())
         print 'Download:'
         print '  %s: %s\t%s: %s' % \
               ('Transferred'.ljust(11), DataFormatter.format_bytes(self.get_down_transferred()),
                'Speed'.ljust(11), DataFormatter.format_bits(self.get_avg_down_speed()))
         print '  %s: %s\t%s: %s' % \
               ('Min'.ljust(11), DataFormatter.format_bits(self.total_down_min),
                'Max'.ljust(11), DataFormatter.format_bits(self.total_down_max))
         print '  %s: %2.2f%%' % ('Jitter'.ljust(11), self.get_down_jitter())
     except:
         pass