Skip to content
Snippets Groups Projects

Dev nico

Merged Nico Vermaas requested to merge dev-nico into acceptance
7 files
+ 61
24
Compare changes
  • Side-by-side
  • Inline

Files

@@ -17,7 +17,7 @@ DJANGO_TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
logger = logging.getLogger(__name__)
@timeit
def get_size(status_list):
def get_size(status_list, type):
"""
aggregate the sizes of all task with a status in the list
:param status_list: list of statuses to consider for the aggregation
@@ -26,7 +26,11 @@ def get_size(status_list):
logger.info("get_size("+str(status_list)+")")
field = 'size_to_process'
if type == 'processed':
field = 'size_processed'
else:
field = 'size_to_process'
query = field + '__sum'
tasks = Task.objects.filter(status__in=status_list)
sum_value = tasks.aggregate(Sum(field))[query]
@@ -40,10 +44,11 @@ def convert_logentries_to_html(log_entries):
results = ""
try:
results += "<th>service</th><th>status</th><th>timestamp</th><th>cpu_cycles</th><th>wall_clock_time</th><th>logfile</th>"
results += "<th>service</th><th>step</th><th>status</th><th>timestamp</th><th>cpu_cycles</th><th>wall_clock_time</th><th>logfile</th>"
results += "<tbody>"
for log in log_entries:
line = "<tr><td><b>" + log.step_name + '</b></td>'
line = "<tr><td><b>" + str(log.service) + '</b></td>'
line += "<td><b>" + str(log.step_name) + '</b></td>'
line +='<td class="' + log.status + '" >' + log.status + "</td>"
try:
line += "<td>" + str(log.timestamp.strftime("%m-%d-%Y, %H:%M:%S")) + "</td>"
Loading