def load_test_collection(project): ptm = PerformanceTestModel(project) products = ptm.get_products('id') product_names = {} for id in products: if products[ id ]['product'] and \ products[ id ]['version'] and \ products[ id ]['branch']: name = get_test_collection_name( products[ id ]['product'], products[ id ]['version'], products[ id ]['branch'] ) product_names[name] = id test_collection_names = ptm.get_test_collection_set() new_name_set = set( product_names.keys() ).difference( test_collection_names ) for new_name in new_name_set: id = ptm.set_test_collection(new_name, "") ptm.set_test_collection_map(id, product_names[ new_name ]) ptm.cache_ref_data() ptm.disconnect()
def set_default_products(project): ptm = PerformanceTestModel(project) products = ptm.get_products('id') versions = [ products[id]['version'] for id in products ] #sort version strings versions.sort( key=lambda s: map(numeric_prefix, s.split('.')), reverse=True ) if versions: current_version = versions[0] default_count = 0 for id in products: default = 0 if current_version == products[id]['version']: default_count += 1 #Don't load more than 10 datasets by default if default_count <= 10: default = 1 ptm.set_default_product(id, default) ptm.cache_default_project()
def set_default_products(project): ptm = PerformanceTestModel(project) products = ptm.get_products('id') versions = [products[id]['version'] for id in products] #sort version strings versions.sort(key=lambda s: map(numeric_prefix, s.split('.')), reverse=True) if versions: current_version = versions[0] default_count = 0 for id in products: default = 0 if current_version == products[id]['version']: default_count += 1 #Don't load more than 10 datasets by default if default_count <= 10: default = 1 ptm.set_default_product(id, default) ptm.cache_default_project()
def load_test_collection(project): ptm = PerformanceTestModel(project) products = ptm.get_products('id') product_names = {} for id in products: if products[ id ]['product'] and \ products[ id ]['version'] and \ products[ id ]['branch']: name = get_test_collection_name(products[id]['product'], products[id]['version'], products[id]['branch']) product_names[name] = id test_collection_names = ptm.get_test_collection_set() new_name_set = set(product_names.keys()).difference(test_collection_names) for new_name in new_name_set: id = ptm.set_test_collection(new_name, "") ptm.set_test_collection_map(id, product_names[new_name]) ptm.cache_ref_data() ptm.disconnect()
def build_test_summaries(project): ptm = PerformanceTestModel(project) time_ranges = utils.get_time_ranges() products = ptm.get_products() for product_name in products: for tr in ['days_7', 'days_30']: table = ptm.get_test_run_summary(str(time_ranges[tr]['start']), str(time_ranges[tr]['stop']), [products[product_name]], [], []) json_data = json.dumps(table) ptm.set_summary_cache(products[product_name], tr, json_data) ptm.disconnect()
def build_test_summaries(project): ptm = PerformanceTestModel(project) time_ranges = utils.get_time_ranges() products = ptm.get_products() for product_name in products: for tr in ['days_7', 'days_30']: table = ptm.get_test_run_summary(str( time_ranges[tr]['start']), str( time_ranges[tr]['stop']), [ products[ product_name ] ], [], []) json_data = json.dumps( table ) ptm.set_summary_cache( products[ product_name ], tr, json_data ) ptm.disconnect()