@@ -0,0 +1,2076 @@
+#!/usr/bin/env python%0A%22%22%22Perfscale test measuring adding and destroying a large number of models.%0A%0ASteps taken in this test:%0A  - Bootstraps a provider%0A  - Creates x amount of models and waits for them to be ready%0A  - Delete all the models at once.%0A%22%22%22%0A%0Aimport argparse%0Afrom datetime import datetime%0Aimport logging%0Aimport sys%0A%0Afrom deploy_stack import (%0A    BootstrapManager,%0A)%0Afrom generate_perfscale_results import (%0A    DeployDetails,%0A    TimingData,%0A    run_perfscale_test,%0A)%0Afrom utility import (%0A    add_basic_testing_arguments,%0A    configure_logging,%0A)%0A%0A%0Alog = logging.getLogger(%22perfscale_mass_model_destruction%22)%0A%0A__metaclass__ = type%0A%0A%0Adef perfscale_assess_model_destruction(client, args):%0A    %22%22%22Create a bunch of models and then destroy them all.%22%22%22%0A    model_count = args.model_count%0A%0A    all_models = %5B%5D%0A    for item in xrange(0, model_count):%0A        model_name = 'model%7B%7D'.format(item)%0A        log.info('Creating model: %7B%7D'.format(model_name))%0A        new_model = client.add_model(client.env.clone(model_name))%0A        new_model.wait_for_started()%0A        all_models.append(new_model)%0A%0A    destruction_start = datetime.utcnow()%0A    for doomed in all_models:%0A        doomed.destroy_model()%0A    destruction_end = datetime.utcnow()%0A%0A    destruction_timing = TimingData(destruction_start, destruction_end)%0A    return DeployDetails(%0A        'Destroy %7B%7D models'.format(model_count),%0A        %7B'Model Count': model_count%7D,%0A        destruction_timing)%0A%0A%0Adef parse_args(argv):%0A    %22%22%22Parse all arguments.%22%22%22%0A    parser = argparse.ArgumentParser(%0A        description=%22Perfscale bundle deployment test.%22)%0A    add_basic_testing_arguments(parser)%0A    parser.add_argument(%0A        '--model-count',%0A        help='Number of models to create.',%0A        default=100)%0A    return parser.parse_args(argv)%0A%0A%0Adef main(argv=None):%0A    args = parse_args(argv)%0A    configure_logging(args.verbose)%0A    bs_manager = BootstrapManager.from_args(args)%0A    run_perfscale_test(perfscale_assess_model_destruction, bs_manager, args)%0A%0A    return 0%0A%0A%0Aif __name__ == '__main__':%0A    sys.exit(main())%0A

Add mass model destruction test.