diff --git a/core/pandajob/summary_error.py b/core/pandajob/summary_error.py index 186ff3fb..252620b1 100644 --- a/core/pandajob/summary_error.py +++ b/core/pandajob/summary_error.py @@ -162,8 +162,9 @@ def build_error_histograms(jobs, is_wn_instead_of_site=False): 'modificationtime': job['modificationtime'], 'site': job['computingsite'] if not is_wn_instead_of_site else job['wn'], 'code': ','.join(sorted(get_job_error_categories(job))), - 'task': job['jeditaskid'], + 'task': str(job['jeditaskid']), 'user': job['produsername'], + 'request': str(job['reqid']), }) timestamp_list.append(job['modificationtime']) @@ -175,12 +176,12 @@ def build_error_histograms(jobs, is_wn_instead_of_site=False): df.set_index('modificationtime', inplace=True) # Apply the function to each column where you want low-impact values grouped - for column in ['site', 'code', 'task', 'user']: + for column in ['site', 'code', 'task', 'user', 'request']: df = categorize_low_impact_by_percentage(df, column, threshold_percent) # Generate JSON-ready data for each column output_data = {} - for column in ['site', 'code', 'task', 'user']: + for column in ['site', 'code', 'task', 'user', 'request']: output_data[column] = prepare_binned_and_total_data(df, column, freq=freq) total_jobs_per_bin = df.resample(freq).size().reset_index(name='total') diff --git a/core/templates/errorSummary.html b/core/templates/errorSummary.html index f6624b6a..ce9de087 100644 --- a/core/templates/errorSummary.html +++ b/core/templates/errorSummary.html @@ -62,6 +62,7 @@
  • Error code
  • {% if 'computingsite' in requestParams %}WN{% else %}Site{% endif %}
  • User
  • +
  • Request
  • Task
  • @@ -88,6 +89,12 @@
    +
    +
    +
    +
    +
    +
    diff --git a/core/templates/wnInfo.html b/core/templates/wnInfo.html index c2cc2903..d560e942 100644 --- a/core/templates/wnInfo.html +++ b/core/templates/wnInfo.html @@ -17,6 +17,7 @@ {% endblock %} {% block extra_js %} + @@ -40,7 +41,9 @@
    {{ alert.title }}
    {% if wnname %}

    Worker node slot performance {% if wnname != 'all' %} for node {{ wnname }} {% endif %} at {{ site }}, sort by: - {% if 'sortby' in requestParams %}{% if requestParams.sortby == 'alpha' %}count{% else %}alpha{% endif %}{% else %}count{% endif %}

    + {% if 'sortby' in requestParams %}{% if requestParams.sortby == 'alpha' %}count{% else %}alpha{% endif %}{% else %}count,{% endif %} + copy time locked link +

    {% endif %} {% if wnPlotFailed %} @@ -258,6 +261,21 @@
    Warning!
    "scrollX": true, "aaSorting": [[20, 'desc']], }); + + // copy time locked link to clipboard button + let clipboard = new ClipboardJS('#copy-button'); + clipboard.on('success', function (e) { + let copy_button = document.getElementById('copy-button'); + copy_button.innerHTML = 'copied!'; + copy_button.classList.add('disabled'); + e.clearSelection(); + }); + + clipboard.on('error', function (e) { + let copy_button = document.getElementById('copy-button'); + copy_button.innerHTML = 'copying failed!'; + copy_button.classList.add('disabled'); + }); }); diff --git a/core/views.py b/core/views.py index d39fd4b2..68fc034d 100644 --- a/core/views.py +++ b/core/views.py @@ -3484,6 +3484,13 @@ def wnInfo(request, site, wnname='all'): if not is_json_request(request): xurl = extensibleURL(request) + time_format = '%Y-%m-%dT%H:%M' + time_locked_url = removeParam(removeParam(removeParam(removeParam(xurl, + 'date_from', mode='extensible'), + 'date_to', mode='extensible'), + 'hours', mode='extensible'), + 'days', mode='extensible' + ) + 'date_from=' + request.session['TFIRST'].strftime(time_format) + '&date_to=' + request.session['TLAST'].strftime(time_format) del request.session['TFIRST'] del request.session['TLAST'] data = { @@ -3501,6 +3508,7 @@ def wnInfo(request, site, wnname='all'): 'wnPlotFinished': wnPlotFinishedL, 'hours': hours, 'errthreshold': errthreshold, + 'time_locked_url': time_locked_url, 'warning': warning, 'built': datetime.now().strftime("%H:%M:%S"), } @@ -5636,13 +5644,16 @@ def errorSummary(request): # put into tmp table transaction_key = insert_to_temp_table([f['fileid'] for f in files_input_unfinished]) extra_str = f"""select id from {get_tmp_table_name()} where TRANSACTIONKEY = {transaction_key}""" - else: + elif len(files_input_unfinished) > 0: extra_str = ','.join([str(f['fileid']) for f in files_input_unfinished]) - wildCardExtension += f""" and pandaid in ( - select pandaid from {settings.DB_SCHEMA_PANDA}.filestable4 where jeditaskid={jeditaskid} and fileid in ({extra_str}) - union all - select pandaid from {settings.DB_SCHEMA_PANDA_ARCH}.filestable_arch where jeditaskid={jeditaskid} and fileid in ({extra_str}) - )""" + else: + extra_str = '' + if len(extra_str) > 0: + wildCardExtension += f""" and pandaid in ( + select pandaid from {settings.DB_SCHEMA_PANDA}.filestable4 where jeditaskid={jeditaskid} and fileid in ({extra_str}) + union all + select pandaid from {settings.DB_SCHEMA_PANDA_ARCH}.filestable_arch where jeditaskid={jeditaskid} and fileid in ({extra_str}) + )""" _logger.info('Finished set up view: {}'.format(time.time() - request.session['req_init_time'])) if not testjobs and 'jobstatus' not in request.session['requestParams']: