Exemplo n.º 1
0
            next(cpu_fetcher)

            lahti.set_args("-i", "all", "-f", "0,", "-v", "4", "-p", psize)
            marcel.set_args("-i", "all", "-f", "0,", "-v", "4", "-p", psize)

            with lahti, marcel:
                # Run.
                env.execute_main('single-port-multi-cpu.py', sys.argv[1], running_time=20.0)

                # Retrieve the results.
                print('{0:5} {1:5} {2:5} {3:5} {4:5} {5:6}'.format(*params), end=' ')

                for thruput in thruput_fetcher:
                    print('totalpkt: {0:10,}'.format(thruput.total_fwd_pps), end=' ')

                    io_cores = env.get_io_cores(8)
                    comp_cores = env.get_comp_cores(8, 'same')
                    for cpu_usages in cpu_fetcher:
                        cpu_usage = tuple(filter(lambda o: str(o.core) == str(0), cpu_usages))
                        if cpu_usage:
                            print('{0:6.2f} {1:6.2f}'.format(cpu_usage[0].usr, cpu_usage[0].sys), end=' ')
                        cpu_usage = tuple(filter(lambda o: str(o.core) == str(16), cpu_usages))
                        if cpu_usage:
                            print('{0:6.2f} {1:6.2f}'.format(cpu_usage[0].usr, cpu_usage[0].sys))

                sys.stdout.flush()
                time.sleep(3)

        # Print max result.
        #max_result.print_result()
Exemplo n.º 2
0
                outfile.close()

                # Run.
                loop = asyncio.get_event_loop()
                loop.run_until_complete(env.execute_main('single-port-multi-cpu.py', "__temp.click", running_time=20.0))

                # Retrieve the results.
                print('{0:5} {1:5} {2:5} {3:5} {4:5} {5:5} pkt{6:6} count{7:7} {8:8}Gbps'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8]), end=' ')

                for thruput in thruput_fetcher:
                    print('delay: {0:10}'.format(marcel.get_delay()), end=' ')
                    print('totalpkt: {0:10}'.format(thruput.total_fwd_pps), end=' ')
                    print('totaldrop: {0:10}'.format(thruput.total_in_errs), end=' ')

                    io_cores = env.get_io_cores(8)
                    comp_cores = env.get_comp_cores(8, 'sibling')
                    for cpu_usages in cpu_fetcher:
                        cpu_usage = tuple(filter(lambda o: str(o.core) == str(0), cpu_usages))
                        if cpu_usage:
                            print('{0:6.2f} {1:6.2f}'.format(cpu_usage[0].usr, cpu_usage[0].sys), end=' ')
                        cpu_usage = tuple(filter(lambda o: str(o.core) == str(16), cpu_usages))
                        if cpu_usage:
                            print('{0:6.2f} {1:6.2f}'.format(cpu_usage[0].usr, cpu_usage[0].sys))

                os.remove(temp_path)

                    # Check max result.
                sys.stdout.flush()

            time.sleep(3)
Exemplo n.º 3
0
            with lahti, marcel:
                # Run.
                env.execute_main('single-port-multi-cpu.py',
                                 sys.argv[1],
                                 running_time=20.0)

                # Retrieve the results.
                print('{0:5} {1:5} {2:5} {3:5} {4:5} {5:6}'.format(*params),
                      end=' ')

                for thruput in thruput_fetcher:
                    print('totalpkt: {0:10,}'.format(thruput.total_fwd_pps),
                          end=' ')

                    io_cores = env.get_io_cores(8)
                    comp_cores = env.get_comp_cores(8, 'same')
                    for cpu_usages in cpu_fetcher:
                        cpu_usage = tuple(
                            filter(lambda o: str(o.core) == str(0),
                                   cpu_usages))
                        if cpu_usage:
                            print('{0:6.2f} {1:6.2f}'.format(
                                cpu_usage[0].usr, cpu_usage[0].sys),
                                  end=' ')
                        cpu_usage = tuple(
                            filter(lambda o: str(o.core) == str(16),
                                   cpu_usages))
                        if cpu_usage:
                            print('{0:6.2f} {1:6.2f}'.format(
                                cpu_usage[0].usr, cpu_usage[0].sys))