'Generate timings for different amounts of asset metadata and different modulestores.'

@ddt.data(*itertools.product(MODULESTORE_SETUPS, ASSET_AMOUNT_PER_TEST))
@ddt.unpack
def test_generate_find_timings(self, source_ms, num_assets):

    if (CodeBlockTimer is None):
        raise SkipTest('CodeBlockTimer    undefined.')
    desc = 'FindAssetTest:{}:{}'.format(SHORT_NAME_MAP[source_ms], num_assets)
    with CodeBlockTimer(desc):
        with CodeBlockTimer('fake_assets'):
            make_asset_xml(num_assets, ASSET_XML_PATH)
            validate_xml(ASSET_XSD_PATH, ASSET_XML_PATH)
        with source_ms.build() as (source_content, source_store):
            source_course_key = source_store.make_course_key('a', 'course', 'course')
            asset_key = source_course_key.make_asset_key(AssetMetadata.GENERAL_ASSET_TYPE, 'silly_cat_picture.gif')
            with CodeBlockTimer('initial_import'):
                import_course_from_xml(source_store, 'test_user', TEST_DATA_ROOT, source_dirs=TEST_COURSE, static_content_store=source_content, target_id=source_course_key, create_if_not_present=True, raise_on_failure=True)
            with CodeBlockTimer('find_nonexistent_asset'):
                __ = source_store.find_asset_metadata(asset_key)
            for sort in ALL_SORTS:
                with CodeBlockTimer('get_asset_list:{}-{}'.format(sort[0], ('asc' if (sort[1] == ModuleStoreEnum.SortOrder.ascending) else 'desc'))):
                    start_middle = (num_assets / 2)
                    __ = source_store.get_all_asset_metadata(source_course_key, 'asset', start=0, sort=sort, maxresults=50)
                    __ = source_store.get_all_asset_metadata(source_course_key, 'asset', start=start_middle, sort=sort, maxresults=50)
