From e2567c95ac20a02b96f00c8285f83b0b6aa97dec Mon Sep 17 00:00:00 2001 From: Vermaas <vermaas@astron.nl> Date: Tue, 23 Jul 2024 16:07:26 +0200 Subject: [PATCH] add COLLECT_H5 logic (including a database change) --- atdb/taskdatabase/services/algorithms.py | 4 +--- atdb/taskdatabase/services/common.py | 15 --------------- .../templates/taskdatabase/index.html | 2 +- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/atdb/taskdatabase/services/algorithms.py b/atdb/taskdatabase/services/algorithms.py index b95e5429..6f93f982 100644 --- a/atdb/taskdatabase/services/algorithms.py +++ b/atdb/taskdatabase/services/algorithms.py @@ -9,7 +9,7 @@ import base64 from datetime import datetime from django.db.models import Q, Sum import logging -from .common import timeit, get_summary_flavour, SummaryFlavour +from .common import get_summary_flavour, SummaryFlavour from django.urls import reverse from ..models import Task, LogEntry, Workflow, Configuration from django.conf import settings @@ -22,7 +22,6 @@ DJANGO_TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" logger = logging.getLogger(__name__) -@timeit def get_size(status_list, type): """ aggregate the sizes of all task with a status in the list @@ -46,7 +45,6 @@ def get_size(status_list, type): return sum_value -@timeit 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) diff --git a/atdb/taskdatabase/services/common.py b/atdb/taskdatabase/services/common.py index 0de7f323..efba7f12 100644 --- a/atdb/taskdatabase/services/common.py +++ b/atdb/taskdatabase/services/common.py @@ -54,21 +54,6 @@ class AggregationStrategy(Enum): 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): """ not every workflow has the same summary structure diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index 146d5ea8..1aa3b26b 100644 --- a/atdb/taskdatabase/templates/taskdatabase/index.html +++ b/atdb/taskdatabase/templates/taskdatabase/index.html @@ -31,7 +31,7 @@ {% include 'taskdatabase/pagination.html' %} </div> </div> - <p class="footer"> Version 22 Jul 2024 + <p class="footer"> Version 23 Jul 2024 </div> {% include 'taskdatabase/refresh.html' %} -- GitLab