def successful_jobs(username, root_wf_id, wf_id): """ Get a list of all successful jobs of the latest instance for a given workflow. """ dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id) args = __get_datatables_args() total_count, filtered_count, successful_jobs_list = dashboard.get_successful_jobs(wf_id, **args) for job in successful_jobs_list: job.duration_formatted = filters.time_to_str(job.duration) job.exec_job_id = ( '<a href="' + url_for( ".job", root_wf_id=root_wf_id, wf_id=wf_id, job_id=job.job_id, job_instance_id=job.job_instance_id ) + '">' + job.exec_job_id + "</a>" ) return render_template( "workflow/jobs_successful.xhr.json", count=total_count, filtered=filtered_count, jobs=successful_jobs_list, table_args=args, )
def successful_jobs(username, root_wf_id, wf_id): """ Get a list of all successful jobs of the latest instance for a given workflow. """ dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id) args = __get_datatables_args() total_count, filtered_count, successful_jobs_list = dashboard.get_successful_jobs( wf_id, **args ) for i in range(len(successful_jobs_list)): successful_jobs_list[i] = successful_jobs_list[i]._asdict() successful_jobs_list[i]["DT_RowClass"] = "successful" successful_jobs_list[i]["root_wf_id"] = root_wf_id successful_jobs_list[i]["wf_id"] = wf_id successful_jobs_list[i]["duration_formatted"] = filters.time_to_str( successful_jobs_list[i]["duration"] ) d = { "draw": args["sequence"] if args["sequence"] else 0, "recordsTotal": total_count if total_count is not None else len(successful_jobs_list), "data": successful_jobs_list, } if args["limit"]: d["recordsFiltered"] = filtered_count return serialize(d)
def failed_invocations(username, root_wf_id, wf_id, job_id, job_instance_id): """ Get list of failed invocations for a given job. """ dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id) failed_invocations_list = dashboard.get_failed_job_invocation(wf_id, job_id, job_instance_id) for item in failed_invocations_list: item.remote_duration_formatted = filters.time_to_str(item.remote_duration) # is_xhr = True if it is AJAX request. if request.is_xhr: if len(failed_invocations_list) > 0: return render_template( "workflow/job/invocations_failed.xhr.html", root_wf_id=root_wf_id, wf_id=wf_id, job_id=job_id, job_instance_id=job_instance_id, invocations=failed_invocations_list, ) else: return "", 204 else: return render_template( "workflow/job/invocations_failed.html", root_wf_id=root_wf_id, wf_id=wf_id, job_id=job_id, job_instance_id=job_instance_id, invocations=failed_invocations_list, )
def failed_invocations(username, root_wf_id, wf_id, job_id, job_instance_id): """ Get list of failed invocations for a given job. """ dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id) failed_invocations_list = dashboard.get_failed_job_invocation( wf_id, job_id, job_instance_id) for item in failed_invocations_list: item.remote_duration_formatted = filters.time_to_str( item.remote_duration) # is_xhr = True if it is AJAX request. if request.is_xhr: if len(failed_invocations_list) > 0: return render_template('workflow/job/invocations_failed.xhr.html', root_wf_id=root_wf_id, wf_id=wf_id, job_id=job_id, job_instance_id=job_instance_id, invocations=failed_invocations_list) else: return '', 204 else: return render_template('workflow/job/invocations_failed.html', root_wf_id=root_wf_id, wf_id=wf_id, job_id=job_id, job_instance_id=job_instance_id, invocations=failed_invocations_list)
def successful_jobs(username, root_wf_id, wf_id): """ Get a list of all successful jobs of the latest instance for a given workflow. """ dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id) args = __get_datatables_args() total_count, filtered_count, successful_jobs_list = dashboard.get_successful_jobs( wf_id, **args) for job in successful_jobs_list: job.duration_formatted = filters.time_to_str(job.duration) job.exec_job_id = '<a href="' + url_for( '.job', root_wf_id=root_wf_id, wf_id=wf_id, job_id=job.job_id, job_instance_id=job.job_instance_id ) + '">' + job.exec_job_id + '</a>' return render_template('workflow/jobs_successful.xhr.json', count=total_count, filtered=filtered_count, jobs=successful_jobs_list, table_args=args)
def workflow_summary_stats(username, root_wf_id, wf_id): dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id) summary_times = dashboard.workflow_summary_stats(wf_id) for key, value in summary_times.items(): summary_times[key] = filters.time_to_str(value) return serialize(summary_times)
def workflow_summary_stats(username, root_wf_id, wf_id): dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id) summary_times = dashboard.workflow_summary_stats(wf_id) for key, value in summary_times.items(): summary_times[key] = filters.time_to_str(value) return json.dumps(summary_times)
def statistics(username, root_wf_id, wf_id): """ Get workflow statistics information """ dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id) summary_times = dashboard.workflow_summary_stats(wf_id) for key, value in summary_times.items(): summary_times[key] = filters.time_to_str(value) workflow_stats = dashboard.workflow_stats() return render_template('workflow/statistics.html', root_wf_id=root_wf_id, wf_id=wf_id, summary_stats=summary_times, workflow_stats=workflow_stats)
def failed_invocations(username, root_wf_id, wf_id, job_id, job_instance_id): """ Get list of failed invocations for a given job. """ dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id) failed_invocations_list = dashboard.get_failed_job_invocation( wf_id, job_id, job_instance_id ) for i in range(len(failed_invocations_list)): failed_invocations_list[i] = failed_invocations_list[i]._asdict() failed_invocations_list[i]["remote_duration"] = filters.time_to_str( failed_invocations_list[i]["remote_duration"] ) return serialize(failed_invocations_list)
def successful_invocations(username, root_wf_id, wf_id, job_id, job_instance_id): """ Get list of successful invocations for a given job. """ dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id) successful_invocations_list = dashboard.get_successful_job_invocation( wf_id, job_id, job_instance_id ) for i in range(len(successful_invocations_list)): successful_invocations_list[i] = successful_invocations_list[i]._asdict() successful_invocations_list[i]["remote_duration"] = filters.time_to_str( successful_invocations_list[i]["remote_duration"] ) return serialize(successful_invocations_list)
def successful_invocations(root_wf_id, wf_id, job_id): ''' Get list of successful invocations for a given job. ''' dashboard = Dashboard(g.master_db_url, root_wf_id, wf_id) successful_invocations_list = dashboard.get_successful_job_invocation(wf_id, job_id) for item in successful_invocations_list: item.remote_duration_formatted = filters.time_to_str(item.remote_duration) # is_xhr = True if it is AJAX request. if request.is_xhr: if len(successful_invocations_list) > 0: return render_template('workflow/job/invocations_successful.xhr.html', root_wf_id=root_wf_id, wf_id=wf_id, job_id=job_id, invocations=successful_invocations_list) else: return '', 204 else: return render_template('workflow/job/invocations_successful.html', root_wf_id=root_wf_id, wf_id=wf_id, job_id=job_id, invocations=successful_invocations_list)