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

add COLLECT_H5 logic

(including a database change)
parent 9b3b4943
No related branches found
No related tags found
1 merge request!361SDC-1423 use aggregation strategy
Pipeline #88885 passed
...@@ -9,7 +9,7 @@ import base64 ...@@ -9,7 +9,7 @@ import base64
from datetime import datetime from datetime import datetime
from django.db.models import Q, Sum from django.db.models import Q, Sum
import logging import logging
from .common import timeit, get_summary_flavour, SummaryFlavour from .common import get_summary_flavour, SummaryFlavour
from django.urls import reverse from django.urls import reverse
from ..models import Task, LogEntry, Workflow, Configuration from ..models import Task, LogEntry, Workflow, Configuration
from django.conf import settings from django.conf import settings
...@@ -22,7 +22,6 @@ DJANGO_TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" ...@@ -22,7 +22,6 @@ DJANGO_TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@timeit
def get_size(status_list, type): 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
...@@ -46,7 +45,6 @@ def get_size(status_list, type): ...@@ -46,7 +45,6 @@ def get_size(status_list, type):
return sum_value return sum_value
@timeit
def get_min_start_and_max_end_time(sas_id): def get_min_start_and_max_end_time(sas_id):
""" """
Retrieve the minimum start time en maximum end time of a set of taskids (sas_id) Retrieve the minimum start time en maximum end time of a set of taskids (sas_id)
......
...@@ -54,21 +54,6 @@ class AggregationStrategy(Enum): ...@@ -54,21 +54,6 @@ class AggregationStrategy(Enum):
COLLECT_H5 = "collect_h5" COLLECT_H5 = "collect_h5"
# this is a decorator that can be put in front (around) a function all to measure its execution time
def timeit(method):
def timed(*args, **kw):
ts = time.time()
result = method(*args, **kw)
te = time.time()
if 'log_time' in kw:
name = kw.get('log_name', method.__name__.upper())
kw['log_time'][name] = int((te - ts) * 1000)
else:
print('execution time: %r %2.2f ms' % \
(method.__name__, (te - ts) * 1000))
return result
return timed
def get_summary_flavour(task): def get_summary_flavour(task):
""" """
not every workflow has the same summary structure not every workflow has the same summary structure
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
{% include 'taskdatabase/pagination.html' %} {% include 'taskdatabase/pagination.html' %}
</div> </div>
</div> </div>
<p class="footer"> Version 22 Jul 2024 <p class="footer"> Version 23 Jul 2024
</div> </div>
{% include 'taskdatabase/refresh.html' %} {% include 'taskdatabase/refresh.html' %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment