def cache_test_summaries(project): ptm = PerformanceTestModel(project) ### #New reference data could be found in the cached data #summary structures. Update the reference data cached #every time the sumary data is cached. ### ptm.cache_ref_data() ptm.cache_default_project() data_iter = ptm.get_all_summary_cache() key_test = [] for d in data_iter: for data in d: key = utils.get_summary_cache_key( project, data['item_id'], data['item_data'], ) rv = cache.set(key, zlib.compress(data['value'])) if not rv: msg = "ERROR: Failed to store object in memcache: %s, %s\n" % \ ( str(data['item_id']), data['item_data'] ) sys.stderr.write(msg) ptm.disconnect()
def cache_test_summaries(project): ptm = PerformanceTestModel(project) ### #New reference data could be found in the cached data #summary structures. Update the reference data cached #every time the sumary data is cached. ### ptm.cache_ref_data() ptm.cache_default_project() data_iter = ptm.get_all_summary_cache() for d in data_iter: for data in d: key = utils.get_summary_cache_key( project, data['item_id'], data['item_data'], ) rv = cache.set(key, zlib.compress( data['value'] )) if not rv: msg = "ERROR: Failed to store object in memcache: %s, %s\n" % \ ( str(data['item_id']), data['item_data'] ) sys.stderr.write(msg) ptm.disconnect()
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 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()