def get_wf_stats(wf_uuid,expand = False): workflow_stampede_stats = None try: workflow_stampede_stats = StampedeStatistics(global_db_url , expand) workflow_stampede_stats.initialize(wf_uuid) except SchemaVersionError: logger.error("------------------------------------------------------") logger.error("Database schema mismatch! Please run the upgrade tool") logger.error("to upgrade the database to the latest schema version.") sys.exit(1) except: logger.error("Failed to load the database." + global_db_url ) logger.warning(traceback.format_exc()) sys.exit(1) return workflow_stampede_stats
def get_wf_stats(wf_uuid, expand=False): workflow_stampede_stats = None try: workflow_stampede_stats = StampedeStatistics(global_db_url, expand) workflow_stampede_stats.initialize(wf_uuid) except SchemaVersionError: logger.error("------------------------------------------------------") logger.error("Database schema mismatch! Please run the upgrade tool") logger.error("to upgrade the database to the latest schema version.") sys.exit(1) except: logger.error("Failed to load the database." + global_db_url) logger.warning(traceback.format_exc()) sys.exit(1) return workflow_stampede_stats
def get_workflows_uuid(): """ Returns the workflow uuid of a given workflow , this includes the id of all sub workflows. """ # expand = True try: expanded_workflow_stats = StampedeStatistics(global_db_url) expanded_workflow_stats.initialize(global_top_wf_uuid) expanded_workflow_stats.set_job_filter('all') except SchemaVersionError: logger.error("------------------------------------------------------") logger.error("Database schema mismatch! Please run the upgrade tool") logger.error("to upgrade the database to the latest schema version.") sys.exit(1) except: logger.error("Failed to load the database." + global_db_url ) sys.exit(1) #expand = False try: root_workflow_stats = StampedeStatistics(global_db_url , False) root_workflow_stats.initialize(global_top_wf_uuid) root_workflow_stats.set_job_filter('all') except SchemaVersionError: logger.error("------------------------------------------------------") logger.error("Database schema mismatch! Please run the upgrade tool") logger.error("to upgrade the database to the latest schema version.") sys.exit(1) except: logger.error("Failed to load the database." + global_db_url ) sys.exit(1) wf_det = root_workflow_stats.get_workflow_details()[0] # print workflow statistics global global_wf_id_uuid_map global_wf_id_uuid_map[wf_det.wf_id] = global_top_wf_uuid wf_uuid_list = [global_top_wf_uuid] desc_wf_uuid_list = expanded_workflow_stats.get_descendant_workflow_ids() for wf_det in desc_wf_uuid_list: global_wf_id_uuid_map[wf_det.wf_id] = wf_det.wf_uuid wf_uuid_list.append(wf_det.wf_uuid) return wf_uuid_list
def get_workflows_uuid(): """ Returns the workflow uuid of a given workflow , this includes the id of all sub workflows. """ # expand = True try: expanded_workflow_stats = StampedeStatistics(global_db_url) expanded_workflow_stats.initialize(global_top_wf_uuid) expanded_workflow_stats.set_job_filter('all') except SchemaVersionError: logger.error("------------------------------------------------------") logger.error("Database schema mismatch! Please run the upgrade tool") logger.error("to upgrade the database to the latest schema version.") sys.exit(1) except: logger.error("Failed to load the database." + global_db_url) sys.exit(1) #expand = False try: root_workflow_stats = StampedeStatistics(global_db_url, False) root_workflow_stats.initialize(global_top_wf_uuid) root_workflow_stats.set_job_filter('all') except SchemaVersionError: logger.error("------------------------------------------------------") logger.error("Database schema mismatch! Please run the upgrade tool") logger.error("to upgrade the database to the latest schema version.") sys.exit(1) except: logger.error("Failed to load the database." + global_db_url) sys.exit(1) wf_det = root_workflow_stats.get_workflow_details()[0] # print workflow statistics global global_wf_id_uuid_map global_wf_id_uuid_map[wf_det.wf_id] = global_top_wf_uuid wf_uuid_list = [global_top_wf_uuid] desc_wf_uuid_list = expanded_workflow_stats.get_descendant_workflow_ids() for wf_det in desc_wf_uuid_list: global_wf_id_uuid_map[wf_det.wf_id] = wf_det.wf_uuid wf_uuid_list.append(wf_det.wf_uuid) return wf_uuid_list