16, in_args.flows, in_args.startflow, in_args.auth)
    # Get the baseline stats. Required in Step 3 to validate if the delete
    # function gets the controller back to the baseline
    ic.crawl_inventory()
    reported = ic.reported_flows
    found = ic.found_flows

    print 'Baseline:'
    print '   Reported nodes: %d' % reported
    print '   Found nodes:    %d' % found

    stats = []
    stats.append((time.time(), ic.nodes, ic.reported_flows, ic.found_flows))
    # 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()

    # 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)
Exemple #2
0
                             in_args.threads, in_args.fpr, 16, in_args.flows,
                             in_args.startflow, in_args.auth)
    # Get the baseline stats. Required in Step 3 to validate if the delete
    # function gets the controller back to the baseline
    #ic.crawl_inventory()
    #reported = ic.reported_flows
    #found = ic.found_flows

    #print 'Baseline:'
    #print '   Reported flows: %d' % reported
    #print '   Found flows:    %d' % found

    # Run through <CYCLES> add cycles, where <THREADS> threads are started in
    # each cycle and <FLOWS> flows are added from each thread
    start = time.time()
    fct.add_blaster()
    fct2.add_blaster()
    fct3.add_blaster()
    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)
Exemple #3
0
    fct = FlowConfigBlaster(in_args.host, in_args.port, in_args.cycles,
                            in_args.threads, in_args.nodes, in_args.flows,
                            in_args.startflow, in_args.auth, JSON_FLOW_MOD1)

    # Get baseline stats
    ic.crawl_inventory()
    reported = ic.reported_flows
    found = ic.found_flows

    print 'Baseline:'
    print '   Reported nodes: %d' % reported
    print '   Found nodes:    %d' % found

    # Run through <cycles>, where <threads> are started in each cycle and <flows> are added from each thread
    fct.add_blaster()

    print '\n*** Total flows added: %s' % fct.get_total_flows()
    print '    HTTP[OK] results:  %d\n' % fct.get_ok_flows()

    # Wait for stats to catch up
    total_delay = 0
    exp_found = found + fct.get_ok_flows()
    exp_reported = reported + fct.get_ok_flows()

    print 'Waiting for stats to catch up:'
    while True:
        ic.crawl_inventory()
        print '   %d, %d' % (ic.reported_flows, ic.found_flows)
        if ic.found_flows == exp_found or total_delay > in_args.timeout:
            break
    fct3 = FlowConfigBlaster('192.168.1.3', in_args.port, in_args.cycles, in_args.threads, in_args.fpr,
                            16, in_args.flows, in_args.startflow, in_args.auth)
    # Get the baseline stats. Required in Step 3 to validate if the delete
    # function gets the controller back to the baseline
    #ic.crawl_inventory()
    #reported = ic.reported_flows
    #found = ic.found_flows

    #print 'Baseline:'
    #print '   Reported flows: %d' % reported
    #print '   Found flows:    %d' % found

    # Run through <CYCLES> add cycles, where <THREADS> threads are started in
    # each cycle and <FLOWS> flows are added from each thread
    start = time.time()
    fct.add_blaster()
    fct2.add_blaster()
    fct3.add_blaster()
    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