fct.add_blaster() print '\n*** Total flows added: %d' % fct.get_ok_flows() print ' HTTP[OK] results: %d\n' % fct.get_ok_rqsts() # monitor stats and save results in the list for stat_item in monitor_stats(ic, in_args.config_monitor, in_args.monitor_period): print stat_item stats.append(stat_item) # Run through <CYCLES> delete cycles, where <THREADS> threads are started # in each cycle and <FLOWS> flows previously added in an add cycle are # deleted in each thread if in_args.bulk_delete: print '\nDeleting all flows in bulk:' sts = cleanup_config_odl(in_args.host, in_args.port, in_args.auth) if sts != 200: print ' Failed to delete flows, code %d' % sts else: print ' All flows deleted.' else: print '\nDeleting flows one by one\n ', fct.delete_blaster() print '\n*** Total flows deleted: %d' % fct.get_ok_flows() print ' HTTP[OK] results: %d\n' % fct.get_ok_rqsts() # monitor stats and append to the list for stat_item in monitor_stats(ic, in_args.deconfig_monitor, in_args.monitor_period): print stat_item stats.append(stat_item)
print '\n*** Total flows added: %d' % ( fct.get_ok_flows() + fct2.get_ok_flows() + fct3.get_ok_flows()) print ' HTTP[OK] results: %d' % ( fct.get_ok_rqsts() + fct2.get_ok_rqsts() + fct3.get_ok_rqsts()) print ' Total elapsed time: %.2f' % (end - start) print ' Cluster avg requests/s: %.2f\n' % mean # Wait for stats to catch up #wait_for_stats(ic, found + fct.get_ok_flows(), in_args.timeout, in_args.delay) # Run through <CYCLES> delete cycles, where <THREADS> threads are started # in each cycle and <FLOWS> flows previously added in an add cycle are # deleted in each thread if in_args.bulk_delete: print '\nDeleting all flows in bulk:' sts = cleanup_config_odl('192.168.1.1', in_args.port, in_args.auth) sts = cleanup_config_odl('192.168.1.2', in_args.port, in_args.auth) sts = cleanup_config_odl('192.168.1.3', in_args.port, in_args.auth) if sts != 200: print ' Failed to delete flows, code %d' % sts else: print ' All flows deleted.' else: print '\nDeleting flows one by one\n ', fct.delete_blaster() print '\n*** Total flows deleted: %d' % fct.get_ok_flows() print ' HTTP[OK] results: %d\n' % fct.get_ok_rqsts() # Wait for stats to catch up back to baseline #wait_for_stats(ic, found, in_args.timeout, in_args.delay)
# Run through <CYCLES> add cycles, where <THREADS> threads are started in # each cycle and <FLOWS> flows are added from each thread fct.add_blaster() print '\n*** Total flows added: %d' % fct.get_ok_flows() print ' HTTP[OK] results: %d\n' % fct.get_ok_rqsts() # Wait for stats to catch up wait_for_stats(ic, found + fct.get_ok_flows(), in_args.timeout, in_args.delay) # Run through <CYCLES> delete cycles, where <THREADS> threads are started # in each cycle and <FLOWS> flows previously added in an add cycle are # deleted in each thread if in_args.bulk_delete: print '\nDeleting all flows in bulk:' sts = cleanup_config_odl(in_args.host, in_args.port, in_args.auth) if sts != 200: print ' Failed to delete flows, code %d' % sts else: print ' All flows deleted.' else: print '\nDeleting flows one by one\n ', fct.delete_blaster() print '\n*** Total flows deleted: %d' % fct.get_ok_flows() print ' HTTP[OK] results: %d\n' % fct.get_ok_rqsts() # Wait for stats to catch up back to baseline wait_for_stats(ic, found, in_args.timeout, in_args.delay)
end = time.time() mean = (fct.get_ok_flows()+fct2.get_ok_flows()+fct3.get_ok_flows())/(end - start) print '\n*** Total flows added: %d' % (fct.get_ok_flows()+fct2.get_ok_flows()+fct3.get_ok_flows()) print ' HTTP[OK] results: %d' % (fct.get_ok_rqsts()+fct2.get_ok_rqsts()+fct3.get_ok_rqsts()) print ' Total elapsed time: %.2f' % (end - start) print ' Cluster avg requests/s: %.2f\n' % mean # Wait for stats to catch up #wait_for_stats(ic, found + fct.get_ok_flows(), in_args.timeout, in_args.delay) # Run through <CYCLES> delete cycles, where <THREADS> threads are started # in each cycle and <FLOWS> flows previously added in an add cycle are # deleted in each thread if in_args.bulk_delete: print '\nDeleting all flows in bulk:' sts = cleanup_config_odl('192.168.1.1', in_args.port, in_args.auth) sts = cleanup_config_odl('192.168.1.2', in_args.port, in_args.auth) sts = cleanup_config_odl('192.168.1.3', in_args.port, in_args.auth) if sts != 200: print ' Failed to delete flows, code %d' % sts else: print ' All flows deleted.' else: print '\nDeleting flows one by one\n ', fct.delete_blaster() print '\n*** Total flows deleted: %d' % fct.get_ok_flows() print ' HTTP[OK] results: %d\n' % fct.get_ok_rqsts() # Wait for stats to catch up back to baseline #wait_for_stats(ic, found, in_args.timeout, in_args.delay)