Skip to content
Snippets Groups Projects
Commit bf7c4c5f authored by Nico Vermaas's avatar Nico Vermaas
Browse files

dashboard & query screens

parent 4eb2872c
No related branches found
No related tags found
3 merge requests!74Acceptance,!73Master,!65Dev nico
......@@ -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
......
......@@ -15,11 +15,7 @@
&nbsp;
<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>
</table>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment