Skip to content
Snippets Groups Projects

Master

Merged Nico Vermaas requested to merge master into release
5 files
+ 36
12
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -17,7 +17,7 @@ DJANGO_TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
@@ -17,7 +17,7 @@ DJANGO_TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
logger = logging.getLogger(__name__)
logger = logging.getLogger(__name__)
@timeit
@timeit
def get_size(status_list):
def get_size(status_list, type):
"""
"""
aggregate the sizes of all task with a status in the list
aggregate the sizes of all task with a status in the list
:param status_list: list of statuses to consider for the aggregation
:param status_list: list of statuses to consider for the aggregation
@@ -26,7 +26,11 @@ def get_size(status_list):
@@ -26,7 +26,11 @@ def get_size(status_list):
logger.info("get_size("+str(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'
query = field + '__sum'
tasks = Task.objects.filter(status__in=status_list)
tasks = Task.objects.filter(status__in=status_list)
sum_value = tasks.aggregate(Sum(field))[query]
sum_value = tasks.aggregate(Sum(field))[query]
@@ -40,10 +44,11 @@ def convert_logentries_to_html(log_entries):
@@ -40,10 +44,11 @@ def convert_logentries_to_html(log_entries):
results = ""
results = ""
try:
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>"
results += "<tbody>"
for log in log_entries:
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>"
line +='<td class="' + log.status + '" >' + log.status + "</td>"
try:
try:
line += "<td>" + str(log.timestamp.strftime("%m-%d-%Y, %H:%M:%S")) + "</td>"
line += "<td>" + str(log.timestamp.strftime("%m-%d-%Y, %H:%M:%S")) + "</td>"
Loading