diff --git a/atdb/taskdatabase/services/algorithms.py b/atdb/taskdatabase/services/algorithms.py index 262b0735d38d1e13b020fc3664132bdc4c1efb36..8f69e5bbe703effe0df71a96c49260ff773ff53a 100644 --- a/atdb/taskdatabase/services/algorithms.py +++ b/atdb/taskdatabase/services/algorithms.py @@ -186,6 +186,7 @@ def aggregate_resources_logs(): for status in settings.ACTIVE_STATUSSES: record = {} record['name'] = str(workflow.id) +' - '+ workflow.workflow_uri + # record['name'] = str(workflow.id) record['status'] = status # aggregate logentries per step for all active statusses (expensive) @@ -236,10 +237,12 @@ def construct_tasks_per_workflow_html(request, workflow_results): workflow_results = aggregate_resources_tasks() results_tasks = "<p>Progress of tasks per (active) workflow</p>" - header = "<th>Workflow</th>" + # construct the header + header = "<th>Workflow</th>" for status in settings.ALL_STATUSSES: header += "<th>" + status + "</th>" + results_tasks += header + '<th class="active">active</th><th>total</th><th>to process</th><th>processed</th>' for workflow_result in workflow_results: @@ -258,10 +261,7 @@ def construct_tasks_per_workflow_html(request, workflow_results): # bonus: add a query link link = construct_link(request, key, workflow_result['id'], d[key]) - values += "<td class=" + style + ">" + str(percentage) + "% (" + link + ")</td>" - #values += "<td class="+style+">" + str(percentage) + "% ("+str(d[key])+")</td>" - #values += "<td>" + str(d[key]) + "</td>" # add sizes values += "<td>" + str(human_readable(workflow_result['size_to_process'])) + "</td>" @@ -278,7 +278,11 @@ def construct_tasks_per_workflow_html(request, workflow_results): def construct_logs_per_workflow_html(log_records): - results_logs = "" + results_logs = "<p>Resources used per step per active workflow</p>" + + # construct the header + header = "<th>Workflow</th><th>Status</th><th>CPU cycles</th><th>wall clock time</th>" + results_logs += header for record in log_records: # distinguish active statusses @@ -290,8 +294,38 @@ def construct_logs_per_workflow_html(log_records): '<td class="' + style + '" >' + record['status'] + \ "</td><td>" + str(record['cpu_cycles']) + \ "</td><td>" + str(record['wall_clock_time']) + "</td><tr>" + + results_logs += line + + results_logs = "<tbody>" + results_logs + "</tbody>" + return results_logs + + +def construct_cpu_cycles_per_workflow_html(log_records): + results_logs = "<p>Resources used per step per active workflow</p>" + + # construct the header + header = "<th>Workflow</th>" + for status in settings.ALL_STATUSSES: + header += "<th>" + status + "</th>" + + results_logs += header + '<th>CPU cycles</th><th>wall clock time</th><th>to process</th><th>processed</th>' + + for record in log_records: + # distinguish active statusses + style = "" + if record['status'] in settings.ACTIVE_STATUSSES: + style = "active" + + line = "<tr><td><b>" + record['name'] + "</b></td>" \ + '<td class="' + style + '" >' + record['status'] + \ + "</td><td>" + str(record['cpu_cycles']) + \ + "</td><td>" + str(record['wall_clock_time']) + "</td><tr>" + + results_logs += line + results_logs = "<tbody>" + results_logs + "</tbody>" return results_logs diff --git a/atdb/taskdatabase/templates/dashboard/dashboard.html b/atdb/taskdatabase/templates/dashboard/dashboard.html index 0282275d66bdad706973b8bc96890929bb417982..ea2d4ff2246a3dff5022a3be6cc305f15f4b443e 100644 --- a/atdb/taskdatabase/templates/dashboard/dashboard.html +++ b/atdb/taskdatabase/templates/dashboard/dashboard.html @@ -15,11 +15,7 @@ <table class="table table-striped"> - <p>Resources used per step per active workflow</p> - <th>Workflow</th><th>Status</th><th>CPU cycles</th><th>wall clock time</th> - <tbody> - {{ results_logs | safe }} - </tbody> + {{ results_logs | safe }} </table> </div> </div>